Codeforce
文章平均质量分 87
王文波~
清。。
展开
-
Codeforces Round #500 (Div. 2)
A - Piles With StonesThere is a beautiful garden of stones in Innopolis.Its most beautiful place is the n piles with stones numbered from 1 to n.EJOI participants have visited this place twice.When they first visited it, the number of stones in piles w原创 2021-01-20 23:24:27 · 161 阅读 · 0 评论 -
C - Phone Numbers
Vasya has several phone books, in which he recorded the telephone numbers of his friends. Each of his friends can have one or several phone numbers.Vasya decided to organize information about the phone numbers of friends. You will be given n strings — all原创 2021-01-18 21:44:29 · 212 阅读 · 0 评论 -
Proper Nutrition
Vasya has n burles. One bottle of Ber-Cola costs a burles and one Bars bar costs b burles. He can buy any non-negative integer number of bottles of Ber-Cola and any non-negative integer number of Bars bars.Find out if it’s possible to buy some amount of b原创 2021-01-18 17:59:11 · 174 阅读 · 0 评论 -
Codeforces Round #499 (Div. 2)
A - StagesNatasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in some order. Each of the stages is defined by a lowercase Latin letter. This way, the rocket can be described by the string — concatenation of lette原创 2021-01-17 23:40:47 · 138 阅读 · 0 评论 -
Three displays
It is the middle of 2018 and Maria Stepanovna, who lives outside Krasnokamensk (a town in Zabaikalsky region), wants to rent three displays to highlight an important problem.There are nndisplays placed along a road, and the ii-th of them can display a te原创 2020-07-05 22:13:01 · 218 阅读 · 0 评论 -
High School: Become Human
Year 2118. Androids are in mass production for decades now, and they do all the work for humans. But androids have to go to school to be able to solve creative tasks. Just like humans before.It turns out that high school struggles are not gone. If someone原创 2020-07-05 22:11:36 · 190 阅读 · 0 评论 -
Infinity Gauntlet
You took a peek on Thanos wearing Infinity Gauntlet. In the Gauntlet there is a place for six Infinity Gems:the Power Gem of purple color,the Time Gem of green color,the Space Gem of blue color,the Soul Gem of orange color,the Reality Gem of red color原创 2020-07-05 22:10:00 · 287 阅读 · 0 评论 -
codeforce-----------Polygon
Polygon is not only the best platform for developing problems but also a square matrix with side nn, initially filled with the character 0.On the polygon, military training was held. The soldiers placed a cannon above each cell in the first row and a canno原创 2020-05-27 23:10:33 · 298 阅读 · 0 评论 -
codeforce----------B. Ternary String
给一个字符串,只包含1,2,3这三种数字,求最小的长度,可以同时包含这三个字符串#include <bits/stdc++.h>using namespace std;int main(){ int T; cin>>T; while(T--) { string s; cin>>s; int pos[4],i; int ans=0x3f3f3f原创 2020-05-18 12:48:35 · 161 阅读 · 0 评论 -
codeforce----------Constructing the Array
You are given an array aa of length nn consisting of zeros. You perform nn actions with this array: during the ii-th action, the following sequence of operations appears:Choose the maximum by length subarray (continuous subsegment) consisting only of zeros原创 2020-05-15 19:56:30 · 198 阅读 · 0 评论 -
codeforce-----------Fifa and Fafa
Fifa and Fafa are sharing a flat. Fifa loves video games and wants to download a new soccer game. Unfortunately, Fafa heavily uses the internet which consumes the quota. Fifa can access the internet through his Wi-Fi access point. This access point can be原创 2020-05-10 21:57:35 · 233 阅读 · 0 评论 -
codeforce-----------Fafa and the Gates
Two neighboring kingdoms decided to build a wall between them with some gates to enable the citizens to go from one kingdom to another. Each time a citizen passes through a gate, he has to pay one silver coin.The world can be represented by the first quad原创 2020-05-10 21:49:25 · 179 阅读 · 0 评论 -
codeforce--------Fafa and his Company
Fafa owns a company that works on huge projects. There are n employees in Fafa’s company. Whenever the company has a new project to start working on, Fafa has to divide the tasks of this project among all the employees.Fafa finds doing this every time is原创 2020-05-10 21:43:09 · 150 阅读 · 0 评论 -
Codeforces Round #640 (Div. 4)题解
Sum of Round NumbersA positive (strictly greater than zero) integer is called round if it is of the form d00…0. In other words, a positive integer is round if all its digits except the leftmost (most significant) are equal to zero. In particular, all numb原创 2020-05-10 12:57:16 · 256 阅读 · 0 评论 -
codeforce--------Table Tennis
n people are standing in a line to play table tennis. At first, the first two players in the line play a game. Then the loser goes to the end of the line, and the winner plays with the next person fro...原创 2020-05-03 22:41:12 · 139 阅读 · 0 评论 -
codeforece--------Borya's Diagnosis
It seems that Borya is seriously sick. He is going visit n doctors to find out the exact diagnosis. Each of the doctors needs the information about all previous visits, so Borya has to visit them in ...原创 2020-05-03 22:31:43 · 135 阅读 · 0 评论 -
codeforce-----Treasure Hunt
在一场盛大的生日派对后,Katie(以下简称Ka)仍然想和Shiro(以下简称S)去找更多的乐子。不一会,她就想到了一个游戏,叫做寻宝。当然,她邀请了她最好的朋友Kuro(以下简称Ku)和S和她一起玩。三个朋友都很聪明所以他们很快的通过了所有挑战并且终于到达了终点。但是宝藏只能属于一只猫(主角们都是猫),所以他们开始想个决定宝藏归属的法子。很快的,Ku带着一些丝带前来。每只猫都被发放了一条随机...原创 2020-04-12 22:09:31 · 132 阅读 · 0 评论 -
codeforce---------Pizza, Pizza, Pizza!!!
Shiro过生日啦!她请了nnn个好朋友来庆祝自己的生日。为了庆祝,她拿出了一份非常大的披萨。她想把这份披萨切成n+1n+1n+1份(她自己也要吃)。这n+1n+1n+1份要求大小和形状都一样。那么Shiro最少要切多少刀?ps:切披萨时,只能切直线,不能把披萨摞起来切0≤n≤10^18其实很简单,只需要找规律就行了如果n+1是奇数,则答案为n+1如果n+1是偶数,则答案为(n+1)/...原创 2020-04-12 22:04:32 · 176 阅读 · 0 评论 -
codeforce----------File Name
standard outputYou can not just take the file and send it. When Polycarp trying to send a file in the social network “Codehorses”, he encountered an unexpected problem. If the name of the file contain...原创 2020-04-05 23:31:04 · 169 阅读 · 0 评论 -
codeforce---------Remove Duplicates
Petya has an array aa consisting of nn 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 or...原创 2020-04-05 23:25:46 · 208 阅读 · 0 评论 -
codeforce---------Marlin
The city of Fishtopia can be imagined as a grid of 44 rows and an odd number of columns. It has two main villages; the first is located at the top-left cell (1,1)(1,1), people who stay there love fish...原创 2020-03-29 21:56:25 · 144 阅读 · 0 评论 -
codeforce-----------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 existi...原创 2020-03-29 21:51:22 · 183 阅读 · 0 评论 -
codeforce-----Divide by three, multiply by two
Polycarp likes to play with numbers. He takes some integer number xx, writes it down on the board, and then performs with it n−1n−1operations of the two kinds: divide the number xxby 33(xxmust b...原创 2020-03-23 16:18:53 · 163 阅读 · 0 评论 -
codeforce-------Less or Equal
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;109] (i.e. 1≤x≤109) such that exactly k elements of given sequence are l...原创 2020-03-23 16:12:50 · 131 阅读 · 0 评论 -
codeforce-----Two-gram
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 ss consisting of nn capital Latin let...原创 2020-03-23 16:08:59 · 220 阅读 · 0 评论 -
codeforce-------Wrong Subtraction
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 th...原创 2020-03-23 16:05:16 · 266 阅读 · 0 评论 -
codeforce----Valhalla Siege
Ivar the Boneless is a great leader. He is trying to capture Kattegat from Lagertha. The war has begun and wave after wave Ivar’s warriors are falling in battle.Ivar has nnwarriors, he places them on...原创 2020-03-15 22:29:01 · 113 阅读 · 0 评论 -
codeforce-------------Mancala
Mancala is a game famous in the Middle East. It is played on a board that consists of 14 holes.Initially, each hole has aiai stones. When a player makes a move, he chooses a hole which contains a pos...原创 2020-03-15 21:26:18 · 129 阅读 · 0 评论 -
codeforce-------Aramic script
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 than once.A root and all its permutations re...原创 2020-03-15 21:16:13 · 211 阅读 · 0 评论 -
Codeforce---------Watering System
Arkady wants to water his only flower. Unfortunately, he has a very poor watering system that was designed for nn flowers and so it looks like a pipe with nn holes. Arkady can only use the water that ...原创 2020-03-08 22:01:02 · 129 阅读 · 0 评论 -
Codeforce---------Mind the Gap
These days Arkady works as an air traffic controller at a large airport. He controls a runway which is usually used for landings only. Thus, he has a schedule of planes that are landing in the nearest...原创 2020-03-08 21:47:55 · 136 阅读 · 0 评论