夏夜、

心若平似镜、何题不AC。

2013年9月3日

UVA 1292 Strategic game 树形DP

摘要: 基础题目。 dp[i][j]表示结点为i,且父节点选取情况为j的状态(j=1表示选,0不选)//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef pair pii;#define pb(a) pus 阅读全文

posted @ 2013-09-03 21:01 BMan、 阅读(216) 评论(0) 推荐(0) 编辑

UVA 10817 Headmaster's Headache 状态DP

摘要: 因为每个人只能选一次,所以枚举状态的时候从大到小。读入数据比较麻烦,可以用istringstream 或sscanf 或自己写个函数逐个字符处理。//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef 阅读全文

posted @ 2013-09-03 19:13 BMan、 阅读(254) 评论(0) 推荐(0) 编辑

UVA 10564 Paths through the Hourglass DP

摘要: 注意用long long。//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef pair pii;#define pb(a) push_back(a)#define INF 0x1f1f1f1f#d 阅读全文

posted @ 2013-09-03 17:00 BMan、 阅读(260) 评论(0) 推荐(0) 编辑

导航