摘要: 其实求的这个数的式子化简一下,就是C(N,M).....#include #include #include #define LL __int64using namespace std;LL N,M;LL myc(LL n,LL r){ LL sum=1; for(LL i=1;i<=r;i++) ... 阅读全文
posted @ 2014-09-27 11:11 chenjunjie1994 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 枚举病的组合,再把牛的状态与之作或运算,若值仍是病组合的状态,则可以加1,否则,跳过。#include #include #include using namespace std;int cow[1100],n,D,K;int ans;int hm(int k){ int h=0; while(k)... 阅读全文
posted @ 2014-09-27 10:55 chenjunjie1994 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 简单求组合数,直接运用公式。注意C(n,k)=C(n,n-k)。#include #include #include #define LL __int64using namespace std;LL myc(LL n, LL r){ LL sum=1; for(LL i=1;in-r?n-r:r; ... 阅读全文
posted @ 2014-09-27 09:20 chenjunjie1994 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 按字典序选一个六组合。简单DFS#include #include #include using namespace std;int se[20];int ans[20];void dfs(int ps,int position,int k){ if(position>k){ if(ps==6){... 阅读全文
posted @ 2014-09-27 09:12 chenjunjie1994 阅读(177) 评论(0) 推荐(0) 编辑