Блог пользователя aryanc403

Автор aryanc403, 2 года назад, По-английски

2013A - Zhan's Blender

Idea

Submission — 282005858

2013B - Battle for Survive

Hint 1
Hint 2
Hint 3

Submission — 282011553

2013C - Password Cracking

Hint 1
Hint 2
Hint 3
Hint 3

Submission — 282024928

2013D - Minimize the Difference

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6

Submission — 282029106

2013E - Prefix GCD

Hint 1
Hint 2
Hint 3
Hint 4

Submission — 282034547

2013F1 - Game in Tree (Easy Version)

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6
Hint 7

Submission — 282075612

2013F2 - Game in Tree (Hard Version)

Разбор задач Codeforces Round 973 (Div. 2)
  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

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

Nobody that I've talked to so far was able to prove the solution for D. Anyone with a proof? I'm eagerly waiting for the editorial because I'm also not able to prove it...

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

    ignoring the very long paragraph above we are trying to prove that in the optimal answer the min will be the maximum possible min we can achieve , right ?

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

    This is not an exact proof for D, but an intuition for why it's always possible to get the biggest min when we get the smallest max. If we look at the array as a stack of bricks at each position, then we know that bricks can flow from left to right. Now let's look at these operations as transactions. When we are trying to get the smallest max (let's call it mx), we want all the elements that have value greater than mx to sell their bricks to someone. And since mx is the smallest max value, this will generate the highest supply of bricks than any other (bigger) max value. Similarly, for getting the biggest min value (calling it mn), we want to get bricks to all the positions that have bricks less than mn. And since mn is the biggest min value, this will create the maximum demand for bricks. Hence it only makes sense that the highest demand and the highest supply can't only coexist simultaneously but actually beneficial for each other since when people want to sell the most bricks, there are the most buyers.

    Hope this makes some sense XD