The next lecture in a high school requires two topics to be discussed. The ii -th topic is interesting by aiai units for the teacher and by bibi units ...
分类:
其他好文 时间:
2020-03-29 01:44:16
阅读次数:
280
https://codeforces.com/contest/1328/problem/E 题目所描述的是一棵树,题中已明示1为root结点。 题目可以转化为,是否存在一条路径,满足集合中的k个点到路径的距离小于等于1? 思路: 1.首先倍增离线预处理出结点深度,便于后续在线询问LCA 2.对于每次 ...
分类:
其他好文 时间:
2020-03-29 01:40:42
阅读次数:
93
"CF1324A Yet Another Tetris Problem" 长度为n的数组a中有一组数,可以任意使其中一项+2,问能否使a中所有项的值相同。 感觉div.3的题目更多地在考简化问题的能力……比如原题目以俄罗斯方块作背景,让我想到的是能不能消除所有方块,导致代码很难写。但如果像上述一样简 ...
分类:
其他好文 时间:
2020-03-29 01:16:57
阅读次数:
71
https://codeforces.com/contest/1328/problem/F 首先把a数组处理成pair对(num,cnt),表示数字num有cnt个,然后按num升序排序离散化一下。 对于一个数x,若想使得小于x的数字都变成x,必须先把所有小于x的数变成x-1,然后再+1变成x。 同 ...
分类:
编程语言 时间:
2020-03-29 01:15:50
阅读次数:
94
There is a frog staying to the left of the string s=s1s2…sns=s1s2…sn consisting of nn characters (to be more precise, the frog initially stays at the ...
分类:
其他好文 时间:
2020-03-29 01:06:51
阅读次数:
86
codeforces-1328E-Tree Queries 传送门:https://codeforces.com/problemset/problem/1328/E 题意:n个结点的树 m次询问 让你找一条从根结点1开始的路径 使一些点在路径上或离路径上的点距离为1 问能不能找到 因为是要求这些点在 ...
分类:
其他好文 时间:
2020-03-28 23:14:10
阅读次数:
101
https://codeforces.com/contest/1328/problem/E E. Tree Queries You are given a rooted tree consisting of nn vertices numbered from 11 to nn. The root o ...
分类:
其他好文 时间:
2020-03-28 22:01:47
阅读次数:
177
网址:https://codeforces.com/gym/100851 题意: 考虑如下线性同余发生器:$x=(a*x+b)mod$ $c$,给出$1e4$个线性同余发生器,在这些线性同余发生器生成的数的序列中每一个序列都任意挑一个数,使得它们的和最大并且不被$k$整除,输出和的值和各个位置,如果 ...
分类:
其他好文 时间:
2020-03-28 21:55:30
阅读次数:
66
LCA 模板 例题 [CF1304E]1 Trees and Queries https://codeforces.com/contest/1304/problem/E 题意 给一棵树,每次查询时在x和y之间加一条边,然后问在a和b之间是否存在一条可以重复走的路径且这条路径的长度为k 思路 如果不走 ...
分类:
其他好文 时间:
2020-03-28 21:34:56
阅读次数:
70
description you are given an array and you are asked to make $k$ elements of it equal after some operations. you can make one of the following operati ...
分类:
其他好文 时间:
2020-03-28 20:20:02
阅读次数:
99