0%

Codeforces 705A - Hulk

Hulk

Dr. Bruce Banner hates his enemies (like others don’t). As we all know, he can barely talk when he turns into the incredible Hulk. That’s why he asked you to help him to express his feelings.

閱讀全文 »

Codeforces 1055A - Metro

Metro

Alice has a birthday today, so she invited home her best friend Bob. Now Bob needs to find a way to commute to the Alice’s home.

閱讀全文 »

Codeforces 888C - K-Dominant Character

K-Dominant Character

You are given a string s consisting of lowercase Latin letters. Character c is called k-dominant iff each substring of s with length at least k contains this character c.

閱讀全文 »

Codeforces 246A - Buggy Sorting

Buggy Sorting

Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, …, an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The input of the program gets number n and array a.

閱讀全文 »

Codeforces 378B - Semifinals

Semifinals

Two semifinals have just been in the running tournament. Each semifinal had n participants. There are n participants advancing to the finals, they are chosen as follows: from each semifinal, we choose k people (0 ≤ 2k ≤ n) who showed the best result in their semifinals and all other places in the finals go to the people who haven’t ranked in the top k in their semifinal but got to the n - 2k of the best among the others.

閱讀全文 »

Codeforces 37A - Towers

Towers

Little Vasya has received a young builder’s kit. The kit consists of several wooden bars, the lengths of all of them are known. The bars can be put one on the top of the other if their lengths are the same.

閱讀全文 »

Codeforces 276A - Lunch Rush

Lunch Rush

Having written another programming contest, three Rabbits decided to grab some lunch. The coach gave the team exactly k time units for the lunch break.

閱讀全文 »

Codeforces 510A - Fox And Snake

Fox And Snake

Fox Ciel starts to learn programming. The first task is drawing a fox! However, that turns out to be too hard for a beginner, so she decides to draw a snake instead.

閱讀全文 »

Codeforces 1146A - LOVE A

LOVE A

Alice has a string s. She really likes the letter “a”. She calls a string good if strictly more than half of the characters in that string are “a”s. For example “aaabb”, “axaa” are good strings, and “baca”, “awwwa”, “” (empty string) are not.

閱讀全文 »

Codeforces 1042A - Benches

Benches

There are n benches in the Berland Central park. It is known that ai people are currently sitting on the i-th bench. Another m people are coming to the park and each of them is going to have a seat on some bench out of n available.

閱讀全文 »