摘要: 直接记忆化搜(不记忆化不知道行不行)注意判断单独一个点。 #include <stdio.h> #include <algorithm> #include <cstring> #include <cmath> #include <queue> #include <vector> using name 阅读全文
posted @ 2017-10-27 00:30 新手-周 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 当我看到题时,满脑子都是骚操作,然后一个都不对(会),看了黄学长的博客后 直接搜索。。。 #include <stdio.h> #include <algorithm> #include <cstring> #include <cmath> #include <queue> #include <ve 阅读全文
posted @ 2017-10-26 17:25 新手-周 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 最大生成树,倍增求lca(貌似树上增暴力也可以) #include<cstdio> #include<algorithm> #define inf 2000000000 #define maxn 10010 using namespace std; template<class T>inline v 阅读全文
posted @ 2017-10-26 12:44 新手-周 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 可能有点水, 但这种题做的很少, 还是练习一下比较好 考虑二进制 任何数都可用2的幂次方加和得到. 那么把m个金币拆成几个2的幂次方的数就可以凑出任何 1~m 之间的数了. 但是不一定会正好, 把剩下的钱拆成单独一份, 答案就是第一个大于m的2^n的那个n. 那如果正好拆完呢? 因为最后一份不可以是 阅读全文
posted @ 2017-10-26 00:41 新手-周 阅读(133) 评论(0) 推荐(0) 编辑
摘要: ...... #include <stdio.h>#include <algorithm>#include <cstring>#include <cmath>#include <queue>#include <vector>using namespace std;int n;int main(){ 阅读全文
posted @ 2017-10-26 00:38 新手-周 阅读(94) 评论(0) 推荐(0) 编辑
摘要: http://cache.baiducontent.com/c?m=9d78d513d98214b8599d83080901a7610d13c03d338d96533dc3923b8e790b1f1a33f4bb507351528fd27c105df80f41beae7522604266e7c683 阅读全文
posted @ 2017-10-25 21:51 新手-周 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 蜜汁博弈,然而蒟蒻一枚,只会写二进制拆分的,于是T了。 在看完大佬的博客后好像有所领悟。。 情况1. 每堆石子数量都为1时,堆数为偶数时先手胜,此时Nim和为0 反之,堆数为奇数时先手必败 情况2. 至少有一堆石子数量大于1时, 1)若只有一堆石子数量大于1(此时Nim和!=0),先手可一定可以将局 阅读全文
posted @ 2017-10-25 21:43 新手-周 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 这是比较久以前的题了,复习匈牙利时翻了出来 板子 #include <stdio.h> #include <cstring> using namespace std; struct node { int v,next; }e[10000]; int head[10000],father[10000] 阅读全文
posted @ 2017-10-25 01:21 新手-周 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 这是一道对我而言很玄学的题 先求出最小生成树,然后暴力dfs统计等价值的边的个数,乘法原理. #include <stdio.h> #include <algorithm> #include <cstring> #include <cmath> #include <queue> #include < 阅读全文
posted @ 2017-10-25 00:42 新手-周 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 倒着做,正着做是要GG的,每次将删的点加进去,反着存。代码能力太差了,改了好久,最后请教大佬发现智障问题 #include <stdio.h> #include <algorithm> #include <cstring> #include <cmath> #include <queue> #inc 阅读全文
posted @ 2017-10-24 21:02 新手-周 阅读(170) 评论(0) 推荐(0) 编辑