PKU Campus 2015】的更多相关文章

PKU Campus 2015 B 注意到竖着落下不改变列模 4 的结果.问题转化为:模 4 系下,给序列,可选长度为 4 子区间,区间加一,能否让所有元素相等. C.Rabbit's Festival 时间分治,并查集维护连通性 H.Lucky Draw 比赛期间被卡死了........... 一直以为带log肯定能过,然后换了n种姿势都T啦......... 标解单调队列,难点在于如何维护次小值(下面的讨论基定于把原序列翻转) 确定最小值后,次大值分为在该最小值前面或后面,如果在最小值后面,…
HYNB Round 15: PKU Campus 2019 C. Parade 题意 将平面上n*2个点安排在长度为n的两行上. 做法 首先可以忽略每个点之间的影响,只用考虑匹配即可 然后把所以点归约到两行上,再从左到右依次考虑即可(考虑每条分界线被经过多少次) 比赛时被贪心治了... G. Go and Oreo 题意 把n*n个格子黑白染色后,数奥利奥 做法 按格考虑,简易版轮廓线DP 赛中一直在按行考虑,然后就不会了…
题目链接:点击打开链接 题意:给定n个点 m个询问 以下n-1行给定一棵树 m个询问 x y 问把树转成以x为根 y的父节点是谁 第一种情况lca==y那就是x的第 dep[x] - dep[y] -1 父亲,依次向上爬山坡,利用倍增的二进制加速. 另外一种就是Father[y]; #include"cstdio" #include"iostream" #include"queue" #include"algorithm" #…
题目:http://poj.openjudge.cn/campus2018/A 有正规的差分约束做法,用到矩阵转置等等. 但也有简单(?)的dp做法. 有一个结论(?):一定要么在一天一点也不选,要么在一天选了7个小时. 于是dp[ i ]表示第 i 天选了7个小时.之前合法 的方案数.可以从i-1到i-7转移.答案是n到n-6. #include<iostream> #include<cstdio> #include<cstring> #define ll long…
Blocks Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3997   Accepted: 1775 Description Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of paint…
Training little cats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9613   Accepted: 2296 Description Facer's pet cat just gave birth to a brood of little cats. Having considered the health of those lovely cats, Facer decides to make th…
UmBasketella http://poj.org/problem?id=3737 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9489   Accepted: 3674 Description In recent days, people always design new things with multifunction. For instance, you can not only use cell pho…
Description There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei is one of the members of the cat club. He loves those cats very much. Last week, he won a scholarshi…
时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei is one of the members of the cat club. He loves those cats very much. Last…
Blocks Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6578   Accepted: 3171 Description Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of paint…