A. Silent Classroom time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output There are n students in the first grade of Nlogonia high school. The principal wishes to split the students into two classroo…
链接:https://codeforces.com/contest/1166/problem/A 题意: There are nn students in the first grade of Nlogonia high school. The principal wishes to split the students into two classrooms (each student must be in exactly one of the classrooms). Two distinc…
链接:https://codeforces.com/contest/1166/problem/C 题意: The legend of the foundation of Vectorland talks of two integers xx and yy. Centuries ago, the array king placed two markers at points |x||x| and |y||y| on the number line and conquered all the lan…
链接:https://codeforces.com/contest/1166/problem/B 题意: Tom loves vowels, and he likes long words with many vowels. His favorite words are vowelly words. We say a word of length kk is vowelly if there are positive integers nn and mm such that n⋅m=kn⋅m=k…
这是一场失败的比赛. 前三题应该是随便搞的. D有点想法,一直死磕D,一直WA.(赛后发现少减了个1……) 看E那么多人过了,猜了个结论交了真过了. 感觉这次升的不光彩……还是等GR3掉了洗掉这次把,,, A 水题,对于每个首字母分成一半一半即可. #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> PII; ; #define MP make_pair #…
传送门 题意: 有 n 个商店,第 i 个商店出售正整数 ai: Dora 买了 m 天的东西,第 i 天去了 si 个不同的个商店购买了 si 个数: Dora 的对手 Swiper 在第 i 天去了 Dora 未去的商店购买了 n-si 个数: 问在这m天里,是否存在序列a,使得这 m 天都满足 LCM(Dora购买的数) > LCM(Swiper购买的数): 题解: 参考自(戳) ①如果存在两天,在这两天中得到的数字集合不存在交集,那么肯定是无解的. ②如果任意两天之间都存在交集时,一定有…
C. A Tale of Two Lands 题意: 给出 n 个数,问有多少点对(x,y)满足 |x-y| ≤ |x|,|y| ≤ |x+y|: (x,y) 和 (y,x) 表示一种答案: 题解: 数形结合: 对于某数 x 查找满足条件 y 有多少个: ①x ≥ 0 y ∈ [x/2 , 2x] ∪ [ -2x , -x/2]; ②x < 0 y ∈ [2x , -x/2] ∪ [-x/2 , -2x]; 特别注意临界值 x/2 处: AC代码: #include<bits/stdc++.h…
A Tale of Two Lands 题目链接(点击) The legend of the foundation of Vectorland talks of two integers xx and yy. Centuries ago, the array king placed two markers at points |x||x| and |y||y| on the number line and conquered all the land in between (including…
D. Fish Weight 题目连接: http://www.codeforces.com/contest/298/problem/D Description It is known that there are k fish species in the polar ocean, numbered from 1 to k. They are sorted by non-decreasing order of their weight, which is a positive number.…
A. Snow Footprints 题目连接: http://www.codeforces.com/contest/298/problem/A Description There is a straight snowy road, divided into n blocks. The blocks are numbered from 1 to n from left to right. If one moves from the i-th block to the (i + 1)-th blo…