摘要:        
problem求每个字符串的最短循环子串,输出循环次数solution任何一个字符串的[1,Next[n]]与[n-Next[n],n]一定是匹配的。那么如果n%(n-Next[n])==0,他就是一个循环串,他的循环节长度为n-Next[n],循环次数为n...    阅读全文
posted @ 2018-08-10 21:06
gwj1139177410
阅读(119)
评论(0)
推荐(0)
        
            
        
        
摘要:        
problem给定字符串A,B。求串A中可以分割出多少个互不相同的串B(不能重叠)。solution模板题,没啥好说的。 KMP匹配:如果成功,就把j==0,从头开始匹配,答案累加。codes#include#include#includeusing nam...    阅读全文
posted @ 2018-08-10 20:19
gwj1139177410
阅读(125)
评论(0)
推荐(0)
        
            
        
        
摘要:        
problem模拟操作系统的进程调度给定每一个进程的进程号,到达时间,执行时间和运行优先级。(已经按到达时间从小到大排序)如果一个进程到达的时候CPU是空闲的,则它会一直占用CPU直到该进程结束。除非在这个过程中,有一个比它优先级高的进程要运行。如果一个进程...    阅读全文
posted @ 2018-08-10 14:25
gwj1139177410
阅读(184)
评论(0)
推荐(0)
        
            
        
        
摘要:        
problem两个长为n的序列A,B。保证AB已升序排序。在AB中各任取一个值相加得到N^2 个数。求其中最小的N个数n #include#includeusing namespace std;const int maxn = 1e5+10;int n, a...    阅读全文
posted @ 2018-08-10 12:20
gwj1139177410
阅读(123)
评论(0)
推荐(0)
        
            
        
        
摘要:        
problem给定n个二次函数(ai,bi,ci > 0)求前m小的fi(x)值,x>0n, m #includeusing namespace std;const int maxn = 1e4+5;struct func{int a, b, c;}f[ma...    阅读全文
posted @ 2018-08-10 11:48
gwj1139177410
阅读(147)
评论(0)
推荐(0)
        
            
        
        
摘要:        
problem给定n个整数,在其中任意选出两个进行xor运算,得到的结果最大值是多少?nusing namespace std;const int maxn = 1e5+10;int tot, tire[maxn*32][2];void insert(int...    阅读全文
posted @ 2018-08-10 11:05
gwj1139177410
阅读(152)
评论(0)
推荐(0)
        
            
        
        
摘要:        
problem给定n个长度不超过10的数字串(n#include#includeusing namespace std;const int maxn = 1e5+10;int tire[maxn][26], val[maxn], tot;void build...    阅读全文
posted @ 2018-08-10 10:32
gwj1139177410
阅读(158)
评论(0)
推荐(0)
        

 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号