- 博客(2)
- 资源 (12)
- 收藏
- 关注
原创 CF 402-D 贪心
觉得题目描述应改为 r>1 中间理解错:g是前r个数的gcd,不是一些共同因数的乘积 #include #include #include #include using namespace std; #define N 40003 int gcd(int a, int b) { if(b==0) return a; return gcd(b, a%b); } int a
2014-03-31 00:53:38 871
原创 CF401-D dp的好题
dp[i][j] 表示状态i(用到了哪些数字)下的数字组合中,模m余j的个数有多少个,想清楚为什么能用i表示算出所有答案 vis[i][j][k] 表示状态i下余j的情况下,下个数字是k,它叠加了没,必须为bool,会暴内存,因为数字中可能有重复,如果不标记可能被叠加多次 抄别人的代码 #include #include #include #include #include #in
2014-03-16 11:36:43 987
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人