摘要: 听说有了打表算法算法之后,就觉得按位DP太他妈蛋疼了。直接把整个数据规模划分成10000为段的数据进行离线打表。然后再对多余的部分进行暴力就可以了。打表代码:#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;int fun(int x){ if (x == 0) return 0; else return fun(x/10) + x % 10; }bool Ac(int x){ int t = fun(x); if (x % t == 0) return true 阅读全文
posted @ 2012-08-21 21:51 沐阳 阅读(2125) 评论(5) 推荐(1)