Problem Description
There are m soda
and today is their birthday. The 1-st
soda has prepared n cakes
with size 1,2,…,n.
Now 1-st
soda wants to divide the cakes into m parts
so that the ...
分类:
其他好文 时间:
2015-08-10 22:08:02
阅读次数:
125
本题正解是tarjan,我没有去写
用两次BFS,第一次BFS在原图的反图上做,从n开始,找到从n出发能够达到到达的所有点。
第二次BFS从起点开始,保存每个点到n点路径上面的最小值mp[i]。
最后遍历一遍,求出w[i]-mp[i]的最大值即可。
#include
#include
#include
#include
#define MAXN 100005
using namespace...
分类:
其他好文 时间:
2015-08-10 22:07:30
阅读次数:
210
1>使用场合
1.如果仅仅是显示图片,不需要监听图片的点击,用UIImageView
2.既要显示图片又要监听图片的点击,用UIButton
2>相同的地方:能显示图片
3>不同点
UIBttton能处理点击事件,UIImageView不能处理点击事件
UIButton既能显示图片,又能显示文字
UIButton能同时显示两张图片
按钮既能显示图片又能显示文字...
分类:
其他好文 时间:
2015-08-10 22:10:10
阅读次数:
102
背景:由于HTTP是无状态的协议,这样我们无法判断同一个用户多次请求时记录用户的信息从而需要频繁的身份校验,包括开启多个浏览器浏览同一个网站依旧需要不停的都身份验证。这样就产生了session机制,可以理解成Session基于保持状态的Web服务器的方法,那么cookie就是基于保持状态的客户端方法。由于一般的Session唯一标示SessionID又依赖于cookie的存储(这里只是相对,因为s...
分类:
其他好文 时间:
2015-08-10 22:09:10
阅读次数:
185
Problem Description
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M
Angel's friends want to save Angel. Their task is: approach Angel. W...
分类:
其他好文 时间:
2015-08-10 22:06:45
阅读次数:
102
NSData *xmlData = [[NSData alloc]initWithContentsOfFile:[NSString stringWithFormat:@"%@/People.xml",[[NSBundle mainBundle] resourcePath]]];
//2.将xmlData转化成xml文档
GDataXMLDocument *xmlDocument...
分类:
其他好文 时间:
2015-08-10 22:09:10
阅读次数:
98
题意:有N对钥匙,M扇门,每对钥匙要是用了其中一个另外一个就会马上消失,每扇门上有两把锁,只要打开其中一把锁门就打开了。开门顺序是输入的顺序,问最多能开几扇门。
思路:因为是按遇到门的顺序开门,很自然想到二分门的数量mid,然后用2-SAT判断mid时候符合条件。对于每对钥匙a1和a2,a1->~a2(选了a1就不能选a2),a2->a1(选了a2就不能选a1),对于每扇门b1和b2,b1 OR b2=1,~b1->b2, ~b2->b1....
分类:
其他好文 时间:
2015-08-10 22:08:12
阅读次数:
86
Tree2cycle
Time Limit: 15000/8000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)
Total Submission(s): 1730 Accepted Submission(s): 401
Problem Description
A tree with N...
分类:
其他好文 时间:
2015-08-10 22:08:23
阅读次数:
122
题目:Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing all 1’s and return its area.For example, given the following matrix:1 0 1 0 0
1 0 1 1 1
1 1 1 1 1
1 0 0 1 0Ret...
分类:
其他好文 时间:
2015-08-10 22:07:02
阅读次数:
128
...
分类:
其他好文 时间:
2015-08-10 22:08:02
阅读次数:
131
Pumas are large ,cat-like animals which are found in America.When reports came into London Zoo that a wild puma had been spotted fourty-five miles sou...
分类:
其他好文 时间:
2015-08-10 22:04:37
阅读次数:
162
1、看好不买一直涨,追涨买后变熊样! 2、气愤不过卖掉;卖后立即涨! 3、两选一必然选错,买的下跌,没买的大涨! 4、选错后改正错误,换股,又换错! 5、下决心不搞短线,长期持股,则长期不涨! 6、抛了长线,第二天涨停! 7、又去搞短线,立即被套! 8、给别人推荐的涨,自己手里的跌。点评:股票是风险...
分类:
其他好文 时间:
2015-08-10 22:06:33
阅读次数:
120
A -最大子段和Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uDescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calcula...
分类:
其他好文 时间:
2015-08-10 22:05:33
阅读次数:
123
Delegate在iOS开发中随处可见,Delegate是一种功能强大的软件架构设计理念,它的功能是程序中一个对象代表另一个对象,或者一个对象与另外一个对象协同工作(如小明喜欢一个女孩如花,却苦于没有如花的联系方式,于是叫好兄弟小东去拿如花联系方式,小东同学一天后返回结果给小明,....)。小明能否...
分类:
其他好文 时间:
2015-08-10 22:06:01
阅读次数:
133
通道题意:给定n个点的树,问树的直径有多少条代码:#include#includeconst int N=500000;const int inf=0x3fffffff;int head[N],num,Len[N],ans,node[N],k;struct edge{ int ed,w,nex...
分类:
其他好文 时间:
2015-08-10 22:02:43
阅读次数:
107
1.使用序列化需要在对象中实现NSCoding协议NSCoding协议方法:encodeWithCoder和initWithCoder,将一个对象序列化需要实现这2个方法。@protocol NSCoding- (void)encodeWithCoder:(NSCoder *)aCoder;-(vo...
分类:
其他好文 时间:
2015-08-10 22:03:25
阅读次数:
117
encry.php文件 1 <?php 2 3 define("filePath","D:\\digitalCertificate\\"); 4 define("pfxFileName","jsc.pfx"); 5 define("password","jsb"); 6 7 /*实现.pfx文件.....
分类:
其他好文 时间:
2015-08-10 22:04:00
阅读次数:
210