摘要: http://poj.org/problem?id=2351 烦烦更健康。。。 #include<stdio.h>#include<string.h>char *x[]={"WET","0","UTC","0","GMT","0","BST","+1","IST","+1","WEST","+1","CET",&q 阅读全文
posted @ 2012-08-28 23:22 Yogurt Shen 阅读(372) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1008 奇葩的名字输入蛋疼。。。 #include<stdio.h>#include<string.h>char *haabm[]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh&quo 阅读全文
posted @ 2012-08-28 23:18 Yogurt Shen 阅读(140) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3080 最长公共子串,感觉自己写的不错~ #include<stdio.h>#include<string.h>const int maxm=10+2;const int maxs=60+2;int main(void){ int loop,m,len,i,j,k; char p[maxm][maxs],ans[maxs]... 阅读全文
posted @ 2012-08-28 23:11 Yogurt Shen 阅读(151) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1488 它逗你玩儿- -# #include<stdio.h>int main(void){ int c,q=1; while((c= getchar())!=-1) { if(c=='"') { printf("%s",q?"``":"''"); ... 阅读全文
posted @ 2012-08-28 23:04 Yogurt Shen 阅读(128) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2246 矩阵相乘,不明白方法的同学去看一下线性代数~~~ #include<stdio.h>typedef struct{ int mults,rows,cols;}triple;int rows[256],cols[256],p;char e[100],error; triple expressio... 阅读全文
posted @ 2012-08-28 23:01 Yogurt Shen 阅读(146) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2260 挺水的。。。 #include<stdio.h>#define MAXN 102int n,a[MAXN][MAXN],row[MAXN],col[MAXN];int main(void){ int i,j,k,cc,cr; while(scanf("%d",&n)&&n) { for(i=0;... 阅读全文
posted @ 2012-08-28 22:52 Yogurt Shen 阅读(174) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1555 我再也不想写if-else了。。。。。 #include<stdio.h>int main(void){ int i,low,high,flag,num[9]; while(scanf("%d%d%d%d%d%d%d%d%d",&num[8],&num[7],&num[6],&num[5],&num[4],&num... 阅读全文
posted @ 2012-08-28 22:50 Yogurt Shen 阅读(268) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1504 水题不解释。 #include<stdio.h>int reverse(int n){ int j=0; while(n>0) { j=j*10+n%10; n/=10; } return j;}int main(void){ int n,i,a,b,sum; ... 阅读全文
posted @ 2012-08-28 22:42 Yogurt Shen 阅读(136) 评论(0) 推荐(0) 编辑
摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=256 还是耐心,注意细节。 #include<iostream>#include<string>#include<cstdio>using namespace std;const string weeks[]={"Monday","Tuesday","Wednesday... 阅读全文
posted @ 2012-08-28 22:37 Yogurt Shen 阅读(220) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2080 耐心,注意细节。 #include<iostream>#include<string>using namespace std;string week[]={"Saturday","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"};int day[]={0,3... 阅读全文
posted @ 2012-08-28 22:25 Yogurt Shen 阅读(171) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2083 递归,分治思想。 #include<stdio.h>char box[730][730]={"",""};void drawFractalBox(int n,int x,int y){ int i=n,c=1; while(--i) c=c*3; if(c==1) { box[... 阅读全文
posted @ 2012-08-28 22:17 Yogurt Shen 阅读(244) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2013 水水更健康~~ #include<stdio.h>#include<string.h>int main(void){ int n,i,set=1; char a[16][26]; while(scanf("%d",&n),n) { for(i=0;i<n;i++) sc... 阅读全文
posted @ 2012-08-28 22:10 Yogurt Shen 阅读(159) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1979 嗯、模板题。 #include<iostream>#include<cstdio>#include<cstring>using namespace std;bool vis[21][21];int cnt,w,h;void dfs(int x,int y){ if(x>0&x<=w&&y>0&&y<=h&&!vis[x]... 阅读全文
posted @ 2012-08-28 22:05 Yogurt Shen 阅读(148) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1281 第一遍读题目可能有点不明白,就是要模拟几种操作,a加入,r删除(如果可能),p删除,e终止。 双端队列很吊的样子,虽然还不太会,先在这里记录一下吧。 #include<iostream> #include<cstdio> #include<cstring>#include<algorithm> ... 阅读全文
posted @ 2012-08-28 21:52 Yogurt Shen 阅读(331) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/external/110/11000.html 我会告诉你我很无聊么- -# #include<stdio.h>int main(void){ int n,i; long long a,b,c,d; while(scanf("%d",&n),n!=-1) { a=1; b=0; ... 阅读全文
posted @ 2012-08-28 21:39 Yogurt Shen 阅读(145) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1316 来自POJ Discuss的暴力…… #include<stdio.h>int main(void){ bool a[10050]={false}; int i,j,k,l; for(i=0;i<10;i++) for(j=0;j<10;j++) for(k=0;k<10;... 阅读全文
posted @ 2012-08-28 21:21 Yogurt Shen 阅读(149) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3299 公式转换下,细节地方注意下getchar( )就没什么了- -# #include<stdio.h>#include<math.h>#define max 9999double totem(double dew,double hum){ double e=6.11*exp(5417.7530*((1/273.16)-(1... 阅读全文
posted @ 2012-08-28 20:54 Yogurt Shen 阅读(239) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3094 水水更健康- -# #include<stdio.h>#include<string.h>int main(void){ char c[255]; int sum,i; while(gets(c)&&c[0]!='#') { sum=0; for(i=0;i<strlen(c... 阅读全文
posted @ 2012-08-28 20:52 Yogurt Shen 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 素数打表,水题。 #include<stdio.h>#include<string.h>const int Max=1000001;bool isprime[Max];int main(void){ int i,j,a,d,n; memset(isprime,true,sizeof(isprime)); for(i=3;i<=1000;i+=2) for(j=... 阅读全文
posted @ 2012-08-28 20:51 Yogurt Shen 阅读(201) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2739 素数上限不大而且每次要算,就先离线预处理了,也水。 #include<stdio.h>int prime[2000],n=10000,total=0;bool isprime(int k){ for(int i=0;i<total;i++) if(k%prime[i]==0) return ... 阅读全文
posted @ 2012-08-28 20:49 Yogurt Shen 阅读(121) 评论(0) 推荐(0) 编辑