
CF
文章平均质量分 93
免费的单身汉RainsdRop
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #575 (Div. 3)部分题解(A ~ D2)
前言关于菜狗博主经常托更曾经说要日更结果已经陷入月更的状态让人恨不得想拿把西瓜刀交流一下结果踩到狗屎运系统两次发人机粉导致已经百粉的狗血现实。A - Three Piles of Candies(水题)比赛链接:https://codeforces.com/contest/1196/problem/A题目大意现在这里有三堆糖果,第一堆糖果有aaa个,第二堆有bbb个,第三堆有ccc个。我们想把这三堆糖果平分给两个人,使得两个人最后得到的糖果数量都是xxx个。求出xxx的最大值。思路啊?原创 2021-11-06 20:25:02 · 256 阅读 · 3 评论 -
Codeforces Round #753 (Div. 3)部分题解(A ~ E题)
前言关于菜狗博主经常托更曾经说要日更结果已经陷入月更的状态让人恨不得想拿把西瓜刀交流一下结果踩到狗屎运系统两次发人机粉导致已经百粉的狗血现实。A - Linear Keyboard(map)比赛链接:https://codeforces.com/contest/1607/problem/A题目大意现在给你一个字符串a,字符串a包含262626个英文字母,代表了一个特殊的键盘。再给定一个字符串sss,请求出s[i]s[i]s[i]在这个特殊的键盘上与s[i−1]s[i-1]s[i−1]之间的距原创 2021-11-04 20:30:03 · 452 阅读 · 3 评论 -
Codeforces Round #752 (Div. 2)部分题解(A ~ D)
A. Era (模拟)比赛链接:https://codeforces.com/problemset/problem/1604/A题目大意给出长度为nnn的数组aaa,每次我们可以任意选择一个位置插入任意一个数字。问:至少要插入多少个数字才能使得数组aaa中所有的数都满足ai<=ia_i<=iai<=i ?思路忠告:不要吃烧烤味的薯片。吃完搞得我跟发烧一样,差点没给我送走了。上一次刚说完自己CF的A题能WA三发,结果还真成现实了,呜呜呜没想到什么妙招,干脆硬模拟。假设现在原创 2021-11-02 20:50:04 · 318 阅读 · 2 评论 -
Codeforces Round #751 (Div. 2)部分题解(A ~ C)
A - Two Subsequences (水题)比赛链接:https://codeforces.com/problemset/problem/1602/A题目大意现在给出字符串sss,你的任务是把它拆分成两个字符串aaa,bbb。字符串aaa,bbb满足:字符串aaa与字符串bbb都是字符串sss的子序列;字符串sss的所有字符sis_isi必须出现在字符串aaa或字符串bbb之中;字符串aaa的字典序要尽可能地小,字符串bbb无所谓;请输出符合条件的字符串aaa,bbb。思路样原创 2021-10-31 17:18:08 · 335 阅读 · 2 评论 -
Codeforces Round #750 (Div. 2)部分题解(A~D,F1)
前言「实力」是做题时绝对的必备技能,但「逃课」也是各位必须要掌握的一项技能。不要误会,博主说的不是那个会让你班主任抓狂被抓到之后会被父母打的三天之内不能下坐的「逃课」。博主说的「逃课」,是指掌握多种编程语言在比赛/做题中灵活切换,以达到高效率高正确率出题的效果的「逃课」。博主擅长的语言是C/C++,但如果当博主遇到例如求一个数字的k进制表示的题目。虽然可以通过设计函数实现,十分简单,但是博主是个懒(F)人(W),不想写那么多代码。而恰好在Java语言的Integer类之中,有一个Integer..原创 2021-10-28 16:54:02 · 300 阅读 · 0 评论 -
Codeforces Round #748 (Div. 3)部分题解(A ~ D2)
目录前言A - Nearest Interesting Number(暴力+水题)题目大意思路AC代码B - Equalize Prices (思维)题目大意思路AC代码C - Computer Game (思维)题目大意思路AC代码D - Candy Box (easy version) (魔鬼题+贪心)题目大意思路AC代码E - Subsequences (easy version) (BFS)题目大意思路AC代码F - Topforces Strikes Back(数学+贪心)题意思路AC代码前原创 2021-10-26 20:00:53 · 168 阅读 · 0 评论 -
Educational Codeforces Round 115 (Rated for Div. 2)部分题解(A~D)
文章目录前言A. Computer Game(思维+水题)题目大意思路AC代码B. Groups(暴力+水题)题目大意思路AC代码C. Delete Two Elements(数学公式转换)题目大意思路AC代码D. Training Session(逆向思维+map活用+排列组合)题目大意思路AC代码前言我还记得,当年我也是一个平均学分绩点可以达到4的好学生。现在博主已经变成了平均学分绩点在3~3.5徘徊的fw了,但主不在乎。从现在开始,一并超!(每周至少1篇并且超量完成)吐槽一下,夜王在原创 2021-10-23 17:04:17 · 1150 阅读 · 0 评论 -
Codeforces Round #574 (Div. 2)部分题解(A~C)
文章目录前言A - Drinks Choosing (思维+水题)题目大意思路AC代码B - Sport Mafia (暴力+水题)题目大意思路AC代码C - Basketball Exercise(动态规划)题目大意思路AC代码前言要开始想办法逃离挂科的困境了。A - Drinks Choosing (思维+水题)比赛链接:https://codeforces.com/problemset/problem/1195/A题目大意现在你要帮nnn位同学买饮料。饮料店现在有kkk种饮料,原创 2021-10-14 22:13:37 · 404 阅读 · 2 评论 -
Codeforces Round #747(div2)部分题解(A~C,E1)
文章目录前言A - Consecutive Sum Riddle (思维+水题)题目大意思路AC代码B - Special Numbers (数论+位运算)题目大意思路AC代码C - Make Them Equal (思维)题目大意思路AC代码E1 - Rubik's Cube Coloring (easy version) (思维+取模运算)题目大意思路AC代码前言说实话,现在的新生是一个比一个强啊。博主刚进大学的时候啥也不会,没有参加过任何竞赛或是项目,顶多就是把C语言自学了一些。现在都大三原创 2021-10-12 18:00:21 · 3396 阅读 · 0 评论 -
Codeforces Round #572(div2)部分题解(A~C,E)
目录前言A - Keanu Reeves(思维+水题)题目大意思路AC代码B - Number Circle(数学+思维)题目大意思路AC代码C - Computer Game (思维)题目大意思路AC代码D - Add on a TreeE - Count Pairs (数学)题目大意思路AC代码前言你们知道在《Young Sheldon》第五季开播之前的那段时间里,我是怎么度过的吗?你们知道我的痛楚吗?哦,我记得我好像又把TBBT看了一遍,还顺便刷了老友记和权游。我好像还挺快乐的,nmsl原创 2021-10-09 17:28:15 · 350 阅读 · 0 评论 -
Codeforces Round #570 (Div. 3)部分题解(A ~ F)
目录前言A - Nearest Interesting Number(暴力+水题)题目大意思路AC代码B - Equalize Prices (思维)题目大意思路AC代码C - Computer Game (思维)题目大意思路AC代码D - Candy Box (easy version) (魔鬼题+贪心)题目大意思路AC代码E - Subsequences (easy version) (BFS)题目大意思路AC代码前言我把权游第4季看完都没想明白这个问题到底是啥意思。随着人工智能的发展,在技原创 2021-10-07 22:48:20 · 558 阅读 · 0 评论 -
Codeforces Round #746 (Div. 2)部分题解(A ~ C)
目录前言大佬的视频讲解A - Gamer Hemose(贪心)题目大意思路AC代码B - Hemose Shopping (数据结构+思维)题目大意思路AC代码C - Portal(暴力+思维)题目大意思路AC代码D - Mathematics CurriculumE - Train Maintenance(差分数组+线段树+数学)题目大意想法前言比赛当天,群里的两个大哥在那里讨论的十分火热,我看了看笔记本的电量,想起了 God Jun 的教诲:“你只可到这里,不可越过。”最后选择了关机。这两原创 2021-10-05 22:59:49 · 567 阅读 · 0 评论 -
Codeforces Round #745 (Div. 2)部分题解(A ~ C,E的题意与想法)
目录前言A - CQXYM Count Permutations(数学+思维)题目大意思路AC代码B - Diameter of Graph (数据结构+思维)题目大意思路AC代码C - Portal(暴力+思维)题目大意思路AC代码前言这场div2的时间就很离谱,也是怪博主自己没好好看,最后也是错过了。但是补完题之后有一种庆幸自己没打的喜悦,否则又得掉大fen。闲话不多说了,上主菜。A - CQXYM Count Permutations(数学+思维)比赛链接:https://codefo原创 2021-10-03 20:35:27 · 889 阅读 · 3 评论 -
Codeforces Round #744 (Div. 3)部分题解(A ~ E2)
目录前言前言首先,是犯下了懒惰之罪的Mr.RainsdRop。自以为连续日更很了不起,向外宣称自己是一个日更博主。大家不知道,当《废柴日记1:Python与C++中关于随机数的那些事》写到最后的时候,电脑仅仅剩下20%的电量,而文章还有至少一段没写。当时的Mr.RainsdRop闭上眼睛,看到的便是已然成神的 God Jun 。 God Jun 说:“你的电脑将会供你发完博客。你只可到这里,不可越过。”然而,Mr.RainsdRop却逐渐忘记了神对他的恩赐,开始周更,开始拖更。于是神降下原创 2021-10-02 22:58:24 · 925 阅读 · 0 评论 -
Codeforces Round #734 (Div. 3)_B2. Wonderful Coloring - 2(贪心)
文章目录Part1:题目链接Part2:题意Part3:思路1.在最后得到的序列中,非0数字的个数一定为k的倍数。2.对于一个数字,如果出现了k次以上(包含k次),那么至多只有前k次出现时会被涂色;否则都有可能被涂色。Part4:AC代码Part5:整活时间Part1:题目链接点我就送新阿姆斯特朗回旋加速喷气式阿姆斯特朗大炮[doge]Part2:题意现给出一个长度为N的数字序列,对于给出序列我们会对其中的每个数字使用k种颜料进行涂色。涂色之后的序列需要满足:1.对于任意一个数字,它只能被涂上一原创 2021-07-24 23:16:58 · 428 阅读 · 0 评论 -
CodeForces - 1370_C:Number Game
https://vjudge.net/problem/CodeForces-1370C#include<iostream>#include<cstdio>#include<algorithm>#include<map>using namespace std;typedef long long ll;bool is_prime(int n){ for(int i=2;i*i<=n;i++) if(n%i==0)原创 2021-03-14 22:08:15 · 190 阅读 · 0 评论 -
Codeforces Round #695 (Div. 2)_A.Wizard of Orz(规律)
链接:https://codeforces.com/contest/1467/problem/A题目There are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0.Every second, the digit shown by each panel increases by 1. In other words, a原创 2021-01-09 09:10:26 · 446 阅读 · 0 评论 -
Codeforces Round #694 (Div. 2)_B. Strange List(规律)
链接:https://codeforces.com/problemset/problem/1471/B题目You have given an array a of length n and an integer x to a brand new robot. What the robot does is the following: it iterates over the elements of the array, let the current element be q. If q is divi原创 2021-01-06 13:43:31 · 574 阅读 · 1 评论 -
Codeforces Round #693 (Div. 3)——D. Even-Odd Game
链接:https://codeforces.com/problemset/problem/1472/D题目During their New Year holidays, Alice and Bob play the following game using an array a of n integers:Players take turns, Alice moves first.Each turn a player chooses any element and removes it from原创 2021-01-05 21:38:40 · 373 阅读 · 3 评论 -
CodeForces - 980A:Links and Pearls
题目A necklace can be described as a string of links (’-’) and pearls (‘o’), with the last link or pearl connected to the first one.You can remove a link or a pearl and insert it between two other existing links or pearls (or between a link and a pearl) o原创 2020-12-23 22:50:53 · 137 阅读 · 0 评论 -
CodeForces - 979A:Pizza, Pizza, Pizza!!!
谢尔顿“您为什么要骗我呢?”姥姥:“因为你终究要知道,这世上很多人并不喜欢对别人说真话。”谢尔顿:“那我岂不是永远不知道别人在说真话还是假话?”姥姥:“所以人生才精彩啊。”原创 2020-12-22 22:05:52 · 220 阅读 · 0 评论 -
CodeForces - 978C:Letters(二分查找)
题目There are n dormitories in Berland State University, they are numbered with integers from 1 to n. Each dormitory consists of rooms, there are ai rooms in i-th dormitory. The rooms in i-th dormitory are numbered from 1 to ai.A postman delivers letters.原创 2020-12-21 22:52:46 · 260 阅读 · 1 评论 -
CodeForces - 978A:Remove Duplicates(水题)
题目Petya has an array a consisting of n integers. He wants to remove duplicate (equal) elements.Petya wants to leave only the rightmost entry (occurrence) for each element of the array. The relative order of the remaining unique elements should not be cha原创 2020-12-18 22:53:36 · 392 阅读 · 1 评论 -
CodeForces - 977D:Divide by three, multiply by two
题目Polycarp likes to play with numbers. He takes some integer number x, writes it down on the board, and then performs with it n−1 operations of the two kinds:divide the number x by 3 (x must be divisible by 3);multiply the number x by 2.After each op原创 2020-12-17 22:40:10 · 296 阅读 · 0 评论 -
CodeForces - 977C:Less or Equal(思维)
链接:https://vjudge.net/problem/CodeForces-977C题目You are given a sequence of integers of length n and integer number k. You should print any integer number x in the range of [1;10^9] (i.e. 1≤x≤10^9) such that exactly k elements of given sequence are less t原创 2020-12-16 22:49:21 · 350 阅读 · 0 评论 -
CodeForces - 977B:Two-gram(字符串匹配)
链接:https://vjudge.net/problem/CodeForces-977B题目Two-gram is an ordered pair (i.e. string of length two) of capital Latin letters. For example, “AZ”, “AA”, “ZA” — three distinct two-grams.You are given a string consisting of capital Latin letters. Your原创 2020-12-14 22:21:14 · 463 阅读 · 0 评论 -
CodeForces - 977A:Wrong Subtraction(水题)
链接:https://vjudge.net/problem/CodeForces-977A题目Little girl Tanya is learning how to decrease a number by one, but she does it wrong with a number consisting of two or more digits. Tanya subtracts one from a number by the following algorithm:if the last原创 2020-12-13 22:34:28 · 252 阅读 · 0 评论 -
CodeForces - 976A:Minimum Binary Number(水题)
链接:https://vjudge.net/problem/CodeForces-976A题目String can be called correct if it consists of characters “0” and “1” and there are no redundant leading zeroes. Here are some examples: “0”, “10”, “1001”.You are given a correct string s.You can perform t原创 2020-12-12 22:43:58 · 211 阅读 · 0 评论 -
CodeForces - 975B:Mancala(暴力)
链接:https://vjudge.net/problem/CodeForces-975B题目Mancala is a game famous in the Middle East. It is played on a board that consists of 14 holes.Initially, each hole has ai stones. When a player makes a move, he chooses a hole which contains a positive nu原创 2020-12-10 22:03:20 · 263 阅读 · 0 评论 -
CodeForces - 975A:Aramic script(字符串)
链接:https://vjudge.net/problem/CodeForces-975A题目In Aramic language words can only represent objects.Words in Aramic have special properties:A word is a root if it does not contain the same letter more thanonce.A root and all its permutations represen原创 2020-12-09 22:24:51 · 209 阅读 · 0 评论 -
Codeforces965—A:Paper Airplanes(思维)
链接:Codeforce965—A题传送门题目To make a paper airplane, one has to use a rectangular piece of paper. From a sheet of standard size you can make s airplanes.A group of k people decided to make n airplanes each. They are going to buy several packs of paper, each原创 2020-11-30 22:29:38 · 310 阅读 · 0 评论 -
CodeForces - 962B:Students in Railway Carriage(贪心)
链接:https://vjudge.net/problem/CodeForces-962B题目There are n consecutive seat places in a railway carriage. Each place is either empty or occupied by a passenger.The university team for the Olympiad consists of a student-programmers and b student-athletes原创 2020-11-24 21:49:22 · 221 阅读 · 0 评论 -
CodeForces - 961B:Lecture Sleep(前缀和)
链接:https://vjudge.net/problem/CodeForces-961B题目Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.Mishka is really interested in calculus, though it is so hard to stay awake f原创 2020-11-23 22:43:51 · 375 阅读 · 0 评论 -
CodeForces - 961A:Tetris(水题+暴力)
链接:https://vjudge.net/problem/CodeForces-961A题意类似于俄罗斯方块,一共有n列轨道(我也不知道叫啥了,先这样吧),一共会落下m个方块。当有一层全都有方块时,这一层会消失并且你会得1分(俄罗斯方块)。输出得分。思路巨水的一题,可惜我走了弯路。不过只要思想不滑坡,方法总比困难多。开一个数组,记录每个数字的出现次数(反正范围小)。然后输出出现最少的次数就完事了。(一开始我竟然还想着用字符串数组存,然后看哪个短,真的是蠢(~ ̄(OO) ̄)ブ)水水水,上代原创 2020-11-21 22:14:49 · 560 阅读 · 0 评论 -
CodeForces - 960B:Minimize the error(优先队列+贪心)
链接:https://vjudge.net/problem/CodeForces-960B题意输入第一行的三个数字分别代表:n(每组各有n个数字,共有2组),k1(对第一组的操作次数),k2(对第二组的操作次数)。所谓操作就是对一个数字进行 +1 或 -1 。操作k1+k2次之后对两个数组进行以下操作:for(int i=0;i<n;i++) sum+=(a[i]-b[i])*(a[i]-b[i]);求这个sum的最小值。思路状态不是很好,主要是自己作了一个死(没想到会出现那原创 2020-11-20 19:46:54 · 265 阅读 · 2 评论 -
CodeForces - 960A:Check the string(思维)
题目A has a string consisting of some number of lowercase English letters ‘a’. He gives it to his friend B who appends some number of letters ‘b’ to the end of this string. Since both A and B like the characters ‘a’ and ‘b’, they have made sure that at this原创 2020-11-19 22:45:35 · 154 阅读 · 0 评论 -
CodeForces - 946C:String Transformation(暴力)
题目You are given a string s consisting of |s| small english letters.In one move you can replace any character of this string to the next character in alphabetical order (a will be replaced with b, s will be replaced with t, etc.). You cannot replace lette原创 2020-11-16 22:44:39 · 232 阅读 · 0 评论 -
CodeForces-950_A:Left-handers, Right-handers and Ambidexters(思维)
链接:https://vjudge.net/problem/CodeForces-950A题意现在有一场保龄球比赛,教练需要组建一支人数为偶数的队伍。现在教练手上有l个左撇子选手,r个右撇子选手,a个全能人(两只手都可以用)。现在教练希望他的队伍里用左手的人数等于用右手的人数。问你这支队伍最多能有多少人?队伍里可能一个都没有(这个情况允许存在)。思路CF比赛的前2~3个题一般来说都是思维题,基本上有想法就能过。(所以我经常死在没想法的路上/(ㄒoㄒ)/)首先我们考虑左撇子右撇子一样多,那原创 2020-11-14 22:26:20 · 220 阅读 · 0 评论 -
CodeForces - 946B:Weird Subtraction Process(模拟)
链接:https://vjudge.net/problem/CodeForces-946B题意给你两个整数n,m(1 ≤ n, m ≤ 1018)。对于n,m,你可以进行3种操作:1.如果n=0或者m=0,结束操作,输出二者;2.如果n >= 2×m,则将 n 变成 n-2×m ,并返回到1操作。如果不是,执行3操作;3.如果m >= 2×n,则将 m 变成 m-2×n ,并返回到1操作。如果不是,结束处理,输出二者;最初n和m的值都是正整数,所以这个过程是有限的。输出处理之后的原创 2020-11-12 23:00:44 · 179 阅读 · 0 评论