摘要:
Tian Ji -- The Horse RacingTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8307Accepted Submission(s): 2300Problem DescriptionHere is a famous story in Chinese history."That was about 2300 years ago. General Tian Ji was a high official in the
阅读全文
posted @ 2011-11-27 11:09
Qiuqiqiu
阅读(156)
推荐(0)
编辑
摘要:
算法1:类似于筛选法求素数算法2:类似于求最长上升子序列O(nlogn)的算法 (View Code 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 const int N=5010; 5 struct stick 6 { 7 int l,w; 8 }a[N]; 9 int f[N];10 int cmp(const void *a,const void *b)11 {12 stick *a1=(stick*)a;13 stick *b1=(stick*)b;14 if (
阅读全文
posted @ 2011-11-26 19:59
Qiuqiqiu
阅读(187)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2093View Code 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 struct student 5 { 6 char name[15]; 7 int s,t; 8 }a[1000]; 9 char s1[15];10 int n=0,m,tt;11 int cmp(const void *a,const void *b)12 {13 student *a1=(student*)a;
阅读全文
posted @ 2011-11-26 15:10
Qiuqiqiu
阅读(345)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2037DP先按开始时间(t.s)排序 f[i]记录看第i个节目时,最多可看的节目数fori:=1 to n do for j:=1 to i-1 do if t[i].s>=t[j].e then f[i]:=max(f[i],f[j]+1);View Code 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 const int N=110; 5 struct tv 6 { 7 in
阅读全文
posted @ 2011-11-26 12:10
Qiuqiqiu
阅读(231)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1197View Code 1 #include <stdio.h> 2 int main() 3 { 4 const int A=10000; 5 int s1,s2,s3,a=2992,t; 6 s1=s2=s3=0; 7 while (a<A) 8 { 9 for (s1=0,t=a;t>0;t/=10) s1+=t%10;10 for (s2=0,t=a;t>0;t/=12) s2+=t%12;11 for (s3...
阅读全文
posted @ 2011-11-26 08:41
Qiuqiqiu
阅读(207)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2104最大公约数=1是YESView Code 1 #include <stdio.h> 2 int gcd(int x,int y) 3 { 4 return y==0?x:gcd(y,x%y); 5 } 6 int main() 7 { 8 int m,n; 9 while (scanf("%d%d",&m,&n) && m!=-1 && n!=-1)10 if (gcd(m,n)>1) printf("POO
阅读全文
posted @ 2011-11-26 07:56
Qiuqiqiu
阅读(127)
推荐(0)
编辑
posted @ 2011-11-22 23:41
Qiuqiqiu
阅读(0)
推荐(0)
编辑
posted @ 2011-11-22 23:39
Qiuqiqiu
阅读(0)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=3033I love sneakers!Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1107Accepted Submission(s): 455Problem DescriptionAfter months of hard working, Iserlohn finally wins awesome amount of scholarship. As a
阅读全文
posted @ 2011-11-08 21:25
Qiuqiqiu
阅读(407)
推荐(1)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1712ACboy needs your helpTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 901Accepted Submission(s): 450Problem DescriptionACboy has N courses this term, and he plans to spend at most M days on study.Of cour
阅读全文
posted @ 2011-11-08 16:58
Qiuqiqiu
阅读(264)
推荐(0)
编辑