HYNB Round 15: PKU Campus 2019】的更多相关文章

HYNB Round 15: PKU Campus 2019 C. Parade 题意 将平面上n*2个点安排在长度为n的两行上. 做法 首先可以忽略每个点之间的影响,只用考虑匹配即可 然后把所以点归约到两行上,再从左到右依次考虑即可(考虑每条分界线被经过多少次) 比赛时被贪心治了... G. Go and Oreo 题意 把n*n个格子黑白染色后,数奥利奥 做法 按格考虑,简易版轮廓线DP 赛中一直在按行考虑,然后就不会了…
UOJ Round #15 大部分题目没有AC,我只是水一下部分分的题解... 225[UR #15]奥林匹克五子棋 题意:在n*m的棋盘上构造k子棋的平局 题解: 玩一下发现k=1, k=2无解,然后间隔着,上下两行相同: 010101 010101 101010 101010 这样构造下来就行了. 然后要特判n=1 或 m=1,这时候k=2可以有解 #include <iostream> #include <cstdio> #include <cstring> #i…
http://acm.hdu.edu.cn/showproblem.php?pid=5082 Love Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 64    Accepted Submission(s): 51 Problem Description There is a Love country with many couples…
PKU Campus 2015 B 注意到竖着落下不改变列模 4 的结果.问题转化为:模 4 系下,给序列,可选长度为 4 子区间,区间加一,能否让所有元素相等. C.Rabbit's Festival 时间分治,并查集维护连通性 H.Lucky Draw 比赛期间被卡死了........... 一直以为带log肯定能过,然后换了n种姿势都T啦......... 标解单调队列,难点在于如何维护次小值(下面的讨论基定于把原序列翻转) 确定最小值后,次大值分为在该最小值前面或后面,如果在最小值后面,…
HYNB Round 8: 2016 ICPC Amritapuri Regionals A - Tim and BSTs 做法 经典的树 DP 问题. \(dp[u][i]\) 表示考虑以 u 为根子树,u 的 rank 为 i 方案数. 关于 \(dp[u][]\) 的计算,枚举左子树有几个比根小的,枚举右子树有几个数字比根小.合并两棵子树的复杂度为 \(O(sz_1 * sz_2)\),因此可以 \(O(n^2)\) 计算答案. B - A Historic Discussion 做法 每…
C. Cellular Network time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output You are given n points on the straight line — the positions (x-coordinates) of the cities and m points on the same line…
C. Cellular Network time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output You are given n points on the straight line — the positions (x-coordinates) of the cities and m points on the same line…
A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given array consisting of n integers. Your task is to find the maximum length of an increasing subarray of the gi…
C. Cellular Network time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output You are given n points on the straight line — the positions (x-coordinates) of the cities and m points on the same line…
A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given array consisting of n integers. Your task is to find the maximum length of an increasing subarray of the gi…