
数论
StoolMonster
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 3037 Saving Beans (Lucas定理)
#include #include #include #include #include #include #include #include #include using namespace std; #define LL long long #define ULL unsigned long long #define del(a,b) memset(a,b,sizeof(a)原创 2015-09-14 14:26:49 · 419 阅读 · 0 评论 -
hdu 1215 七夕节
#include #include #include using namespace std; struct node { int x; int n; }pp[42000]; int T,N,ans,tmp; int P[42000]; int quick_pow(int x,int n) { if(n==0) return 1; int cn原创 2015-10-13 16:56:36 · 316 阅读 · 0 评论 -
cf#324 Div.2 Problem D Dima and Lisa
哥德巴赫猜想。。。 #include #include #include #include using namespace std; int n,k,p1,p2,p3; bool isp(int x) { if(x==2) return true; else if(!(x&1)) return false; else { double tmp=sqrt(x*1原创 2015-10-07 17:21:45 · 416 阅读 · 0 评论 -
cf#324 Div.2 Problem B Kolya and Tanya
#include #include using namespace std; #define MOD 1000000007 #define LL long long int n; LL fp(LL a,int b) { LL cnt=1; while(b) { if(b&1) cnt=cnt*a%MOD; a=a*原创 2015-10-07 12:15:51 · 380 阅读 · 0 评论 -
Acdream 1061 郭式树
Acdream 1061 郭式树 #include #include #include using namespace std; #define ULL unsigned long long #define LL long long int main(){ int T;scanf("%d",&T); LL A,B; ULL ans; //ULL a原创 2015-09-16 11:10:21 · 444 阅读 · 0 评论 -
cf#320 Div.2 Problem A Raising Bacteria
一道简单的十进制数转化为二进制数的问题,答案是二进制数数位上1的个数 #include #include #include using namespace std; int A[33]={1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,20原创 2015-09-17 02:40:34 · 340 阅读 · 0 评论 -
cf#320 Div.2 Problem D "Or" Game
#include #include #include using namespace std; #define LL long long int n,k,x; int a[200005],l[200005],r[200005]; int main(){ scanf("%d%d%d",&n,&k,&x); for(int i=1;i<=n;i++) scanf(原创 2015-09-17 03:06:58 · 531 阅读 · 0 评论 -
HDU 5446 Unknown Treasure
#include #include #include using namespace std; #define ULL unsigned long long #define LL long long LL N,M; int T,K; LL Prime[12],B[12]; LL power(LL a,LL b,LL p){ LL res=1; while(b!=0){原创 2015-09-16 02:13:01 · 370 阅读 · 0 评论 -
大数 平方根
出处链接:大数平方根 先把 一些没有 成熟的代码 以及思路放在这里 手动开根号的基本方法:1、整数开平方步骤: (1)将被开方数从右向左每隔2位用撇号分开; (2)从左边第一段求得算数平方根的第一位数字; (3)从第一段减去这个第一位数字的平方,再把被开方数的第二段写下来,作为第一个余数; (4)把所得的第一位数字乘以20,去除第一个余数,所得的转载 2015-09-16 02:09:17 · 1950 阅读 · 0 评论 -
hdu 2504 又见GCD
#include #include #include #include #define del(a,b) memset(a,b,sizeof(a)) using namespace std; int n,a,b,c; int gcd(int a,int b) { while(b!=0) { int r=b; b=a%b; a=原创 2015-10-13 17:41:02 · 318 阅读 · 0 评论