07 2014 档案
摘要:ZOJ3543 Number String状态f[i][j]表示长度为I的全排列,符合字符串的要求,最后一位数字是j的方案数。重点在要始终保持是f算的排列的数量,然后转移时用这些推出来新的情况。就是j#include #include using namespace std;const long l...
阅读全文
摘要:poj2749 Building roadshttp://poj.org/problem?id=2749二分答案,以后构造布尔表达式。 相互讨厌是!((a and b)or(!a and !b) 化简得 (!a or !b)and(a or b) 相互喜欢是!(a and !b)or(!a an...
阅读全文
摘要:A -Painting the sticks因为不能覆盖涂/涂两次,所以就数数有几个三个一块儿就行了。#includeint a[100],ans ;int main(){ int n , t = 0 ; while (scanf("%d",&n)!=EOF) { for (...
阅读全文
摘要:```cpp#includeint a[100],ans ;int main(){ int n , t = 0 ; while (scanf("%d",&n)!=EOF) { for (int i=1; i0) ; ++t ; printf("C...
阅读全文
摘要:1 线段树回答区间最大字段和对前缀和序列用线段树做RMQ#include #include #include using namespace std;/** * 待处理序列A从1到N * min对应的序列是前缀和序列右移一位 */const int MaxN = 500000;#define le...
阅读全文
摘要:使用Tire进行DP的递推,f[i+len]+=f[i] 若S[i+1..len]为字典中的元素。 1 #include 2 #include 3 #include 4 5 const long long maxnode = 4010*100; 6 const long long SI...
阅读全文

浙公网安备 33010602011771号