每周题解
训练题题解。
1100技
这个作者很懒,什么都没留下…
展开
-
#CodeForces - 1244E
You are given a sequence a1,a2,…,ana1,a2,…,an consisting of nn integers.You may perform the following operation on this sequence: choose any element and either increase or decrease it by one.Calcula...原创 2020-04-14 20:32:12 · 162 阅读 · 0 评论 -
#Consider equations having the following form:
Consider equations having the following form:ax12+b*x22+cx32+d*x42=0a, b, c, d are integers from the interval [-50,50] and any of them cannot be 0.It is consider a solution a system ( x1,x2,x3,x4 )...原创 2020-04-14 20:25:55 · 442 阅读 · 0 评论 -
#F - F
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 for the students.The pair of topics ii and jj (i&...原创 2020-04-09 21:00:00 · 201 阅读 · 0 评论 -
# Ice_cream's world I
ice_cream’s world is a rich country, it has many fertile lands. Today, the queen of ice_cream wants award land to diligent ACMers. So there are some watchtowers are set up, and wall between watchtower...原创 2020-04-06 20:11:39 · 105 阅读 · 0 评论 -
#最小新整数
给定一个十进制正整数n(0 < n < 1000000000),每个数位上数字均不为0。n的位数为m。现在从m位中删除k位(0<k < m),求生成的新整数最小为多少?例如: n = 9128456, k = 2, 则生成的新整数最小为12456Input第一行t, 表示有t组数据;接下来t行,每一行表示一组测试数据,每组测试数据包含两个数字n, k。Outpu...原创 2020-04-06 20:01:21 · 324 阅读 · 0 评论 -
#D - Harmonic Number (II)
I was trying to solve problem ‘1234 - Harmonic Number’, I wrote the following codelong long H( int n ) {long long res = 0;for( int i = 1; i <= n; i++ )res = res + n / i;return res;}Yes, my e...原创 2020-04-01 22:00:30 · 103 阅读 · 0 评论 -
#Three Integers
You are given three integers a≤b≤ca≤b≤c.In one move, you can add +1+1 or −1−1 to any of these integers (i.e. increase or decrease any number by one). You can perform such operation any (possibly, zer...原创 2020-03-31 21:50:05 · 263 阅读 · 0 评论 -
#确定比赛名次
有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。Input输入有若干组,每组中的第一行为二个数N(1<=N<=500),M;其中N表示队伍...原创 2020-03-30 21:13:03 · 257 阅读 · 0 评论 -
#快速找到最小步数
You are given two positive integers aa and bb. In one move you can increase aa by 11 (replace aa with a+1a+1). Your task is to find the minimum number of moves you need to do in order to make aa divis...原创 2020-03-28 18:32:20 · 219 阅读 · 0 评论 -
#取石子(2)
有2堆石子。A B两个人轮流拿,A先拿。每次可以从一堆中取任意个或从2堆中取相同数量的石子,但不可不取。拿到最后1颗石子的人获胜。假设A B都非常聪明,拿石子的过程中不会出现失误。给出2堆石子的数量,问最后谁能赢得比赛。例如:2堆石子分别为3颗和5颗。那么不论A怎样拿,B都有对应的方法拿到最后1颗。Input第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= ...原创 2020-03-28 11:40:37 · 264 阅读 · 0 评论 -
#取石子(1)
有一堆石子共有N个。A B两个人轮流拿,A先拿。每次最少拿1颗,最多拿K颗,拿到最后1颗石子的人获胜。假设A B都非常聪明,拿石子的过程中不会出现失误。给出N和K,问最后谁能赢得比赛。例如N = 3,K = 2。无论A如何拿,B都可以拿到最后1颗石子。Input第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= 10000) 第2 - T + 1行:每行2个数...原创 2020-03-28 11:03:56 · 456 阅读 · 0 评论 -
#使用快速幂进行计算
n 个小伙伴(编号从 00 到 n-1n−1)围坐一圈玩游戏。按照顺时针方向给 nn 个位置编号,从 00 到 n-1n−1。最初,第 00 号小伙伴在第 00 号位置,第 11 号小伙伴在第 11 号位置,……,依此类推。游戏规则如下:每一轮第 00 号位置上的小伙伴顺时针走到第 mm 号位置,第 11 号位置小伙伴走到第 m+1m+1 号位置,……,依此类推,第 n-mn−m 号位置上的小伙...原创 2020-03-27 21:39:12 · 157 阅读 · 0 评论 -
#贪心排木板
Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer length Li (1 ≤ Li ...原创 2020-03-26 21:43:20 · 119 阅读 · 0 评论 -
#训练题,贪心排字母
FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges.The contest organ...原创 2020-03-26 08:47:13 · 424 阅读 · 0 评论