摘要: 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) 编辑
摘要: http://poj.org/problem?id=2242 知道外接圆半径公式就好了,r=a*b*c/(4*s),水题。 #include<stdio.h>#include<math.h>const double pi=3.141592653589793;int main(void){ double C,r,x1,y1,x2,y2,x3,y3,a,b,c,s,p; whil... 阅读全文
posted @ 2012-08-28 20:46 Yogurt Shen 阅读(156) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2196 看懂题意就没问题了,水题。 #include<stdio.h>const int Base10[]={1000,100,10,1};const int Base12[]={1728,144,12,1};const int Base16[]={4096,256,16,1};int main(void){ int Sum10... 阅读全文
posted @ 2012-08-28 20:44 Yogurt Shen 阅读(147) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2017 水题不解释。 #include<stdio.h>int main(void){ int num,sum,left,v,t,i; while(scanf("%d",&num),num!=-1) { sum=left=0; for(i=0;i<num;i++) { ... 阅读全文
posted @ 2012-08-28 20:43 Yogurt Shen 阅读(170) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2000 我承认我的写法略坑爹,看代码思路应该也好懂,好歹这里全都是我自己原创的吧#- -。。。 #include<stdio.h>const int MAX=141;int a[MAX];int main(void){ int i,j,k,n,t,sum; for(i=1;i<MAX;i++) a[i]=i... 阅读全文
posted @ 2012-08-28 20:42 Yogurt Shen 阅读(216) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1922 注意精度问题然后向上取整,水题。 #include<stdio.h>#include<math.h>int main(void){ int N,i,v,t; double x,min; while(scanf("%d",&N),N) { min=1e100; for(i=0;... 阅读全文
posted @ 2012-08-28 20:39 Yogurt Shen 阅读(109) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1581 嗯。。。知道罚金怎么算了吧- -# #include<stdio.h>#include<string.h>int main(void){ int i,j,n,ans,tem,times[300],solve[300],a[10]; char name[300][100]; while(scanf("%d",&... 阅读全文
posted @ 2012-08-28 20:37 Yogurt Shen 阅读(232) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1552 其实直接两重循环枚举数对,然后分别判断前后两倍关系好了,我无聊地排了个序就为了个只判断一次。。。- -# #include<cstdio>#include<algorithm>using namespace std;int main(void){ int a[20],n,ans,i,j; scanf("%d",&a... 阅读全文
posted @ 2012-08-28 20:35 Yogurt Shen 阅读(112) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1005 可能第一遍读下来题意不懂,看下面代码应该能懂了吧- -#注意向上取整就好了。 #include<stdio.h>#include<math.h>#define PI 3.1415926int main(void){ int N,i,year; double x,y,calc; scanf("%d",&N); ... 阅读全文
posted @ 2012-08-28 20:31 Yogurt Shen 阅读(140) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1004 水题不解释 #include<stdio.h>int main(void){ double a[12],avg,sum=0.0; int i; for(i=1;i<=12;i++) scanf("%lf",&a[i]),sum+=a[i]; printf("$%.2f\n",sum/12)... 阅读全文
posted @ 2012-08-28 20:28 Yogurt Shen 阅读(91) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1003 水题不解释,非常无聊地用了一些二分- -# #include<stdio.h>#include<math.h>const double delta=1e-6;int main(void){ double len[300],c; int i,l,r,mid; len[0]=0.0; for(i=1;i<3... 阅读全文
posted @ 2012-08-28 20:26 Yogurt Shen 阅读(71) 评论(0) 推荐(0) 编辑