Problem Description N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code bette ...
分类:
其他好文 时间:
2019-08-24 22:57:58
阅读次数:
80
题目描述 The good folks in Texas are having a heatwave this summer. Their Texas Longhorn cows make for good eating but are not so adept at creating creamy ...
分类:
其他好文 时间:
2019-08-23 22:03:07
阅读次数:
94
A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to run o ...
分类:
其他好文 时间:
2019-08-22 16:07:12
阅读次数:
97
CF1204B Mislove Has Lost an Array 题意: 给你n,l,r 表示在区间1 n内至少有l个不相同的数至多有r个不相同的数,而且这些数不是1就是偶数而且每个偶数/2得到的数在之前出现过。 解法: 根据题意找规律。 满足条件下,合乎题意的值确定后,将剩余的未赋值的看作1就是 ...
分类:
其他好文 时间:
2019-08-21 21:37:45
阅读次数:
75
___ 思路 最小就是达到下限之后其他全是1 , 最大就是达到上限后全是最大的那个 ___ 代码 cpp include using namespace std ; int n , l , r ; int minn = 1, maxx = 1; int main () { cin n l r ; f ...
分类:
其他好文 时间:
2019-08-21 11:35:27
阅读次数:
61
Problem D Lost in Translation The word is out that you’ve just finished writing a book entitled How to Ensure Victory at a Programming Contest and req ...
分类:
其他好文 时间:
2019-08-20 20:38:23
阅读次数:
85
题意: 给你n个子串和一个母串,让你重排母串最多能得到多少个子串出现在重排后的母串中。 首先第一步肯定是获取母串中每个字母出现的次数,只有A T C G四种。 这个很容易想到一个dp状态dp【i】【A】【B】【C】【D】 表示在AC自动机 i 这个节点上,用了A个A,B个T,C个C,D个G。 然后我 ...
分类:
其他好文 时间:
2019-08-19 20:53:47
阅读次数:
80
题目就是求树上每个节点的所有祖先中(ci-cj)/(dj-di)的最小值。 那么就是(ci-cj)/(di-dj)的最大值了。 对于每一个点,它的(ci,di)都是二维坐标系里的一个点 要求的就是祖先节点的所有点与目前节点连线的最小斜率 比较容易想到单调栈优化,像斜率优化dp一样 但是关键是本题在树 ...
分类:
其他好文 时间:
2019-08-18 09:30:30
阅读次数:
69
之前学斜率优化的锅,凸包没学会,当时是不等式搞过去的,考试时妄想推出和u无关,只和祖先有关的不等式,失败。。。 先看式子(c[fa]-c[son])/(dep[son]-dep[fa]),看起来很别扭,尝试加负号,就变成了斜率(我们以dep为x轴,dep为y轴建坐标系),要求斜率最大,为下凸包, 这 ...
分类:
其他好文 时间:
2019-08-18 09:18:17
阅读次数:
96
浅谈二分 来自8,17考试模拟24。 本题: 单调凸包。(找凸包方向:联系高考数学线性规划) 弹栈操作是一个个向后弹的。序列转换为树上。对于树上结构,只需记录父子关系,即可还原出一整棵树。因为要可持久化,那么这里的栈也变为了树状。只需记录在栈里的父亲即可。甚至不用开一个数组作为栈。由于单调性,搭配倍 ...
分类:
其他好文 时间:
2019-08-17 22:23:36
阅读次数:
117