2016年7月5日

摘要: 一条边<u,v>表示u选那么v一定被选。 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <algorithm> 5 using namespace std; 6 const int Maxm=210 阅读全文

posted @ 2016-07-05 23:03 yyjxx2010xyu 阅读(143) 评论(0) 推荐(0) 编辑

2016年7月4日

摘要: 最近感到KMP不会啊,以前都是背板的现在要理解了。 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <algorithm> 5 using namespace std; 6 const int Max 阅读全文

posted @ 2016-07-04 20:06 yyjxx2010xyu 阅读(211) 评论(0) 推荐(0) 编辑

2016年6月16日

摘要: 好久没写splay了,写一发(写了一节课,调了一节课) 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <algorithm> 5 #include <vector> 6 #include <map> 阅读全文

posted @ 2016-06-16 09:12 yyjxx2010xyu 阅读(116) 评论(0) 推荐(0) 编辑

2016年6月14日

摘要: HDU 3068 Manacher裸题 1 #include <cstdio> 2 #include <cstring> 3 const int Maxn=110100; 4 char Str[Maxn<<1],STR[Maxn<<1]; 5 int Len,x,P[Maxn<<1],Id,Mx; 阅读全文

posted @ 2016-06-14 11:20 yyjxx2010xyu 阅读(126) 评论(0) 推荐(0) 编辑

2016年6月9日

摘要: #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <vector> #include <map> #include <set> #include <stack> #define 阅读全文

posted @ 2016-06-09 23:11 yyjxx2010xyu 阅读(126) 评论(0) 推荐(0) 编辑

2016年6月7日

摘要: 统计块个数写错了调了好久啊,BZOJ1696的弱化版本。 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 #include <cstdio> 5 #include <map> 6 #define fi first 阅读全文

posted @ 2016-06-07 21:25 yyjxx2010xyu 阅读(175) 评论(0) 推荐(0) 编辑

摘要: 右键open with another application 里输javaws 按ctrl+shift+del,调出火狐内置的清除最近的历史记录工具(或者按alt键弹出菜单,工具-》清空最近历史记录),然后选择清除全部的缓存和cookie 阅读全文

posted @ 2016-06-07 00:22 yyjxx2010xyu 阅读(133) 评论(0) 推荐(0) 编辑

2016年6月6日

摘要: 就是每两项相减,肯定能被模数整除。 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <algorithm> 5 using namespace std; 6 7 const int Maxn=1010 阅读全文

posted @ 2016-06-06 22:07 yyjxx2010xyu 阅读(344) 评论(0) 推荐(0) 编辑

2016年6月3日

摘要: 发现自己Tarjan的板子有错误.发现可以用Map直接删去边,Get. 听说std是双连通、LCA、并查集、离线思想、用BIT维护dfs序和并查集维护LCA的动态缩点的好题 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 阅读全文

posted @ 2016-06-03 16:37 yyjxx2010xyu 阅读(212) 评论(0) 推荐(0) 编辑

摘要: 调了恒久突然发现输出优化忘记带负号了.. 就是差分树状数组维护Dfs序即可。 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <algorithm> 5 #define LL long long 6 阅读全文

posted @ 2016-06-03 14:52 yyjxx2010xyu 阅读(106) 评论(0) 推荐(0) 编辑

2016年6月2日

摘要: 证明1+1/(4-1)+1/(4^2-1)+1/(4^3-1).....+1/(4^n-1)<3/2.. 证明:1/3+1/15+...+1/(4ⁿ-1)≤1/3+1/3²+...+1/3ⁿ<1/2. 某道自己智障,做了半节晚自修都还没做出来的题..我还是没有想明白为什么可以这么放啊。 极限为1.4 阅读全文

posted @ 2016-06-02 22:19 yyjxx2010xyu 阅读(155) 评论(0) 推荐(0) 编辑

2016年5月27日

摘要: 1 2 #include <cstdio> 3 #include <iostream> 4 #include <cstring> 5 #include <algorithm> 6 #include <queue> 7 #include <vector> 8 #include <cmath> 9 #d 阅读全文

posted @ 2016-05-27 15:09 yyjxx2010xyu 阅读(101) 评论(0) 推荐(0) 编辑

摘要: 很久以前就想做,后来弃坑了。 最近又在群里有人问了类似的问题,艾老师说是斯坦纳树(%%%) 就是状压DP,然后用Spfa对状态进行转移. 1 2 #include <iostream> 3 #include <cstring> 4 #include <cstdio> 5 #include <algo 阅读全文

posted @ 2016-05-27 11:00 yyjxx2010xyu 阅读(140) 评论(0) 推荐(0) 编辑

摘要: 用线段树维护建图,即把用线段树把每个区间都标号了,Tree1中子节点有到达父节点的单向边,Tree2中父节点有到达子节点的单向边. 每次将源插入Tree1,汇插入Tree2,中间用临时节点相连。那么Tree1中的所用子节点都可以到达,Tree2中的所用子节点。 感觉很有道理啊,以前从来没用用线段树这 阅读全文

posted @ 2016-05-27 10:55 yyjxx2010xyu 阅读(537) 评论(0) 推荐(0) 编辑

摘要: 突然发现我不会分层图最短路,写一发。 就是同层中用双向边相连,用单向边连下一层 1 #include <cstdio> 2 #include <algorithm> 3 #include <iostream> 4 #include <string> 5 #include <cstring> 6 #i 阅读全文

posted @ 2016-05-27 07:41 yyjxx2010xyu 阅读(195) 评论(0) 推荐(0) 编辑

2016年5月24日

摘要: HDU 2222 模板题 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <algorithm> 5 #include <queue> 6 using namespace std; 7 const i 阅读全文

posted @ 2016-05-24 20:55 yyjxx2010xyu 阅读(90) 评论(0) 推荐(0) 编辑

2016年5月22日

摘要: 第一次学习虚树,就是把无关的点去掉。S里维护一条链即可。 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <algorithm> 5 #define LL long long 6 using name 阅读全文

posted @ 2016-05-22 20:41 yyjxx2010xyu 阅读(132) 评论(0) 推荐(0) 编辑

2016年5月21日

摘要: 我在群上看到的某道题,貌似用的是线段树,因为前几天遇到差分,再用BIT动态维护一下前缀和,感觉可做就A了. 加了个读优就Rank1啦! 某个不常见的题库,还是把题目拿下来把.. 1 Description 2 给你一些二进制串,我们有对这些数有两种操作。 3 'I i j' 将[i,j]内的所有数取 阅读全文

posted @ 2016-05-21 23:01 yyjxx2010xyu 阅读(166) 评论(0) 推荐(0) 编辑

2016年5月19日

摘要: 去年NOIP的时候我还不会树链剖分! 还是被UOJ 的数据卡了一组。 差分的思想还是很神啊! 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <algorithm> 5 #include <ctime 阅读全文

posted @ 2016-05-19 18:14 yyjxx2010xyu 阅读(157) 评论(0) 推荐(0) 编辑

摘要: 感觉树套树是个非常高深的数据结构。从来没写过 1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 #include <cstring> 5 #include <vector> 6 #define LL long lon 阅读全文

posted @ 2016-05-19 16:41 yyjxx2010xyu 阅读(120) 评论(0) 推荐(0) 编辑

2016年5月18日

摘要: BZOJ 1770 BZOJ 1013 POJ 1830 POJ 1222 Gauss求方程组的解! 阅读全文

posted @ 2016-05-18 23:18 yyjxx2010xyu 阅读(87) 评论(0) 推荐(0) 编辑

2016年5月13日

只有注册用户登录后才能阅读该文。 阅读全文

posted @ 2016-05-13 14:33 yyjxx2010xyu 阅读(32) 评论(0) 推荐(0) 编辑

2016年5月12日

摘要: 首先对网格染色,发现是而二分图。 那么即在二分图上选一个起点走过的点无法再走,最后无路可走就输了。 如果起点必在最大匹配中,先手必赢。 如果起点不一定在最大匹配中(包括不可能在),后手必赢。网上有解释。 因为写二分图不怎么熟练,所以还是用网络流吧。 找的就是可行的和不在最大匹配中点。建边要用单向边。 阅读全文

posted @ 2016-05-12 22:48 yyjxx2010xyu 阅读(167) 评论(0) 推荐(0) 编辑

2016年5月11日

摘要: BZOJ 1415 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 #include <cstdio> 5 using namespace std; 6 const int Maxn=1010; 7 int t[ 阅读全文

posted @ 2016-05-11 23:56 yyjxx2010xyu 阅读(134) 评论(0) 推荐(0) 编辑

2016年5月10日

摘要: BZOJ 1690 假设求出∑a/∑b>L L∑b-∑a<0 => ∑(Lb-a)<0即可说明有比L优的解 可以二分L,∑(Lb-a)<0可以通过Dfs_Spfa找负环 1 #include <cstdio> 2 #include <cstring> 3 using namespace std; 4 阅读全文

posted @ 2016-05-10 22:19 yyjxx2010xyu 阅读(151) 评论(0) 推荐(0) 编辑

摘要: POJ 2653 求最上面覆盖的线段 用一个set维护最上面的线段。删除,插入log(n)。删完set里的数后马上it++ 主要是查看线段是否交。首先两个线段的矩形要相交。 然后判断一条线段的两个端点是否跨过另外一条线段所在的直线(用叉积乘积<0判断) 同理另外一条也要检查。 1 #include 阅读全文

posted @ 2016-05-10 22:04 yyjxx2010xyu 阅读(116) 评论(0) 推荐(0) 编辑

2016年5月9日

摘要: A.暴力枚举,注意游戏最长为90分钟 B.暴力,c[l]++,c[r]--,记录中间有多长的段是大小为n的,注意特判m=0的情况 C.暴力枚举,我居然一开始没想出来!我一直以为每次都要统计最大的,就要O(N^3)。实际上只要判断最大的那个。 D.构造,在除了a,b,c,d之外的点构造一条链,只需要n 阅读全文

posted @ 2016-05-09 22:19 yyjxx2010xyu 阅读(99) 评论(0) 推荐(0) 编辑

摘要: 我原来准备做方差的。。 结果发现不会维护两个标记。。 就是操作变成一个 a*x+b ,每次维护a , b 即可 加的时候a=1 ,b=v 乘的时候a=v ,b=0 1 #include <cstdio> 2 const long long Maxn=100010; 3 4 long long a[M 阅读全文

posted @ 2016-05-09 15:32 yyjxx2010xyu 阅读(192) 评论(0) 推荐(0) 编辑