摘要: 容斥原理。 算出不限制硬币数量的方案,-限制1+限制2-限制3+限制4。 限制就是用d+1个硬币。 #include #include #include using namespace std; const int maxn = 100000+10; long long f[maxn],res; int t,c[5],d[5]; void dfs(int dep,int sum,in... 阅读全文
posted @ 2016-04-30 12:24 invoid 阅读(123) 评论(0) 推荐(0) 编辑
摘要: spaly. #include #include #include using namespace std; const int maxn = 100000 + 10; int n,m,q; char op[10]; struct Splay { int f[maxn],l[maxn],r[maxn],s[maxn],a[maxn],fa[maxn]; int root;... 阅读全文
posted @ 2016-04-30 11:08 invoid 阅读(158) 评论(0) 推荐(0) 编辑