Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×

Блог пользователя round-for-beginners

Автор round-for-beginners, 5 лет назад, По-английски

Editorial for #1 Round for Beginners (Div. 4)

$$$A.$$$ Coins for friends

Authors: zhasurr, round-for-beginners

The most optimal solution was $$$n$$$ + $$$1$$$. Perfect can give each friend $$$1$$$ coins and he himself will get $$$1$$$ coin.

(C++) Author's solution:
(Python) Tester's solution:

$$$B.$$$ Road to be Legend

Authors: zhasurr, round-for-beginners, abdu11a

First, take a separate value that will read the lessons and the value that will store the largest. Check yesterday's lesson is the same as today's. If not, then increase the value and the value that stores the longest days will be equal to the maximum of these two values, otherwise the value is equal to $$$1$$$. At the end, check the two values again and print the value that stores the largest

(C++) Author's solution:
(Python) Tester's solution:

$$$C.$$$ Pair of numbers

Authors: zhasurr

If the sum of all numbers in the array is odd, then NO is displayed exactly. Otherwise, take a single number that is equal to $$$sum$$$/$$$2$$$. Sort the array. Now it is exactly guaranteed that the penultimate number and $$$a_i$$$ will be equal to $$$sum$$$/$$$2$$$ or when $$$a_i$$$ + $$$a_{i + 1}$$$ will be equal to $$$sum$$$/$$$2$$$

(C++) Author's solution:
(Python) Tester's solution:

$$$D.$$$ Permutation

The task was taken from the 3rd stage of the Republican Olympiad 2020 (Kazakhstan)

The first number that is odd will jump two steps forward, i.e. the 1st number will become 3 and the 3 will jump the next two numbers and will equal 5. With the even ones everything is the same. For example, the number 2 will be equal to 4, and the 4th to 6, etc.

(C++) Author's solution:
(Python) Tester's solution:

$$$E.$$$ Joyful numbers

Author: round-for-beginners

(C++) Author's solution:
(Python) Tester's solution:

UPD1: Searching for testers to new rounds. If you want to be tester write message to this mail: [email protected]

  • Проголосовать: нравится
  • +26
  • Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

python codes plz

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can someone please clarify problem C? Why is it guaranteed that "the penultimate number and ai will be equal to sum/2 or when ai + ai+1 will be equal to sum/2" when the array is sorted?

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    example: n = 5; array = 1 3 7 6 5

    sort and get an array 1 3 5 6 7

    loop through the array and check the number with the last element and the next element.

    1. ai = 1; ai+1 = 3; an = 7; need to find if you can get 11 of them? ai + a[i+1] = 4 and ai + an = 8 none of the conditions equals 11 so let's move on
    2. ai = 3; ai+1 = 5; an = 7; ai + a[i+1] = 8 and ai + an = 12 none of the conditions equals 11 so let's move on
    3. ai = 5; ai+1 = 6; an = 7; a[i]+a[i+1] = 11 we got 11 and this pair of numbers is correct.
»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

enjoy this a lot

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I have no idea why my solution exactly coincides with tester's python solution instead of this that I was not a tester. C A D :)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I am not able to see other's code.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How can I participate(is it possible?) in a contest like this?