摘要: 通道题意:根据那个递推式,找找规律即可。代码:#include #include #include #include #include using namespace std;typedef long long ll;inline bool rd(int &ret) { char c; int... 阅读全文
posted @ 2015-08-04 23:12 mithrilhan 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 通道题意:从A,B分别取出子串X,Y,求多少种不同的X+Y思路:代码:#include #include #include using namespace std;const int MAX_N = 200007;typedef unsigned long long ll;struct SAM { ... 阅读全文
posted @ 2015-08-04 22:34 mithrilhan 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 通道题意:给出n个点,m条边,现在要给边定向使得点的出度和入度的差不超过1思路:对每个点进行出度和入度的判断,如果出度大,就先进行反向的搜索(每搜索一条边u,v就认为这是一条v到u的有向边),反之,进行正向搜索(每搜到一条边u,v认为这是一条u到v的有向边),一直搜索到找不到边能继续为止,每条边只遍... 阅读全文
posted @ 2015-08-04 21:24 mithrilhan 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 通道题意:3种操作,加点,加边,删边,然后对于每次加点操作为不超过k个点,求对于每次加点时加点数量的方案的字典序最小。思路:要保证字典序最小,就倒着来,能加的都加进去。建图方法就是拆点,源点向i建流量为k,tot+i到汇点建流量为1,i到tot+v建流量为1.代码:#include #include... 阅读全文
posted @ 2015-08-04 20:00 mithrilhan 阅读(190) 评论(0) 推荐(0) 编辑
摘要: void solve(){ int ans=0,i,j,front1,front2,rear1,rear2; front1=rear1=0; front2=rear2=0; for(i=1,j=1;jfront1&&d[qmax[rear1-1]]front2&&d[qmin... 阅读全文
posted @ 2015-08-04 11:56 mithrilhan 阅读(303) 评论(0) 推荐(0) 编辑