Apple Delivery

摘要: #include <iostream>#include <algorithm>#include <string.h>#include <stdlib.h>#include <stdio.h>#include <vector>#include <queue>using namespace std;const int N=200005;int n,m,p0,p1,p2;int best1[N],best2[N];struct Node { int ed,dist;};bool operator <(const 阅读全文
posted @ 2011-07-14 22:16 jaxi 阅读(171) 评论(0) 推荐(0) 编辑

Treasure Chest

摘要: #include <iostream>#include <stdio.h>#include <stdlib.h>#include <string.h>using namespace std;const int N=5005;int n;int coins[N],dp[N],sum[N];int max(int a,int b){ return a>b?a:b;}int RangeSum(int i,int j) { return sum[j]-sum[i-1];} //from i to j;int main (){ scanf(" 阅读全文
posted @ 2011-07-14 21:32 jaxi 阅读(146) 评论(0) 推荐(0) 编辑

The Trough Game

摘要: #include <iostream>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <string>using namespace std;int n,m;char str[101][21];int num[101];int main (){ scanf("%d%d",&n,&m); for(int i=1;i<=m;++i) scanf("%s%d",&str[i],&nu 阅读全文
posted @ 2011-07-14 21:29 jaxi 阅读(187) 评论(0) 推荐(0) 编辑

first flood

摘要: /* Discription: There is a graph,on which has both directed edges and indirected edges. The goal is to calculate the sum of the minimum distance between source vertex to 'broken vertex' and 'broken vertex' to source vertex. Solution: Build the graph,with the help of the Algorithm cal 阅读全文
posted @ 2011-04-24 20:37 jaxi 阅读(241) 评论(0) 推荐(0) 编辑