
简单题
文章平均质量分 69
zck921031
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces Round #125A About Bacteria
Qwerty the Ranger took up a government job and arrived on planet Mars. He should stay in the secret lab and conduct some experiments on bacteria that have funny and abnormal properties. The job isn't原创 2012-06-24 09:24:11 · 537 阅读 · 0 评论 -
POJ 1157 花束摆放
//花束摆放问题,类似于背包,方程为f[i][j]=max{f[i][j-1],f[i-1][j-1]+a[i][j]} i=1..F, j=i+1..V//初始f[i][i]预先算出来, f[0][]={0}, 结果为f[F][V]//F为花朵数,V为花瓶数#include #include const int S=105;int a[S][S],f[S][S];in原创 2012-07-02 21:05:29 · 1235 阅读 · 0 评论 -
POJ 1405 Heritage
递推式a[i+1]=a[i]*(a[i]+1) 输出的是a[i]+1要用高精度,最后答案在5.2w位左右。#include #include using namespace std;#define DIGIT 4#define DEPTH 10000#define MAX 15000typedef int bignum_t[MAX+1];void原创 2012-07-02 17:46:38 · 800 阅读 · 0 评论 -
POJ 2081 Recaman's Sequence
map水过2400ms+懒得改成hash了 DescriptionThe Recaman's sequence is defined by a0 = 0 ; for m > 0, am = am−1 − m if the rsulting am is positive and not already in the sequence, otherwise am = am−1 + m.原创 2012-06-30 15:31:27 · 493 阅读 · 0 评论 -
POJ 1012 约瑟夫问题
学会打表。。。其实程序计算也挺快的,left=n-i; j=(m-1)%left+1;这两句加上去1s内就把表打好了。经典约瑟夫问题,直接用数组做的。 #include #include using namespace std;int h[40];int check(int n,int m,int k){ memset(h,0,sizeof(h));原创 2012-06-30 14:45:37 · 487 阅读 · 0 评论 -
POJ 2551 ones
超水,看懂题目很重要111%3=0111111%7=0...#include using namespace std;int main(){ int n,i,y; while (cin>>n){ y=1;i=1; while (y!=0){ i++; y=(y*10+原创 2012-06-30 14:08:23 · 453 阅读 · 0 评论 -
POJ 1700 3404 Crossing River
有一艘船只能载两个人,总共有n个人要过河,每个人过河需要时间t[i], 两人共同过河时间为 max(t[i],t[j]),求过河时间最短。每次载最慢的两个人过河都有两种方法。 可以是t[0] t[1] 一起,也可以是t[0]一个人来回载。 #include #include using namespace std;#define MAX(x,y) (x<y?y:x)#d原创 2012-06-30 12:44:59 · 541 阅读 · 0 评论 -
POJ 2328 大水题
求个最大值最小值,right on的时候判断一下是否合法就可以了。 #include #include using namespace std;char buff[30];int main(){ int n,max,min,x; while (1){ min=-1; max=100; while (1原创 2012-06-28 17:14:52 · 520 阅读 · 0 评论 -
POJ 2707 水题,输入输出
http://poj.org/problem?id=2707 #include #define MIN(x,y) (x<y?x:y)#define MAX(x,y) (x<y?y:x)int main(){ int a,b,c,d; double t1,t2,t; while (scanf("%d %d %d %d",&a,&b,&c,&d),a!原创 2012-07-10 18:05:38 · 1130 阅读 · 0 评论 -
POJ 2739 素数
http://poj.org/problem?id=2739#include int plist[10000],pcount=0;int prime(int n){ int i; if ((n!=2&&!(n%2))||(n!=3&&!(n%3))||(n!=5&&!(n%5))||(n!=7&&!(n%7))) return 0; for (i=0;plis原创 2012-07-10 17:51:41 · 770 阅读 · 1 评论 -
POJ 2719 9进制数
就是将9进制转换为10进制,很简单http://poj.org/problem?id=2719#include int ch[10];int main(){ int x,i,sum,k,tmp; for (i=0;i<=3;i++) ch[i]=i; for (i=4;i<=9;i++) ch[i]=i-1; while (scanf("原创 2012-07-10 17:38:45 · 670 阅读 · 0 评论 -
POJ 3664 排序,水题
Election TimeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5531 Accepted: 2998DescriptionThe cows are having their first election after overthrowing原创 2012-06-28 16:04:24 · 1517 阅读 · 0 评论 -
POJ 2601 Simple calculations 利用单调性,二分找出答案
看完题目后,得到公式a[i]=2*a[i-1]-a[i-2]+2*c[i-1]; YY发现a[n+1]随a[1]增大而增大,那么就对a[1]二分吧,精度1e-4,1A。Simple calculationsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5989 Accepte原创 2012-06-25 16:20:14 · 1328 阅读 · 0 评论 -
POJ 1331 Multiply 进制转换
只是简单的转换了一下进制,很容易MultiplyTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4761 Accepted: 2551Description6*9 = 42" is not true for base 10, but is true for原创 2012-06-25 15:48:49 · 744 阅读 · 0 评论 -
POJ 3051 Satellite Photographs 图的连通块,dfs即可。大水题。
用dfs算出每个连通块的大小即可DescriptionFarmer John purchased satellite photos of W x H pixels of his farm (1 <= W <= 80, 1 <= H <= 1000) and wishes to determine the largest 'contiguous' (connected) pasture. P原创 2012-06-25 10:36:08 · 1363 阅读 · 0 评论 -
POJ 1953
用最朴素的方法打出前三十组数据,发现是fibonacci数列,直接水过。此外还可以用排列组合的方法。n=3时,由插空法得C(4,0)+C(3,1)+C(2,2); n=k时则是sigma C(k-i+1,i) (i=0..(k+1)/2) Problem Given a positive integer n, determine the number of different原创 2012-07-03 13:57:21 · 699 阅读 · 0 评论