摘要: int PowerMod(int a, int b, int c){int ans = 1;a = a % c;while(b>0){ if(b % 2 = = 1)ans = (ans * a) % c;b = b/2;a = (a * a) % c;}return ans;} 阅读全文
posted @ 2017-10-21 20:54 lmjer 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 子集生成 增量构造法 #include<stdio.h>bool a[100];bool vis[100];int n;void dfs(int num){ if(num==n+1) { for (int i=1;i<=n;i++) // if(a[i]) printf("%d ",a[i]); p 阅读全文
posted @ 2017-10-21 20:52 lmjer 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 14.二分 #include<stdio.h> int a[100000]; int main(){ int n; scanf("%d",&n); for (int i=0;i<n;i++){ scanf("%d",&a[i]); } int m; scanf("%d",&m); int l=0;/ 阅读全文
posted @ 2017-10-21 20:51 lmjer 阅读(133) 评论(0) 推荐(0) 编辑