2010年11月29日

摘要: //现在还有点不太明白,记录一下,慢慢体会Human Gene FunctionsTime Limit:1000MSMemory Limit:10000KTotal Submissions:10338Accepted:5718DescriptionIt is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have be 阅读全文
posted @ 2010-11-29 14:52 yming0221 阅读(242) 评论(0) 推荐(0)
摘要: CompromiseTime Limit:1000MSMemory Limit:65536KTotal Submissions:3300Accepted:1542Special JudgeDescriptionIn a few months the European Currency Union will become a reality. However, to join the club, the Maastricht criteria must be fulfilled, and this is not a trivial task for the countries (maybe ex 阅读全文
posted @ 2010-11-29 13:13 yming0221 阅读(126) 评论(0) 推荐(0)

2010年11月23日

摘要: Agri-NetTime Limit:1000MSMemory Limit:10000KTotal Submissions:17635Accepted:7091DescriptionFarmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.Farmer John ordered a high speed connecti 阅读全文
posted @ 2010-11-23 21:52 yming0221 阅读(116) 评论(0) 推荐(0)

2010年11月22日

摘要: #include<stdio.h>#define MAX 10001int flag[MAX];int main(){ memset(flag,0,sizeof(flag)); int i; int sum,tmp; for(i=1;i<MAX;i++) { sum=tmp=i; while(tmp) { sum+=tmp%10; tmp/=10; } if(sum<MAX) flag[sum]=1; } for(i=1;i<MAX;i++... 阅读全文
posted @ 2010-11-22 17:39 yming0221 阅读(101) 评论(0) 推荐(0)

2010年11月21日

摘要: http://zh.wikipedia.org/zh/%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%92题目描述:依次从左到右给你n个数字,每次取出一个数字(这个数字不能是最两边的数字), 这个数字和它左右两边的数字(一共三个数字)相乘,累加这个数。直到最后仅剩下两个数字。求最后累加的最小值。分析:dp。 dp[i][j] 表示把第 i 个数字到第 j 个数字之间(不包括i,j)的数字去光后得到的最小值。设 x[i] 是第 i 个数字的值。dp[i][j] = min(dp[i][k] + dp[k][j] + x[i] * x[k] * x[j]),i + 1 < 阅读全文
posted @ 2010-11-21 20:40 yming0221 阅读(133) 评论(0) 推荐(0)

2010年11月20日

摘要: char result[100];void add(char *s1,char *s2){ char a[100],b[100]; int i,Len,Len1,Len2,k; memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); memset(result,0,sizeof(result)); Len1=strlen(s1); Len2=strlen(s2); if(Len1>Len2) Len=Len1; else Len=Len2; k=0; for(i=Len1-1;i>=0;i--... 阅读全文
posted @ 2010-11-20 21:03 yming0221 阅读(157) 评论(0) 推荐(0)
摘要: 最大公约数(greatest common divisor,简写为gcd;或highest common factor,简写为hcf),指某几个整数共有因子中最大的一个。int gcd(int a,int b){ int r; if(a<0) a=-a; while(b!=0) { r=a%b; a=b; b=r; } return a;}int gcd(int x,int y) { while(x!=y) { if(x>y) x-=y; else y-=x; } return x;} 阅读全文
posted @ 2010-11-20 20:33 yming0221 阅读(143) 评论(0) 推荐(0)

2010年11月19日

摘要: Oil DepositsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 6282Accepted: 3557DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the 阅读全文
posted @ 2010-11-19 08:45 yming0221 阅读(126) 评论(0) 推荐(0)

2010年11月18日

摘要: 放苹果Time Limit:1000MSMemory Limit:10000KTotal Submissions:15927Accepted:10049Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。Output对输入的每组数据M和N,用一行输出相应的K。Sample Input17 3Sample Output8#include< 阅读全文
posted @ 2010-11-18 16:51 yming0221 阅读(141) 评论(0) 推荐(0)
摘要: 高手分析:求阶乘末尾0的个数,对于较小的数的话可以计算出来后在算末尾0的个数,但是数字较大的时候则比较麻烦,可以通过如下原理反复的除以5得到最后的结果:原理是: 假如你把1×2×3×4×……×N中每一个因数分解质因数,结果就像: 1 × 2 × 3 × (2 × 2) × 5 × (2 × 3) × 7 × (2 × 2 ×2) ×…… 10进制数结尾的每一个0都表示有一个因数10存在——任何进制都一样,对于一个M进制的数,让 阅读全文
posted @ 2010-11-18 15:04 yming0221 阅读(190) 评论(0) 推荐(0)

导航