随笔分类 -  ACM~动态规划

摘要:DescriptionHere’s a simple graph problem: Find the shortest pathfrom the top-middle vertex to the bottom-middle vertexin a given tri-graph. A tri-graph is an acyclic graph of(N ≥ 2) rows and exactly 3 columns. Unlike regulargraphs, the costs in a tri-graph are associated with thevertices rather than 阅读全文
posted @ 2011-07-19 20:40 Crazy_yiner 阅读(218) 评论(0) 推荐(0)
摘要:SkyscraperDescriptionThe Build n' Profit construction company is about to build its tallest building. It will be huge, the tallest building in the world by a wide margin. It will house hundreds of thousands of people and have rocket-powered elevators to the upper floors. They even plan for a shu 阅读全文
posted @ 2011-05-16 23:33 Crazy_yiner 阅读(514) 评论(0) 推荐(0)
摘要:#include<iostream>#include<stdio.h>const int MIN = -999999999;//定义MIN为只读变量 为一个非常小的值int a[100001];int ans[100001];using namespace std;int main(){ int n; int an; while(scanf("%d",&n)!=EOF) { if(n==0) break; int sum=0; int k=MIN; for(int i=1;i<=n;i++) { scanf("%d" 阅读全文
posted @ 2011-05-16 22:58 Crazy_yiner 阅读(223) 评论(0) 推荐(0)
摘要:#include<stdio.h> #include<string.h> char a[101],b[101],d[101]; int c[101][101]; int max(int x,int y) { if(x>y) return x; else return y;}int main(){ int lena,lenb,i,j,k,m; while(scanf("%s%s",a+1,b+1)!=EOF) { m=0;memset(d,0,sizeof(d)); lena=strlen(a+1); lenb=strlen(b+1); for( 阅读全文
posted @ 2011-05-16 22:37 Crazy_yiner 阅读(206) 评论(0) 推荐(0)