
插头DP?
文章平均质量分 65
大蒟蒻syk
这个作者很懒,什么都没留下…
展开
-
[HDU1693]Eat the Trees && 插头DP
bool x, y 打成int 搞了我好久QAQ#include#include#include#include#include#include#define SF scanf#define PF printfusing namespace std;typedef long long LL;const int MAXN = 12;const int MAXS = 1 <<原创 2015-04-10 23:50:14 · 467 阅读 · 0 评论 -
[ural1519]Formula 1 && 插头DP
这里用的是最小整数表示法 具体方法参考cdq论文- - if(U)里面多打了个else引发了一场腥风血雨啊QAQ#include#include#include#include#include#define SF scanf#define PF printf#define bit(x) (1<<(x))#define update dp[cur].push(encode()原创 2015-04-11 17:18:55 · 521 阅读 · 0 评论 -
[UVA10572]Black & White && 插头DP
多维护一个数来表示轮廓线上颜色的状态 用这个数的第m+1位来维护左上角的颜色信息最后统计答案的时候要注意 这里要求的是一条路径而不是贿赂 所以允许最后一排存在至多一对独立插头(不同颜色不会同时存在独立插头 否则肯定不连通) 其他的玩意已经打在了代码的注释里面了#include#include#include#include#include#define SF scanf#d原创 2015-04-14 23:54:05 · 1002 阅读 · 0 评论 -
[ural1519]Formula 1 && 插头DP(括号表示法)
只是换了一种方法来表示方法 但是括号表示好像跑得快些 #include#include#include#include#include#define SF scanf#define PF printf#define bit(x) (1<<(x))#define getbit(x, y) (((x) >> mov[y]) & 3)#define BIT(x, y) ((x) <原创 2015-04-15 12:55:48 · 955 阅读 · 0 评论