摘要:
按距离从小到大排序 f[i][j][0或1]表示在i或j还有i-j没有完成 转移 注意边界 比如:dp[0][i],dp[0][c+3]初值应为inf #include<bits/stdc++.h> using namespace std; const int N=1e3+30,inf=1e6; i 阅读全文
摘要:
CQOI2009 叶子的染色 树里的定义:叶子节点(1-n)没有后继节点。 然后树形DP 初始化 代码: #include<bits/stdc++.h> using namespace std; const int N=1e4+33; #define ll long long const ll in 阅读全文
摘要:
BZOJ3687 https://vjudge.net/problem/HYSBZ-3687 注意是所有子集和的异或和。 #include<bits/stdc++.h> using namespace std; int n; bitset<2000007>a; int main(){ cin>>n; 阅读全文