摘要:
problem给定字符串A,B。求串A中可以分割出多少个互不相同的串B(不能重叠)。solution模板题,没啥好说的。 KMP匹配:如果成功,就把j==0,从头开始匹配,答案累加。codes#include#include#includeusing nam... 阅读全文
摘要:
problem模拟操作系统的进程调度给定每一个进程的进程号,到达时间,执行时间和运行优先级。(已经按到达时间从小到大排序)如果一个进程到达的时候CPU是空闲的,则它会一直占用CPU直到该进程结束。除非在这个过程中,有一个比它优先级高的进程要运行。如果一个进程... 阅读全文
摘要:
problem两个长为n的序列A,B。保证AB已升序排序。在AB中各任取一个值相加得到N^2 个数。求其中最小的N个数n #include#includeusing namespace std;const int maxn = 1e5+10;int n, a... 阅读全文
摘要:
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... 阅读全文
摘要:
problem给定n个整数,在其中任意选出两个进行xor运算,得到的结果最大值是多少?nusing namespace std;const int maxn = 1e5+10;int tot, tire[maxn*32][2];void insert(int... 阅读全文
摘要:
problem给定n个长度不超过10的数字串(n#include#includeusing namespace std;const int maxn = 1e5+10;int tire[maxn][26], val[maxn], tot;void build... 阅读全文