摘要: 思路:每次合并时,都是给一个虚拟的根。#include#include#include#include#include#include#include#include#include#include#include#define Maxn 100010#define Maxm 2000010#define LL __int64#define Abs(x) ((x)>0?(x):(-x))#define lson(x) (x<<1)#define rson(x) (x<<1|1)#define inf 0x3f3f3f3f#define Mod 1000000007 阅读全文
posted @ 2013-08-29 19:58 fangguo 阅读(188) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#include#include#include#include#include#include#define Maxn 52#define Maxm 100010#define LL __int64#define Abs(x) ((x)>0?(x):(-x))#define lson(x) (xb?b:a;}int solve(){ int i,j,r,ki,kj,fi,fj,N; N=(1<<k)-1; dp[0][1][0]=0; for(ki=0;ki<=N;ki++){ ... 阅读全文
posted @ 2013-08-29 17:05 fangguo 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 思路:其实就是让每一条路有尽量多的人走。#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#define Maxn 100010#define Maxm 100010#define LL __int64#define Abs(x) ((x)>0?(x):(-x))#define lson(x) (x<<1)#define r 阅读全文
posted @ 2013-08-29 14:27 fangguo 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 思路:将每个回合的平手和赢最为一对对立状态。那么后面就是2-SAT判断了。#include#include#include#include#include#include#define Maxn 20010using namespace std;map g[Maxn];int vi[Maxn],head[Maxn],dfn[Maxn],low[Maxn],e,n,lab,top,num,id[Maxn],Stack[Maxn],wh[Maxn],hh[4][4];struct Edge{ int u,v,next;}edge[100000];void init()//初始化{ me... 阅读全文
posted @ 2013-08-29 14:25 fangguo 阅读(183) 评论(0) 推荐(0) 编辑