
codeforces
文章平均质量分 74
codeforces
稚皓君
欢迎你的光临,随便看看就好 ^_^
展开
-
Codeforces Round #734 (Div. 3) 题解
Codeforces Round #734 (Div. 3)1551A. Polycarp and Coins题意:结账时,一共花费n元,要求只使用1元与2元的硬币进行支付,并且两种硬币的数量之差的绝对值要最小,问使用1元与2元硬币的数量各是多少?思路:如果n%3==0,说明两种硬币数量相等,都为n/3。如果n%3==1,说明还剩1元需要使用面值为1元的硬币进行支付,那么,1元硬币数量为n/3+1,2元硬币数量为n/3。如果n%3==2,说明还剩2元需要使用面值为2元的硬币进行支付,那么原创 2021-07-24 09:46:04 · 418 阅读 · 1 评论 -
Codeforces Round #720 (Div. 2)
Codeforces Round #720 (Div. 2)A. Nastia and Nearly Good Numbersinput35 313 27 11outputYES10 50 60YES169 39 208YES28 154 182题意:输入a,b。判断能否找出一个好数字(a,b共同的倍数),两个几乎好数字(只是a的倍数)。并且满足其中两个数相加等于第三个数。思路:题意很明确,就直接构造就行,x=a(x几乎好数字,只是a的倍数),y=a * b(y好原创 2021-05-08 12:36:42 · 1372 阅读 · 2 评论 -
Codeforces Round #719 (Div. 3)
Codeforces Round #719 (Div. 3)A. Do Not Be Distracted!input53ABA11DDBBCCCBBEZ7FFGZZZY1Z2ABoutputNONOYESYESYES题意:输入一串字符串,除去首次出现同样连续的字符,如果后面再次出现同样字符就输出NO,否则,输出"YES";AC代码#include<bits/stdc++.h>using namespace std;int main()原创 2021-05-06 09:26:05 · 261 阅读 · 0 评论 -
Educational Codeforces Round 108 (Rated for Div. 2)
Educational Codeforces Round 108 ( Div. 2)A. Red and Blue BeansYou have r red and b blue beans. You’d like to distribute them among several (maybe, one) packets in such a way that each packet: has atleast one red bean (or the number of red beans ri≥1);原创 2021-04-30 11:31:43 · 212 阅读 · 0 评论 -
C. Double-ended Strings
题目链接time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given the strings a and b, consisting of lowercase Latin letters. You can do any number of the following operations in any order:if |a|&原创 2021-04-08 21:52:36 · 310 阅读 · 0 评论 -
C. Ping-pong
传送门1455 C. Ping-pongtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice and Bob play ping-pong with simplified rules.During the game, the player serving the ball commences a play. The server原创 2020-12-01 20:40:59 · 422 阅读 · 0 评论 -
B. Jumps
传送门1455 B. Jumpstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are standing on the OX-axis at point 0 and you want to move to an integer point x>0 You can make several jumps. Suppose yo原创 2020-12-01 20:34:54 · 303 阅读 · 0 评论 -
A. Strange Functions
传送门A. Strange Functionstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet’s define a function f(x)(x is a positive integer) as follows: write all digits of the decimal representation of x ba原创 2020-12-01 20:23:21 · 370 阅读 · 0 评论 -
A. Permutation Forgery(思维题)
传送门A. Permutation Forgerytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA permutation of length nis an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,原创 2020-09-10 20:07:47 · 2763 阅读 · 0 评论 -
A. String Similarity
传送门A. String Similaritytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA binary string is a string where each character is either 0 or 1. Two binary strings aand b of equal length are similar原创 2020-08-26 00:07:43 · 299 阅读 · 0 评论 -
B. Ternary Sequence
传送门B. Ternary Sequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two sequences a1,a2,…,an and b1,b2,…,bn. Each element of both sequences is either 0, 1 or 2. The number of e原创 2020-08-22 00:35:50 · 1676 阅读 · 0 评论 -
A. Distance and Axis
传送门A. Distance and Axistime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWe have a point Awith coordinate x=n on OX-axis. We’d like to find an integer point B (also on OX-axis), such that the abs原创 2020-08-22 00:29:44 · 513 阅读 · 0 评论 -
A. Fafa and his Company
传送门935A. Fafa and his Companytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFafa owns a company that works on huge projects. There are n employees in Fafa’s company. Whenever the company has a原创 2020-08-18 17:19:15 · 200 阅读 · 0 评论 -
A. Vanya and Cubes
传送门492A. Vanya and Cubestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of原创 2020-08-18 17:02:33 · 268 阅读 · 0 评论 -
A. Add Odd or Subtract Even
传送门A. Add Odd or Subtract Eventime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two positive integers a and b In one move, you can change a in the following way:Choose any positiv原创 2020-08-18 15:24:29 · 341 阅读 · 0 评论 -
A. Frog Jumping
传送门A. Frog JumpingA frog is currently at the point 00 on a coordinate axis OxOx. It jumps by the following algorithm: the first jump is aa units to the right, the second jump is bb units to the left, the third jump is aa units to the right, the fourth ju原创 2020-08-18 11:28:22 · 404 阅读 · 0 评论 -
A. Collecting Coins
传送门A. Collecting Coinstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp has three sisters: Alice, Barbara, and Cerene. They’re collecting coins. Currently, Alice has acoins, Barbara ha原创 2020-08-18 11:05:13 · 171 阅读 · 0 评论 -
A. Brain‘s Photos
传送门A. Brain’s Photostime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSmall, but very brave, mouse Brain was not accepted to summer school of young villains. He was upset and decided to postpone原创 2020-08-18 10:17:50 · 269 阅读 · 0 评论 -
B. Omkar and Infinity Clock
传送门B. Omkar and Infinity Clocktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBeing stuck at home, Ray became extremely bored. To pass time, he asks Lord Omkar to use his time bending power: I原创 2020-08-17 20:36:45 · 317 阅读 · 0 评论 -
A. Omkar and Password
A. Omkar and Passwordtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLord Omkar has permitted you to enter the Holy Church of Omkar! To test your worthiness, Omkar gives you a password which yo原创 2020-08-17 19:54:02 · 750 阅读 · 0 评论 -
C. Good Subarrays
传送门C. Good Subarraystime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a1,a2,…,anconsisting of integers from 0 to 9. A subarray al,al+1,al+2,…,ar−1,ar is good if the sum o原创 2020-08-15 10:46:35 · 493 阅读 · 0 评论 -
B. Substring Removal Game
B. Substring Removal Gametime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice and Bob play a game. They have a binary string s(a string such that each character in it is either 0 or 1). Alice原创 2020-08-15 10:37:58 · 926 阅读 · 0 评论 -
A. Bad Triangle
传送门A. Bad Triangletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a1,a2,…,an, which is sorted in non-decreasing order (ai≤ai+1)Find three indices i, j, k such that 1≤i<原创 2020-08-15 00:16:18 · 404 阅读 · 0 评论 -
A. Maximum GCD(最大公约数)
传送门A. Maximum GCDtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet’s consider all integers in the range from 1 to n(inclusive).Among all pairs of distinct integers in this range, find the max原创 2020-08-14 17:08:20 · 582 阅读 · 0 评论 -
A. Gennady and a Card Game(字符匹配)
传送门A. Gennady and a Card Gametime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGennady owns a small hotel in the countryside where he lives a peaceful life. He loves to take long walks, watch sun原创 2020-08-14 16:37:12 · 905 阅读 · 0 评论 -
A. Fancy Fence(思维)
传送门A. Fancy Fencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEmuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He want原创 2020-08-14 11:22:10 · 555 阅读 · 0 评论 -
A. Dawid and Bags of Candies
传送门A. Dawid and Bags of Candiestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDawid has four bags of candies. The i-th of them contains ai candies. Also, Dawid has two friends. He wants to giv原创 2020-08-11 20:21:15 · 169 阅读 · 0 评论 -
C. Substring Game in the Lesson
传送门C. Substring Game in the Lessontime limit per test2 secondsmemory limit per test256 mebibytesinputstandard inputoutputstandard outputMike and Ann are sitting in the classroom. The lesson is boring, so they decided to play an interesting game.原创 2020-08-11 11:24:49 · 233 阅读 · 0 评论 -
A. Cards
传送门A. Cardstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhen Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way原创 2020-08-11 10:46:47 · 195 阅读 · 0 评论 -
B. Equal Rectangles
传送门B. Equal Rectanglestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given 4n sticks, the length of the i-th stick is ai.You have to create n rectangles, each rectangle will consist o原创 2020-08-07 17:42:50 · 249 阅读 · 0 评论 -
A. Circle of Students
传送门A. Circle of Studentstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n students standing in a circle in some order. The index of the i-th student is pi. It is guaranteed that all原创 2020-08-07 16:47:53 · 229 阅读 · 0 评论 -
A. Hotelier
传送门A. Hoteliertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAmugae has a hotel consisting of 10 rooms. The rooms are numbered from 0 to 9 from left to right.The hotel has two entrances — one原创 2020-08-07 16:03:37 · 175 阅读 · 0 评论 -
B. Zero Array
传送门B. Zero Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a1,a2,…,an.In one operation you can choose two elements ai and aj (i≠j) and decrease each of them by one.原创 2020-08-06 17:03:39 · 233 阅读 · 0 评论 -
B. Water Lily
传送门B. Water Lilytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhile sailing on a boat, Inessa noticed a beautiful water lily flower above the lake’s surface. She came closer and it turned out原创 2020-08-06 15:18:45 · 223 阅读 · 0 评论 -
A. City Day
传送门A. City Daytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFor years, the Day of city N was held in the most rainy day of summer. New mayor decided to break this tradition and select a not-s原创 2020-08-06 11:44:45 · 169 阅读 · 0 评论 -
B. Odd Sum Segments
传送门B. Odd Sum Segmentstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array aa consisting of nn integers a1,a2,…,ana1,a2,…,an. You want to split it into exactly kk non-empty n原创 2020-08-06 10:52:44 · 229 阅读 · 0 评论 -
A. Three Piles of Candies
传送门A. Three Piles of Candiestime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputAlice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as po原创 2020-08-06 09:59:14 · 332 阅读 · 1 评论 -
B. Tokitsukaze and Mahjong
传送门B. Tokitsukaze and Mahjongtime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputTokitsukaze is playing a game derivated from Japanese mahjong. In this game, she has three tiles in her hand. Each t原创 2020-08-04 21:00:28 · 309 阅读 · 4 评论 -
A. Tokitsukaze and Enhancement
传送门A. Tokitsukaze and Enhancementtime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputTokitsukaze is one of the characters in the game “Kantai Collection”. In this game, every character has a common原创 2020-08-04 19:38:57 · 168 阅读 · 0 评论 -
B. Number Circle
传送门B. Number Circletime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputYou are given n numbers a1,a2,…,an. Is it possible to arrange them in a circle in such a way that every number is strictly les原创 2020-08-04 11:29:03 · 293 阅读 · 0 评论