摘要: 地址:http://codeforces.com/contest/242/problem/A裁判不记得投硬币游戏最后的详细信息,只记得一些大概情况,输出所有可能情况 1 #include<stdio.h> 2 3 int x,y,a,b; 4 5 int main() 6 { 7 int i,j,n=0; 8 scanf("%d %d %d %d",&x,&y,&a,&b); 9 for(i=a;i<=x;i++)10 for(j=b;j<=y;j++)11 {12 if(i>j) n++;13 ... 阅读全文
posted @ 2013-01-20 22:52 tjsuhst 阅读(142) 评论(0) 推荐(0)
摘要: 地址:http://hustoj.sinaapp.com/problem.php?id=1833动态规划a[i][j]储存输入的金字塔,F[i][j]储存a[i][j]处能达到的最大值状态方程:F[i][j]=max{F[i+1][j], F[i+1][j+1]}+a[i][j] 1 #include<stdio.h> 2 int n; 3 int a[1000][1000]={0},F[1000][1000]={0}; 4 5 int main() 6 { 7 int i,j; 8 scanf("%d",&n); 9 for(i=0;i<n;i+ 阅读全文
posted @ 2013-01-20 10:48 tjsuhst 阅读(209) 评论(0) 推荐(0)