上一页 1 2 3 4 5 6 ··· 14 下一页
摘要: T1 大水题+模拟 直接二分$O(nlogn)$ 然而有趣的是我在确认输入不会炸long long后 认为中间的乘法也不会炸 然后就从考完试到下午4点,一直在调,重打了两遍... 就差3个1LL... #include <cstdio> #include <cstring> #include <cs 阅读全文
posted @ 2017-10-28 21:20 A_LEAF 阅读(228) 评论(0) 推荐(0) 编辑
摘要: $ f_{x,j} $ 表示以x为根的子树 x这个点在子树里的排名为j的方案总数 考虑x和儿子的合并 转移时要开一个临时的数组 $ t[] $ 来临时存一下数据 当儿子在x后面时 $$ t_{j+k}=\sum_{j=1}^{size[x]}\sum_{k=0}^{size[son]}C_{j+k- 阅读全文
posted @ 2017-10-28 21:04 A_LEAF 阅读(568) 评论(0) 推荐(0) 编辑
摘要: 要分最大值和次大值正负的四种情况... #include <cstdio> #include <cstring> #include <cstdlib> #include <iostream> #include <algorithm> #include <set> #include <map> #de 阅读全文
posted @ 2017-10-27 06:29 A_LEAF 阅读(115) 评论(0) 推荐(0) 编辑
摘要: $f_{i} 到第i位最少的花费 $ $n^2dp$ 很容易想 考虑优化 首先把权值从大到小排序,把pos压进set里 处理出每一个位置 i 前面第一个大于等于v[i]的位置 $$ f_{i}=min( f_{k}+max(v[l])(l+1<=k<=i) ) $$ 用线段树优化 但是你并不知道v[ 阅读全文
posted @ 2017-10-26 16:58 A_LEAF 阅读(258) 评论(0) 推荐(1) 编辑
摘要: 今天是达哥出的题(翻车了QAQ) T1 地精部落 #include <cstdio> #include <cstring> #include <cstdlib> #include <iostream> #include <algorithm> #define ll long long #define 阅读全文
posted @ 2017-10-26 14:57 A_LEAF 阅读(197) 评论(2) 推荐(1) 编辑
摘要: T1 太鼓达人...我会说我考试的时候想了半天打表吗?当然不会 开大栈记得要点上执行命令... #include <cstdio> #include <cstring> #include <iostream> #include <cstdlib> #include <algorithm> #defi 阅读全文
posted @ 2017-10-25 19:33 A_LEAF 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 这个题以前一直没弄明白... 相当于有$2^n-1$个点,$2^n$条边 然后求欧拉回路 可以dfs也可以迭代 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #define mem(a,b) mem 阅读全文
posted @ 2017-10-25 11:45 A_LEAF 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 我定义的状态数组存的是概率,而且是正推 达哥存的是期望,还逆推,然后我就懵比了 $f_{i,j,k}$ 第i关 j条命 连胜k次 $$f_{i+1,min(j+1,Q),min(k+1,R)}+=f_{i,j,k}*p$$ $$f_{i+1,j-1,0}+=f{i,j,k}*(1.0-p)$$ $$ 阅读全文
posted @ 2017-10-24 21:19 A_LEAF 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 枚举次小值,找出左右两边第一个、第二个比它大的地方 找的话有两种方法 (1) $O(logn)$ 将权值从大到小排序,一个一个加入,用set来维护 (2) $O(log^2n)$ 二分位置 用线段树/RMQ来$O(logn)$求出区间最大值 求取区间异或的最大值 可以在可持久化0/1trie上贪心行 阅读全文
posted @ 2017-10-24 18:48 A_LEAF 阅读(107) 评论(0) 推荐(0) 编辑
摘要: T1 找规律或者dp都行 #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <iostream> #include <cmath> #define mem(a,b) memset 阅读全文
posted @ 2017-10-24 14:58 A_LEAF 阅读(166) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 14 下一页