摘要:
bfsView Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <algorithm>using namespace std;#define maxl 50#define maxn 105struct Elem{ int age; char name[maxl];}decendant[maxn];struct Edge{ int v, next, w;}edge[maxn];int n;int head[maxn 阅读全文
posted @ 2012-07-10 10:31
undefined2024
阅读(192)
评论(0)
推荐(0)
摘要:
dp,这一题是没有后效性的,只要在保证了每个子问题时间最少的基础上在追求运送次数最少即可。是不会有运送次数减少了,而时间却增多了的情况的。所以时间最优是次数最优的前提。所以状态转移的时候,只要从自问题的时间最优的情况来,肯定没错。f[i] = max(f[j], arrive_time[i]) + each_time * 2View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define max 阅读全文
posted @ 2012-07-10 09:59
undefined2024
阅读(237)
评论(0)
推荐(0)