上一页 1 ··· 17 18 19 20 21
摘要: http://poj.org/problem?id=1008按第一种记录方法算出总天数,然后按第二种记录方式输出。#include#includechar Hab[20][11] = { "","pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", & 阅读全文
posted @ 2013-08-02 11:08 N_ll 阅读(172) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1005#include#include#include const double pi = acos(-1.0);int main(){ int t,j; scanf("%d",&t); for (int i = 1;i = 1.0/2*(pi*r)) break; cnt++; } printf("Property %d: This property will begin eroding in year %d.\n",i, cnt); } ... 阅读全文
posted @ 2013-08-02 11:05 N_ll 阅读(138) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1003题意:最上面的卡片露出它下面卡片的1/2,第二个上面的卡片露出它下面的1/3,......,依次类推。。求能放的卡片数。。。#include#includeint main(){ double len; while(~scanf("%lf",&len)&&len) { double sum = 0; int i; for ( i = 2;; i ++) { sum +=1.0/i; if(sum >= len) ... 阅读全文
posted @ 2013-08-02 10:18 N_ll 阅读(156) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1046纯水题。。找距离最短的输出。。#include#includeconst int INF=1<<28;struct node{ int r; int g; int b;} a[20];int main(){ int i,r1,g1,b1,dis,pos; for (i = 0 ; i < 16; i ++) { scanf("%d%d%d",&a[i].r,&a[i].g,&a[i].b); } while(1) { int min = INF; ... 阅读全文
posted @ 2013-08-02 09:57 N_ll 阅读(125) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2000#includeconst int N=10010;int main(){ int coin[N]; long long n,i = 1,j,k; j = 1; k = 0; while (i = j) { k = 0; j++; } } while(~scanf("%lld",&n)&&n) { long long scoin = 0; for (i = 1; i <= n; i ++... 阅读全文
posted @ 2013-08-02 09:50 N_ll 阅读(154) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1218题意:门的状态有两种开或关,初始化为开,每次进行状态转换,第一次把门号是1的倍数的门状态转换,第二次把门号是2的倍数的门状态转换,......,第n次把状态是n的倍数的门状态转换,输出最后有几个门是开的状态。#include#includeint main(){ int i, t,a[1010],n; scanf("%d",&t); while(t--) { scanf("%d",&n); memset(a,0,sizeof(a)); for (i = 1; i <= .. 阅读全文
posted @ 2013-08-02 09:46 N_ll 阅读(164) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2017 1 #include 2 int main() 3 { 4 int n,mile,hour; 5 while(~scanf("%d",&n)&&n!=-1) 6 { 7 int sum = 0,h = 0; 8 while(n--) 9 {10 scanf("%d%d",&mile,&hour);11 h = hour-h;12 sum += mile*h;13 h ... 阅读全文
posted @ 2013-08-02 09:36 N_ll 阅读(108) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> struct node { int pre; int wei; } p[1001],tem; int main() { int t,i,j,n,m; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); for (i = 0; i < m; i ++) scanf("%d%d",&p[i].pre,&p[i].wei); for (i ... 阅读全文
posted @ 2013-05-19 23:56 N_ll 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 分析: 采用贪心策略,先将分数从高到低排序,每次都先保证分数最高的作业能在规定时间内做完。代码:#include<stdio.h>#include<stdlib.h>#include<string.h>int v[1010];struct node{ int t; int num;} g[1010],temp;int main(){ int t,n,i,j; while(~scanf("%d",&t)) { while(t--) { int sum = 0; memset(v,0,sizeof... 阅读全文
posted @ 2013-05-19 23:46 N_ll 阅读(109) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21