Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

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

Автор pahad_charas_chai, история, 4 года назад, По-английски

problem link : https://atcoder.jp/contests/abc053/tasks/arc068_a

here in the problem it says that two opposite sides have sum = 7

then how for x = 7 only 2 moves are required

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

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

Reread the statement.

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

I assume that the first throw (arbitrary) counts, too. So, after two operations there are actually three values to add.

Unfortunatly the statement does not explain how the score is calculated.

  • »
    »
    4 года назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    No, it does not count. What hasn't been said is that out of all arbitrary throws, choose the one which will help you reaching a sum >= x faster(i. e., in less steps)

    For eg, in the sample, we can throw 1(arbitrary throw) then rotate 90 degrees right to bring 5 on the top. Then again rotate the dice to bring 3 on the top. Thus making a sum of 8 (>= 7) inn 2 steps. There are other ways as well.

    Hint : Think Greedily ;)

»
4 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

The key idea of this problem is that we can maximise our score by getting 6,5,6,5... until we've gotten a number that is >=x, so for x=7, the answer is indeed 2.

My Code