04 2019 档案
摘要:时间限制:10000ms 单点时限:2000ms 内存限制:512MB 时间限制:10000ms 单点时限:2000ms 内存限制:512MB 描述 小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一个音乐旋律被表示为一段数构成的数列。 现在小Hi想知道一部作品中出现了多少不同的旋律? 解题方法提示
阅读全文
摘要:时间限制:15000ms 单点时限:3000ms 内存限制:512MB 时间限制:15000ms 单点时限:3000ms 内存限制:512MB 描述 小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一个音乐旋律被表示为一段数构成的数列。 现在小Hi想知道一部作品中所有长度为K的旋律中出现次数最多的旋律
阅读全文
摘要:2072. Kirill the Gardener 3Time limit: 2.0 secondMemory limit: 64 MBKirill the gardener has got a new task. He has to water the flowers growing on the
阅读全文
摘要:E. Getting Deals Done time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output E. Getting Deals D
阅读全文
摘要:Buber is a Berland technology company that specializes in waste of investor's money. Recently Buber decided to transfer its infrastructure to a cloud.
阅读全文
摘要:Given a tree with n vertices, we want to add an edge between vertex 1 and vertex x, so that the sum of d(1, v) for all vertices v in the tree is minim
阅读全文
摘要:题意:给定一棵以1为根的n个节点的树,多个询问,每次询问给出一个集合,集合内的点表示为不重要的点(不在集合内的点就是重要的点),求给定这个集合后有多少点能进入另一个集合,点x进入另一个集合的要求:1:重要的点。2:有两个重要的点的最近公共祖先为x。 分析:其实对于每一个询问我们只要判断哪些不重要的点
阅读全文
摘要:E. Packmentime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA game field is a strip of 1 × n square
阅读全文
摘要:A. Automatic Door time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There is an automatic d
阅读全文
摘要:题目描述 我们知道,从区间[L,H](L和H为整数)中选取N个整数,总共有(H-L+1)^N种方案。小z很好奇这样选出的数的最大公约数的规律,他决定对每种方案选出的N个整数都求一次最大公约数,以便进一步研究。然而他很快发现工作量太大了,于是向你寻求帮助。你的任务很简单,小z会告诉你一个整数K,你需要
阅读全文
摘要:题目描述 给定一个正整数N(N≤31−1) 求 ans1=i=1∑nφ(i) ans2=∑i=1nμ(i)ans_2=\sum_{i=1}^n \mu(i)ans2=i=1∑nμ(i) 输入输出格式 输入格式: 一共T+1行 第1行为数据组数T(T<=10) 第2~T+1行每行一个非负整数N
阅读全文
摘要:Warm sunshine, cool wind and a fine day, while the girl watching is pursuing in chaos. Rikka reached out her hand and got the garland on her head, fin
阅读全文
摘要:题目描述 给定一个nxm的网格,请计算三点都在格点上的三角形共有多少个。下图为4x4的网格上的一个三角形。注意三角形的三点不能共线。 输入输出格式 输入格式: 输入一行,包含两个空格分隔的正整数m和n。 输出格式: 输出一个正整数,为所求三角形数量。 输入输出样例 输入样例#1: 复制 2 2 输出
阅读全文
摘要:题目大意: 如果A>B,并且B>C,那么有A>C,现在A>B的条件是,A的两个元素中的至少一个大于B。 问一个人可以打败多少人。 思路: ①问题其实就是在找一个联通块,我们将元素按照x从小到大排序一下,然后相邻的两个点建一条边。 ②然后在将元素按照y从小到大排序一下,然后相邻的两个点再建一条边。 然
阅读全文
摘要:One hundred years from now, in21172117, the International Collegiate Programming Contest (of which the NCPC is a part) has expanded significantly and
阅读全文
摘要:题目描述 有一个n行m列的黑白棋盘,你每次可以交换两个相邻格子(相邻是指有公共边或公共顶点)中的棋子,最终达到目标状态。要求第i行第j列的格子只能参与mi,j次交换。 输入输出格式 输入格式: 第一行包含两个整数n,m(1<=n, m<=20)。以下n行为初始状态,每行为一个包含m个字符的01串,其
阅读全文