上一页 1 ··· 33 34 35 36 37
摘要: 求最大长度,刚开始没有用use数组,和两个数组遍历,超时。网上查了一下用数组,再改成一个循环遍历过去就好了。#include "stdio.h"#includeint city[30][30],max,n,m,use[30][30];//city保存输入的连接关系,use 0为走过,1走过,max最... 阅读全文
posted @ 2015-01-30 11:37 xryz 阅读(148) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"#include "string.h"int main(){ int n,cas,i,j,p[25],w[25],right,left,temp,cnt; char s[100]; scanf("%d",&cas); while(cas--... 阅读全文
posted @ 2015-01-28 15:31 xryz 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"int map[5][5],max,n;//map输入的地图,max最大碉堡数,n地图大小bool set(int x,int y)//判断是否可以放置碉堡,只考虑当前空格左上角的情况{ int i; for(i=x-1; i>=0; i--) ... 阅读全文
posted @ 2015-01-28 10:48 xryz 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 刚开始,将输入的每种价值的大理石都%2。以为是剪枝,后来和同学交流才发现,当数据为 0 0 2 0 0 1 是错误的。改了一下代码才AC。下次不要犯这些小错误了……#include "stdio.h"#include "string.h"//ave每个人应该获得大理石价值//a1-a6记录各种大理石... 阅读全文
posted @ 2015-01-27 22:18 xryz 阅读(155) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"int main(){ int n; while(~scanf("%d",&n)) { if((n-2)%4==0) printf("yes\n"); else printf("no\n"); } return 0;} ... 阅读全文
posted @ 2015-01-27 21:15 xryz 阅读(111) 评论(0) 推荐(0) 编辑
摘要: hdu 5138 CET-6 test#includeint main(){ int n,f; while(~scanf("%d",&n)) { f=0; if(n-15>0) {if(f!=0) printf(" ");printf("%d",n-15... 阅读全文
posted @ 2014-12-06 22:01 xryz 阅读(115) 评论(0) 推荐(0) 编辑
摘要: hdu 5123 who is the best?#include#includeint main(){ int t,n,a[105],i,j,max,b; while(~scanf("%d",&t)) while(t--) { memset(a,0,s... 阅读全文
posted @ 2014-12-06 18:18 xryz 阅读(118) 评论(0) 推荐(0) 编辑
摘要: hdu5104 Primes Problem#includeint prime(int m){ int i; for(i=2;i*i<=m;i++) { if(m%i==0) return 0; } return 1;}int main(){ in... 阅读全文
posted @ 2014-12-06 12:10 xryz 阅读(117) 评论(0) 推荐(0) 编辑
上一页 1 ··· 33 34 35 36 37