摘要: Problem Description要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 __int64 exgcd(int a,int b,__int64 &x,__int64 &y){ if(b==0) { x=1;y=0;return a; } __int64 r=exgcd(b,a%b,x,y); __int64 temp=x;x=y;y=temp-(a/b)*y; return r... 阅读全文
posted @ 2013-12-20 17:09 段少 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Problem Description给你两个集合,要求{A} + {B}.注:同一个集合中不会有两个相同的元素.Input每组输入数据分为三行,第一行有两个数字n,m(0int a[20001];int main(){ int n,m,j,i,t; while(scanf("%d%d",&n,&m)==2) { for(i=0;ia[j+1]) { t=a[j];a[j]=a[j+1];a[j+1]=t; } printf("%d",a[0]); ... 阅读全文
posted @ 2013-12-20 15:32 段少 阅读(243) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionWhereIsHeroFrom: Zty, what are you doing ?Zty: I want to calculate N!......WhereIsHeroFrom: So easy! How big N is ?Zty:1 int main(){ int n,sum,i,a[41]; a[0]=a[1]=1;sum=1; for(i=2;i<=40;i++) { sum*=i; sum%=2009; a[i]=sum; } while(scanf("%d",&n... 阅读全文
posted @ 2013-12-20 15:17 段少 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThe Sky is Sprite.The Birds is Fly in the Sky.The Wind is Wonderful.Blew Throw the TreesTrees are Shaking, Leaves are Falling.Lovers Walk passing, and so are You.................................Write in English class by yifenfeiGirls are clever and bright. In HDU every girl like m 阅读全文
posted @ 2013-12-20 14:47 段少 阅读(157) 评论(0) 推荐(0) 编辑