
Codeforces
xh_Dopamine
这个作者很懒,什么都没留下…
展开
-
Anton and currency you all know------贪心
Berland, 2016. The exchange rate of currency you all know against the burle has increased so much that to simplify the calculations, its fractional part was neglected and the exchange rate is now assu...原创 2020-03-18 13:36:45 · 444 阅读 · 0 评论 -
Product of Three Numbers
You are given one integer number n. Find three distinct integers a,b,c such that 2≤a,b,c and a⋅b⋅c=n or say that it is impossible to do it.If there are several answers, you can print any.You have to...原创 2020-03-17 22:03:41 · 193 阅读 · 0 评论 -
Color the Fence------贪心
Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya’s house. Igor thinks that the larger the number is, the more chance to win Tan...原创 2020-03-18 08:58:26 · 404 阅读 · 0 评论 -
Random Teams------贪心
n participants of the competition were split into m teams in some manner so that each team has at least one participant. After the competition each pair of participants from the same team became frien...原创 2020-03-18 07:47:08 · 390 阅读 · 0 评论 -
Chewbaсca and Number------贪心
Luke Skywalker gave Chewbacca an integer number x. Chewbacca isn’t good at numbers but he loves inverting digits in them. Inverting digit t means replacing it with digit 9 - t.Help Chewbacca to trans...原创 2020-03-17 21:26:51 · 1184 阅读 · 0 评论 -
BerSU Ball------贪心
The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We kn...原创 2020-03-17 21:00:12 · 398 阅读 · 0 评论 -
Cinema Line------贪心
The new “Die Hard” movie has just been released! There are n people at the cinema box office standing in a huge line. Each of them has a single 100, 50 or 25 ruble bill. A “Die Hard” ticket costs 25 r...原创 2020-03-17 20:17:54 · 277 阅读 · 0 评论 -
A and B and Team Training------贪心
A and B are preparing themselves for programming contests.An important part of preparing for a competition is sharing programming knowledge from the experienced members to those who are just beginnin...原创 2020-03-17 19:52:09 · 317 阅读 · 0 评论 -
拼点游戏------贪心
总时间限制: 1000ms 内存限制: 65536kB描述C和S两位同学一起玩拼点游戏。有一堆白色卡牌和一堆蓝色卡牌,每张卡牌上写了一个整数点数。C随机抽取n张白色卡牌,S随机抽取n张蓝色卡牌,他们进行n回合拼点,每次两人各出一张卡牌,点数大者获得三颗巧克力,小者获得一颗巧克力,如果点数相同,每人各得二颗巧克力,使用过的卡牌不得重复使用。已知C和S取到的卡牌点数,请编程计算S最多和最少能得到多...原创 2020-03-16 11:29:34 · 1422 阅读 · 0 评论 -
寻找平面上的极大点------贪心
总时间限制: 1000ms 内存限制: 65536kB描述在一个平面上,如果有两个点(x,y),(a,b),如果说(x,y)支配了(a,b),这是指x>=a,y>=b;用图形来看就是(a,b)坐落在以(x,y)为右上角的一个无限的区域内。给定n个点的集合,一定存在若干个点,它们不会被集合中的任何一点所支配,这些点叫做极大值点。编程找出所有的极大点,按照x坐标由小到大,输出极大...原创 2020-03-15 19:15:00 · 465 阅读 · 0 评论 -
Codeforces Round #635 (Div. 2)---题解(AB)
文章目录A. Ichihime and TriangleB. Kana and Dragon Quest gameA. Ichihime and Triangle题目传送门题意从区间[a,b][b,c][c,d]中选取三个数,以此为三边构成三角形,输出这三个数毕竟是A题,思路肯定比较简单,就找特殊的三角形嘛,等边肯定不行,然后发现等腰可以,即a,c,c代码#include<i...原创 2020-04-17 20:28:03 · 511 阅读 · 0 评论 -
Codeforces Round #634 (Div. 3)--题解(ABC)
文章目录A. Candies and Two SistersB.Construct the StringC. Two Teams Composing、A. Candies and Two Sisters题目传送门解析签到题,注意n的奇偶即可,直接贴代码#include<iostream>using namespace std;int main(){ int t; ...原创 2020-04-14 14:37:21 · 350 阅读 · 0 评论 -
Educational Codeforces Round 85 (Rated for Div. 2)B. Middle Class
Many years ago Berland was a small country where only n people lived. Each person had some savings: the i-th one had ai burles.The government considered a person as wealthy if he had at least x burle...原创 2020-04-11 11:18:50 · 343 阅读 · 0 评论 -
Educational Codeforces Round 85 (Rated for Div. 2)A. Level Statistics(题解)
Polycarp has recently created a new level in this cool new game Berlio Maker 85 and uploaded it online. Now players from all over the world can try his level.All levels in this game have two stats to...原创 2020-04-11 10:51:06 · 317 阅读 · 0 评论 -
Codeforces Round #632 (Div. 2)B. Kind Anton------题解
Once again, Boris needs the help of Anton in creating a task. This time Anton needs to solve the following problem:There are two arrays of integers a and b of length n. It turned out that array a con...原创 2020-04-09 18:48:13 · 338 阅读 · 0 评论 -
Codeforces Round #632 (Div. 2)A. Little Artem------题解
题目大意构造一个序列满足B=W+1其中B代表的是周围有至少一个′W′的′B′'的总数量,W与之相反。解题思路贪心只需左上角的格子为W,其他都为B即可这样至少有一个黑色方格相邻的白色单元格的数量只有一个,而与它相邻的黑色方格数目有两个,刚好满足B=W+1#include <iostream>using namespace std;int main() { int t...原创 2020-04-09 18:36:57 · 226 阅读 · 0 评论 -
Codeforces Round #631 (Div. 2)A. Dreamoon and Ranking Collection
Dreamoon is a big fan of the Codeforces contests.One day, he claimed that he will collect all the places from 1 to 54 after two more rated contests. It’s amazing!Based on this, you come up with the ...原创 2020-04-08 10:21:33 · 229 阅读 · 0 评论 -
Codeforces Round #615 (Div. 3)A. Collecting Coins
Polycarp has three sisters: Alice, Barbara, and Cerene. They’re collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from the trip...原创 2020-04-01 20:31:27 · 221 阅读 · 0 评论 -
Codeforces Round #630 (Div. 2) A. Exercising Walk
DescribeAlice has a cute cat. To keep her cat fit, Alice wants to design an exercising walk for her cat!Initially, Alice’s cat is located in a cell (x,y) of an infinite grid. According to Alice’s th...原创 2020-04-01 09:45:57 · 548 阅读 · 0 评论 -
Educational Codeforces Round 84 ( Div. 2)A. Sum of Odd Integers
You are given two integers n and k. Your task is to find if n can be represented as a sum of k distinct positive odd (not divisible by 2) integers or not.You have to answer t independent test cases....原创 2020-03-24 12:09:04 · 405 阅读 · 0 评论 -
Kyoya and Colored Balls------贪心
Appleman and Toastman play a game. Initially Appleman gives one group of n numbers to the Toastman, then they start to complete the following tasks:Each time Toastman gets a group of numbers, he sums...原创 2020-03-18 20:03:26 · 232 阅读 · 0 评论 -
Codeforces Round #658 (Div. 2)题解总结
文章目录A - Common Subsequence(水)B - Sequential NimA - Common Subsequence(水)You are given two arrays of integers a1,…,an and b1,…,bm.Your task is to find a non-empty array c1,…,ck that is a subsequence of a1,…,an, and also a subsequence of b1,…,bm. If there原创 2020-07-22 20:18:27 · 809 阅读 · 0 评论 -
Codeforces Round #657 (Div. 2)题解总结
文章目录A. Acacius and StringB. Dubious CyrptoC. Choosing flowersA. Acacius and Stringtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputAcacius is studying strings theory. Today he came with the followin原创 2020-07-20 20:32:42 · 709 阅读 · 0 评论 -
Educational Codeforces Round 87 (Rated for Div. 2)----题目+题解(A、B)
文章目录B. Ternary StringA. Alarm Clocktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp has spent the entire day preparing problems for you. Now he has to sleep for at least a minutes to feel原创 2020-05-18 07:36:29 · 481 阅读 · 0 评论 -
Codeforces Round #643 (Div. 2)题目+详解+代码(A\B\C\D)
文章目录A. Sequence with DigitsB. Young ExplorersC. Count TrianglesD. Game With ArrayA. Sequence with Digits来源:http://codeforces.com/contest/1355/problem/ALet’s define the following recurrence:an+1=an+minDigit(an)⋅maxDigit(an).Here minDigit(x) and maxDigi原创 2020-05-17 20:16:44 · 719 阅读 · 0 评论 -
Codeforces Round #642 (Div. 3)------题目+题解+代码(A、B、C、D)
文章目录A. Most Unstable ArrayB. Two Arrays And SwapsC. Board MovesD. Constructing the ArrayA. Most Unstable Array来源:http://codeforces.com/contest/1353/problem/AYou are given two integers n and m. You have to construct the array a of length n consisting of原创 2020-05-15 11:58:38 · 761 阅读 · 0 评论 -
Codeforces Round #641 (Div. 2)题目+题解(A、B、C)
文章目录A. Orac and FactorsB. Orac and ModelsC. Orac and LCMA. Orac and Factors来源:http://codeforces.com/contest/1350/problem/Atime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOrac is studying number t原创 2020-05-13 12:38:37 · 688 阅读 · 0 评论 -
Codeforces Round #640 (Div. 4)---题目+详解+代码(全题目)
文章目录A. Sum of Round NumbersB. Same Parity SummandsC. K-th Not Divisible by nD. Alice, Bob and CandiesE. Special ElementsF. Binary String ReconstructionG. Special PermutationA. Sum of Round Numberstime limit per test1 secondmemory limit per test256 megab原创 2020-05-10 20:10:49 · 1072 阅读 · 0 评论 -
Codeforces Round #639 (Div. 2)---题目+详解+代码(A、B)
文章目录A. Puzzle PiecesB. Card ConstructionsA. Puzzle PiecesYou are given a special jigsaw puzzle consisting of n⋅m identical pieces. Every piece has three tabs and one blank, as pictured below.The j...原创 2020-05-07 20:40:37 · 453 阅读 · 1 评论 -
Codeforces Round #638 (Div. 2)---题目+详解+代码(A、B、C)
文章目录A. Phoenix and BalanceB. Phoenix and BeautyA. Phoenix and Balance来源:http://codeforces.com/contest/1348/problem/Atime limit per test2 secondsmemory limit per test256 megabytesinputstandard inp...原创 2020-05-02 10:03:45 · 821 阅读 · 0 评论 -
Educational Codeforces Round 86 (Rated for Div. 2)---题解(A、B、C)
文章目录A. Road To ZeroB. Binary PeriodC. Yet Another Counting ProblemA. Road To Zerotime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are give...原创 2020-04-27 12:51:17 · 654 阅读 · 0 评论 -
Codeforces Round #637 (Div. 2)A. Nastya and Rice---题解
A. Nastya and Rice传送门:http://codeforces.com/contest/1341/problem/Atime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputNastya just made a huge mis...原创 2020-04-24 22:12:52 · 517 阅读 · 2 评论 -
Codeforces Round #636 (Div. 3)---题解(A、B、C)
文章目录A. CandiesB. Balanced ArrayC. Alternating SubsequenceA. Candies链接:http://codeforces.com/contest/1343/problem/ARecently Vova found n candy wrappers. He remembers that he bought x candies during ...原创 2020-04-22 20:31:03 · 700 阅读 · 2 评论 -
Codeforces Round #647 (Div. 2) - Thanks, Algo Muse!C. Johnny and Another Rating Drop(找规律)---题解
来源:http://codeforces.com/contest/1362/problem/CThe last contest held on Johnny’s favorite competitive programming platform has been received rather positively. However, Johnny’s rating has dropped again! He thinks that the presented tasks are lovely, but原创 2020-06-05 22:17:26 · 410 阅读 · 0 评论 -
Codeforces Round #647 (Div. 2) - Thanks, Algo Muse!B. Johnny and His Hobbies(异或)---题解
来源:http://codeforces.com/contest/1362/problem/BAmong Johnny’s numerous hobbies, there are two seemingly harmless ones: applying bitwise operations and sneaking into his dad’s office. As it is usually the case with small children, Johnny is unaware that co原创 2020-06-05 22:06:34 · 361 阅读 · 0 评论 -
Codeforces Round #647 (Div. 2) - Thanks, Algo Muse!A. Johnny and Ancient Computer(数学)---题解
来源:http://codeforces.com/contest/1362/problem/AJohnny has recently found an ancient, broken computer. The machine has only one register, which allows one to put in there one variable. Then in one operation, you can shift its bits left or right by at most原创 2020-06-05 20:46:22 · 233 阅读 · 0 评论 -
Codeforces Round #646 (Div. 2)C. Game On Leaves(博弈)----题解
来源:http://codeforces.com/contest/1363/problem/CAyush and Ashish play a game on an unrooted tree consisting of n nodes numbered 1 to n. Players make the following move in turns:Select any leaf node in the tree and remove it together with any edge which ha原创 2020-06-01 14:22:41 · 422 阅读 · 0 评论 -
Codeforces Round #646 (Div. 2)B.Subsequence Hate(贪心)---题目+题解
来源:http://codeforces.com/contest/1363/problem/BShubham has a binary string s. A binary string is a string containing only characters “0” and “1”.He can perform the following operation on the string any amount of times:Select an index of the string, and原创 2020-06-01 14:12:22 · 556 阅读 · 0 评论 -
Codeforces Round #646 (Div. 2)A. Odd Selection---题目+题解
来源:http://codeforces.com/contest/1363/problem/AShubham has an array a of size n, and wants to select exactly x elements from it, such that their sum is odd. These elements do not have to be consecutive. The elements of the array are not guaranteed to be d原创 2020-06-01 08:26:59 · 837 阅读 · 0 评论 -
Educational Codeforces Round 88 (Rated for Div. 2)C. Mixing Water(数学+二分法)---题解
C. Mixing Water来源:http://codeforces.com/contest/1359/problem/CThere are two infinite sources of water:hot water of temperature h;cold water of temperature c (c<h).You perform the following procedure of alternating moves:take one cup of the hot wat原创 2020-05-29 20:33:38 · 585 阅读 · 0 评论