Zlobober's blog

By Zlobober, 7 years ago, translation, In English

Hi,

Today at 13:00 UTC there will be a Warmup Round of Yandex.Algorithm 2017. This is a great possibility for you to get familiar with TCM/Time contest format, and also to pass to the elimination round of the competition by successfully submitting at least one problem.

In order to participate in the competition, you have to register, the registration will remain open for the next week.

The link to the round will appear on the site of the competition shortly before the start of the round.

Good luck!

Enter the contest!


UPD: Round is over, thanks for the participation! Congratulations to four participants who successfully solved all problems:

  1. KrK
  2. maksay
  3. yangxm
  4. sokian

All participants with at least one successful submission pass to the elimination round of the competition.

UPD2: Contest editorial.

  • Vote: I like it
  • +76
  • Vote: I do not like it

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

How to solve problem D?

  • »
    »
    7 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    I solved it with DP : DP[index][parity of previous element][parity of current element]. The main idea is you wouldn't use the operation twice on the same index.

  • »
    »
    7 years ago, # ^ |
    Rev. 2   Vote: I like it +13 Vote: I do not like it

    Greedy — http://ideone.com/rhDW7F You do at-most 1 operation at each position. Fix operations on borders(4 cases), then starting from first position, do this greedy procedure — if any is of opposite parity, increment next 3. If last 2 are in order, update answer.

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Thank you for this round!

Couple things I want to mention:

  • please add -DONLINE_JUDGE to gcc — it's common practice that boilerplate code includes #ifdef to not include some headers at judge
  • problem statements (except for F) are kind of boring and too straight in the face. Maybe somebody likes it but it would be nice to have a "story" (even totally superficial)
»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

In problem C , What's wrong with first sorting the array and then doing a DP , where DP[i] = min(DP[i-1],DP[i-2]) + 1 . (DP[i-2] is only included when abs(arr[i] — arr[i-1]) <= 1 )

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

F = mincost?