摘要: 2019杭电多校第二场 太菜了,被学弟暴打 1002. Beauty of Unimodal Sequence upsolved 要求输出字典序最小和最大的最长单峰子序列 对于每一个位置,维护以这个位置结尾的前缀/后缀最长上升/单峰子序列长度,然后贪心输出(如果只要求长度正反求LIS就好了) cpp 阅读全文
posted @ 2019-07-25 21:53 图斯卡蓝瑟 阅读(394) 评论(0) 推荐(0)
摘要: 2019杭电多校第一场 有点自闭,本来应该昨天写的,拖到了今天 1001. Blank upsolved 题意是在$n$个位置上填数,只能填$0,1,2,3$这四种,然后有$m$个限制条件,限制的是区间不同数的个数,求填数方案数$1 using namespace std; const int N 阅读全文
posted @ 2019-07-23 20:40 图斯卡蓝瑟 阅读(651) 评论(0) 推荐(0)
摘要: 2019牛客多校第二场 A. Eddy Walker upsloved 有一个长为$n$的环,一开始位于$0$,每次随机向前或者向后走,求最后一个走到$m$的概率 ps:这题实际上求的是所有询问的前缀积 实际上概率相等(俺也不知道为啥)如果$m!=0$,则概率是$\frac 1 {n 1}$,特判$ 阅读全文
posted @ 2019-07-20 22:54 图斯卡蓝瑟 阅读(618) 评论(2) 推荐(0)
摘要: 2019牛客多校第一场 D还没补,G看起来做不了 A Equivalent Prefixes solved at 00:21 题意是有两个长为n的数组a,b,每个数组都是1到n的一个排列 询问一个最长的前缀p,使得对于任意的$1 pa[i+1]$,则$min\_element(a, l, r)=r= 阅读全文
posted @ 2019-07-18 22:12 图斯卡蓝瑟 阅读(598) 评论(4) 推荐(1)
摘要: 牛客小白月赛16H 小阳的贝壳 "题目链接" 题意 维护一个数组,支持以下操作: 1: 区间加值 2: 询问区间相邻数差的绝对值的最大值 3: 询问区间gcd 题解 设原数组为$a$, 用线段树维护$b[i] = a[i] a[i 1]$, 线段树维护三个值:min, max, gcd 对于操作1: 阅读全文
posted @ 2019-07-13 20:17 图斯卡蓝瑟 阅读(619) 评论(0) 推荐(0)
摘要: Codeforces1110F dfs + 线段树 + 询问离线 F. Nearest Leaf Description: Let's define the Eulerian traversal of a tree (a connected undirected graph without cycl 阅读全文
posted @ 2019-03-07 22:24 图斯卡蓝瑟 阅读(312) 评论(0) 推荐(0)
摘要: Codeforces1111D 退背包+组合数 D. Destroy the Colony Description: There is a colony of villains with several holes aligned in a row, where each hole contains 阅读全文
posted @ 2019-02-26 22:04 图斯卡蓝瑟 阅读(344) 评论(0) 推荐(0)
摘要: Codeforces 1108F MST + LCA F. MST Unification Description: You are given an undirected weighted connected graph with $n$ vertices and $m$ edges withou 阅读全文
posted @ 2019-02-02 23:09 图斯卡蓝瑟 阅读(340) 评论(0) 推荐(0)
摘要: Codeforces 1108E2 E2. Array and Segments (Hard version) Description: The only difference between easy and hard versions is a number of elements in the 阅读全文
posted @ 2019-02-02 22:40 图斯卡蓝瑟 阅读(431) 评论(0) 推荐(0)
摘要: Codeforces 1107G 线段树最大子段和 + 单调栈 G. Vasya and Maximum Profit Description: Vasya got really tired of these credits (from problem F) and now wants to ear 阅读全文
posted @ 2019-02-02 11:01 图斯卡蓝瑟 阅读(705) 评论(0) 推荐(1)