public class Solution { public ListNode detectCycle(ListNode head) { ListNode slow = head; ListNode fast = head; boolean hasCy...
分类:
其他好文 时间:
2014-09-09 11:13:48
阅读次数:
204
CollectViewController.h@interface CollectViewController : UIViewController@property(nonatomic,retain)NSMutableArray *dataSource;@property(nonatomic,re...
分类:
移动开发 时间:
2014-09-07 23:41:15
阅读次数:
344
先把2*n个数字接成一个模式串P,复制两次的P为串T,然后在T上进行KMP找对P匹配的多个终点,然后就是用Polya定理了,需要求逆元。 1 #include 2 #include 3 #include 4 #include 5 #define mod 1000000007 6 using ...
分类:
其他好文 时间:
2014-09-07 00:58:34
阅读次数:
192
@interface …@property (原子性,可写性,内存管理) id name;@end原子性: nonatomic, atomic 默认atomic可写性: readwrite, readonly 默认readwrite内存管理: assign, retain, copy 默认as...
分类:
其他好文 时间:
2014-09-04 18:32:19
阅读次数:
191
MainViewController.h#import<UIKit/UIKit.h>
@interfaceMainViewController:UIViewController
@property(nonatomic,retain)UISwitch*leftSwitch;
@endMainViewController.m#import"MainViewController.h"
@interfaceMainViewController()
@end
@implementationMainViewC..
分类:
其他好文 时间:
2014-09-04 10:37:49
阅读次数:
174
一般我们在开发程序时,只管alloc,不需要管release,因为有ARC帮我们管理。但是在学习时仍需要了解:内存是有限的,在堆区分配了内存后,如果不需要,则要回收,不然内存不够引起崩溃。...
分类:
其他好文 时间:
2014-09-03 19:52:47
阅读次数:
229
UVA 11090 - Going in Cycle!!
题目链接
题意:给定一个有向图,球平均权值最小的回路
思路:二分+判负环,每次二分一个值mid,判断是否存在小于mid的环,那么就是(w1 + w2 + w3...) / n
代码:
#include
#include
#include
#include
#include
using namespa...
分类:
其他好文 时间:
2014-09-03 00:19:05
阅读次数:
257
‘Numerous' studies in the past appear to have shown a link between cycling and ED. The researchers admit that they 'cannot completely discount' thes.....
分类:
其他好文 时间:
2014-09-02 15:33:04
阅读次数:
265