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

Автор starboy_jb, история, 6 лет назад, По-английски

Discussion Thread.

Problem A: ATM Queue

Problem B: Metal Harvest

Problem C: Painters' Duel

Problem D: Yeetzhee

Contest Link: here

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

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

How to think about D?

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

    I basically wrote brute force with cache. That was enough to pass hard.

    The main idea is we don't re-throw dice in the turn if we still can get the answer. Then I just kept all groups I could have by current turn and iterated which number I get in current turn. Then honestly update vector, sort it and check that given one is still greater in each position.

    Why that works fast? It seems we don't have that many states.

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

how to solve B?

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

    It seems the most challenging part was to understand the statements. Basically we need to sort all segments, then take one by one and greedy place robots (you actually use each of robots once, not reuse them). Then you might have some suffix left for the robot. We just take next segment and check if this robot can cover it as well. If it can, we do nothing. If it partially covers it, remove that prefix from the segment and then put new robot as described before.

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

C was fun! Thanks authors! :)

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

How to solve C?

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

Google kickstart/codejam mostly ask problem based on expected value and i am never able to make it. Just gonna enjoy the fact that i am dumb!