
思维题
文章平均质量分 73
codertcm
这个作者很懒,什么都没留下…
展开
-
Friends and Cookies
Abood's birthday has come, and his n friends are aligned in a single line from 1 to n, waiting for their cookies, Abood has x cookies to give to his friends.Here is an example to understand how Aboo...原创 2018-07-29 12:32:52 · 225 阅读 · 0 评论 -
HDU 5583 Kingdom of Black and White
DescriptionIn the Kingdom of Black and White (KBW), there are two kinds of frogs: black frog and white frog.Now N frogs are standing in a line, some of them are black, the others are white. The tota...原创 2018-10-07 21:52:48 · 187 阅读 · 0 评论 -
CodeForces 712C Memory and De-Evolution
outputstandard outputMemory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to o...原创 2018-10-06 11:00:07 · 164 阅读 · 0 评论 -
Reorder the Array
You are given an array of integers. Vasya can permute (change order) its integers. He wants to do it so that as many as possible integers will become on a place where a smaller integer used to stand. ...原创 2018-10-01 19:44:36 · 193 阅读 · 0 评论 -
字符串
小N现在有一个字符串S。他把这这个字符串的所有子串都挑了出来。一个S的子串T是合法的,当且仅当T中包含了所有的小写字母。小N希望知道所有的合法的S的子串中,长度最短是多少。输入描述:一行一个字符串S。只包含小写字母。S的长度不超过1e6.输出描述:一行一个数字,代表最短长度。数据保证存在一个合法的S的子串。输入ykjygvedtysvyymzfizzwkjamefxj...原创 2018-09-02 20:11:31 · 392 阅读 · 0 评论 -
HDU - 1394 Minimum Inversion Number
The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj.For a given sequence of numbers a1, a2, ..., an, if we move the fi...原创 2018-08-06 22:52:15 · 132 阅读 · 0 评论 -
CodeForces 1004C Sonya and Robots
Since Sonya is interested in robotics too, she decided to construct robots that will read and recognize numbers.Sonya has drawn n numbers in a row, ai is located in the i-th position. She also has p...原创 2018-08-10 10:51:05 · 207 阅读 · 0 评论 -
Codeforces 990C Bracket Sequences Concatenation Problem
A bracket sequence is a string containing only characters "(" and ")".A regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting chara...原创 2018-08-05 21:12:54 · 239 阅读 · 0 评论 -
CodeForces 877C Slava and tanks
Slava plays his favorite game "Peace Lightning". Now he is flying a bomber on a very specific map.Formally, map is a checkered field of size 1 × n, the cells of which are numbered from 1 to n, in ea...原创 2018-08-04 10:41:59 · 231 阅读 · 0 评论 -
CodeForces 1015D Walking Between Houses
There are n houses in a row. They are numbered from 1 to n in order from left to right. Initially you are in the house 1.You have to perform kmoves to other house. In one move you go from your current...原创 2018-08-04 10:22:30 · 257 阅读 · 0 评论 -
CodeForces 1008B Turn the Rectangles
There are n rectangles in a row. You can either turn each rectangle by 90degrees or leave it as it is. If you turn a rectangle, its width will be height, and its height will be width. Notice that yo...原创 2018-08-04 10:02:12 · 219 阅读 · 0 评论 -
CodeForces 877A Alex and broken contest
One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems.But there are too man...原创 2018-08-03 22:40:10 · 275 阅读 · 0 评论 -
Equalize the Remainders
You are given an array consisting of n integers a1,a2,…,an, and a positive integer m. It is guaranteed that m is a divisor of n.In a single move, you can choose any position ibetween 1 and n and...原创 2018-07-30 08:47:00 · 304 阅读 · 0 评论 -
Minimum Sum of Array
You are given an array a consisting of n integers a1, ..., an. In one operation, you can choose 2 elements ai and aj in which ai is divisible by aj and transform ai to aj.A number x is said to be di...原创 2018-07-30 08:47:41 · 331 阅读 · 0 评论 -
Binary String Constructing
You are given three integers a, b and x. Your task is to construct a binary string s of length n=a+b such that there are exactly a zeroes, exactly b ones and exactly x indices i (where 1≤i<n) such ...原创 2018-07-27 15:48:59 · 456 阅读 · 0 评论 -
Pagodas UVALive 7241
n pagodas were standing erect in Hong Jue Si between the Niushou Mountain and the Yuntai Mountain,labelled from 1 to n. However, only two of them (labelled a and b, where 1 ≤ a ̸= b ≤ n) withstood th...原创 2019-03-22 22:36:57 · 188 阅读 · 0 评论