SELECTION-SCREEN SKIP.SELECTION-SCREEN END OF BLOCK a01.*&---------------------------------------------------------------------**& Start of main progr...
分类:
其他好文 时间:
2015-04-13 16:31:30
阅读次数:
119
求所有长度为 len 的串s中,最多包含多少个不重叠的子串, 的期望。开始觉得把s分成若干段这个操作让人无法下手, 但是其实一个简单的贪心就可以了, 因为如果所有子串不互相包涵的话, 一定是能取就取, 如果没有特殊限制的话, 可以把所有包含另一个子串的子串直接删掉或者是在建ac自动机的时候把end传...
分类:
其他好文 时间:
2015-04-13 16:10:25
阅读次数:
190
这个题如果按照正常想法,一般是两边遍历,第一遍是计算链表的长度;然后确定倒数第n个节点的正序号,然后访问即可。好一点的方法是找一个指针p指向头结点后的n+1个节点,然后同时对头结点和p向后移动,如果p=Null了,这时head指针就恰好指向倒数第n+1个节点。这里有个问题,假如n恰好等于链表的长度,...
分类:
其他好文 时间:
2015-04-13 16:07:53
阅读次数:
176
Python字符串处理函数简明返回被去除指定字符的字符串默认去除空白字符删除首尾字符:str.strip([char])删除首字符:str.lstrip([char])删除尾字符str.strip([char])判断是否匹配首末字符匹配成功返回True,否则返回False匹配首字符:str.startswith(char[,start[,end]])匹配末..
分类:
编程语言 时间:
2015-04-13 13:03:21
阅读次数:
140
#import "ViewController.h"@interface ViewController ()@property(nonatomic,strong)UIButton *btn;@property(nonatomic,strong)CALayer *calayer;@end@implem...
分类:
其他好文 时间:
2015-04-13 12:36:36
阅读次数:
199
字符串方法:len(s)int(s)ord(s)与chr(ASCII)find(s[,start,end])rfindstrip(s)去除首尾空格lstriprstripsplita(s)index(sub)rindex(sub)s.encode([encoding])s.decode([encod...
分类:
编程语言 时间:
2015-04-13 10:51:01
阅读次数:
122
今天让我们来看一看ios线程中是怎么样通信的。
#import "ViewController.h"
@interface ViewController ()
{
UIImageView *_image;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super...
分类:
移动开发 时间:
2015-04-13 09:40:43
阅读次数:
133
类似于,我们加载网页时候的进度条,我们来看看它们是怎么工作的。
#import "ViewController.h"
@interface ViewController ()
{
UIProgressView *_view;
}
@end
@implementation ViewController
- (void)viewDidLoad {
...
分类:
移动开发 时间:
2015-04-13 09:37:32
阅读次数:
155
Title:Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. Af...
分类:
其他好文 时间:
2015-04-13 09:27:27
阅读次数:
88
int a[] = {2,3,4,5,10}; int n = 5; vector coll(a,a+n); sort(coll.begin(), coll.end(), greater()); //copy(coll.begin(), coll.end(), ostream...
分类:
其他好文 时间:
2015-04-13 00:11:16
阅读次数:
115