Heist传送There was an electronic store heist last night. All keyboards which were in the store yesterday were numbered in ascending order from some integer number x. For example, if x=4 and there were 3 keyboards in the store, then the devices had i...
Codeforce 1040A Diagonal Walking v.2 (思维) No.14
Diagonal Walking v.2传送Mikhail walks on a Cartesian plane. He starts at the point(0,0), and in one move he can go to any of eight adjacent points. For example, if Mikhail is currently at the point (0,0), he can go to any of the following points in ...
Codeforce 1040A Palindrome Dance (模拟)No.13
Palindrome Dance传送A group of n dancers rehearses a performance for the closing ceremony. The dancers are arranged in a row, they’ve studied their dancing moves and can’t change positions. For some of them, a white dancing suit is already bought, f...
Codeforce 1037C Equalize (贪心?)【2018.9.2混合场】No.12
Equalize传送You are given two binary strings a and b of the same length. You can performthe following two operations on the string a:Swap any two bits at indices i and j respectively (1≤i,j≤n), the cost of this operation is |i−j|, that is, the absol...
Codeforce 1037B Reach Median【2018.9.2混合场】No.11
Reach Median传送You are given an array a of n integers and an integer s. It is guaranteed thatn is odd.In one operation you can either increase or decrease any single element by one. Calculate the minimum number of operations required to make the me...
Codeforce 1037A Packets (数论?)【2018.9.2混合场】No.10
Packets传送You have n coins, each of the same value of 1.Distribute them into packets such that any amount x (1≤x≤n) can be formed using some (possibly one or all) number of these packets.Each packet may only be used entirely or not used at all. No ...
Codeforce 71A Way Too Long Words (模拟) No.9
Way Too Long Words传送Sometimes some words like “localization” or “internationalization” are so long that writing them many times in one text is quite tiresome. Let’s consider a word too long, if its length is strictly more than 10 characters. All t...
Codeforce 1A Theatre Square (每日一水练读题练手速)No.8
Theatre Square传送Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city’s anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is ...
Codeforce 540C Ice Cave (bfs搜索) No.7
Ice Cave传送You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through the ice. The level of the cave where ...
Codeforce 540B School Marks (贪心)No.6
School Marks传送Little Vova studies programming in an elite school. Vova and his classmates are supposed to write n progress tests, for each test they will get a mark from 1 to p. Vova is very smart and he can write every test for any mark, but he d...