摘要: #includeint a[100100];int main() {int n,i,k;while(scanf("%d%d",&n,&k)!=EOF) {if(k==n) {printf("-1\n");continue;}for(i=2;i<=k+1;i++)a[i]=i;for(i=k+3;i<... 阅读全文
posted @ 2013-11-20 21:43 HYDhyd 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #includeint a[100100];int main() {int n,i,k;while(scanf("%d%d",&n,&k)!=EOF) {if(k==n) {printf("-1\n");continue;}for(i=2;i<=k+1;i++)a[i]=i;for(i=k+3;i<... 阅读全文
posted @ 2013-11-20 21:42 HYDhyd 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 刚开始以为是搜索白忙活了原来是个简单的找规律,以后要多想啊此题是两马同时跳A. Two Semiknights Meettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstan... 阅读全文
posted @ 2013-11-20 21:08 HYDhyd 阅读(138) 评论(0) 推荐(0) 编辑
摘要: #include//这题挺有意思小学学的算盘int main() {int n,i,m;while(scanf("%d",&n)!=EOF) {if(n==0) {printf("O-|-OOOO\n");continue;}while(n) {m=n%10;if(m>=5) {printf("-O... 阅读全文
posted @ 2013-11-20 20:04 HYDhyd 阅读(106) 评论(0) 推荐(0) 编辑
摘要: #include#includeint cmp(const void *a,const void *b) {return *(int *)a-*(int *)b;}int main() { int n,m,i,a[3100],flag; while(scanf("%d%d",&n,&m)!=EOF)... 阅读全文
posted @ 2013-11-20 19:46 HYDhyd 阅读(104) 评论(0) 推荐(0) 编辑
摘要: #include#includeint huzhi(int n) {//欧拉函数公式int i,j=n;for(i=2;i1)//当n为2时用到此步j=j/n*(n-1);return j;}int main() {int n;while(scanf("%d",&n),n) {printf("%d\... 阅读全文
posted @ 2013-11-20 15:31 HYDhyd 阅读(100) 评论(0) 推荐(0) 编辑
摘要: #include#include#define inf 999999999#define N 151000int a[N],c[N];int main() {int n,k,i,j,min,p,t;while(scanf("%d%d",&n,&k)!=EOF) {min=inf;memset(c,0... 阅读全文
posted @ 2013-11-20 11:17 HYDhyd 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #include#include//刚做codeforces上的比赛题我都没看懂啊啊啊啊啊啊int main() {int n,m,i,k,visit[110],total;while(scanf("%d%d",&n,&m)!=EOF) {total=0;while(n--) {scanf("%d"... 阅读全文
posted @ 2013-11-20 10:42 HYDhyd 阅读(101) 评论(0) 推荐(0) 编辑
摘要: #includeint main() {int a,b,c,n,sum,max,i;while(scanf("%d",&n)!=EOF) {if(nmax)max=sum;sum=2;}}if(sum>max)max=sum;printf("%d\n",max);}return 0;} 阅读全文
posted @ 2013-11-20 10:32 HYDhyd 阅读(110) 评论(0) 推荐(0) 编辑