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

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

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

Discussion Thread.

Problem A: ATM Queue

Problem B: Metal Harvest

Problem C: Painters' Duel

Problem D: Yeetzhee

Contest Link: here

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

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

How to think about D?

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +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.

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

how to solve B?

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +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.

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

      Agreed!

      Understanding the statement was the most difficult part of the problem.

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

C was fun! Thanks authors! :)

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

    Could you provide any insight or intuition on why the recursion depth is actually low?

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

      Also can someone help me if there is any non-backtracking solution to the same ?

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

      Intuition was this: I have no idea how to solve it other way, applying profile DP or so. Then another idea is we pretty quickly shrink number of valid moves and there are many states where we have only one option. Having fun I implemented simple brute force and that did not get TL.

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

    Is this joke

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

      Actually not! I am one of those who thinks that there is a word "programming" in "programming competitions". Sometimes it is nice to have good old-fashioned brute force :)

      But your problems are fun too! Thanks to you for making my old brain thinks sometimes :)

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

How to solve C?

»
4 года назад, # |
  Проголосовать: нравится +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!

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

    Well, you have an exciting opportunity to learn it. Imo, you cannot find a truly involved problem in terms of probability because a few people would solve it. So you only have to understand basics from probability (and presumably a lot more at coding).

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

    Try this may be it'll help