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

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

The 2016 Google Code Jam World Finals just started. Relevant links:

Edit: The contest is over. Results:

  1. tourist
  2. kevinsogo
  3. Egor
  4. eatmore
  5. Merkurev
  6. mnbvmar
  7. scott_wu
  8. simonlindholm
  9. gs12117
  10. semiexp
  11. ffao
  12. vepifanov
  13. pashka
  14. KAN
  15. rng_58
  16. yosupo
  17. Xhark
  18. Nore
  19. Marcin_smu
  20. s-quark
  21. jcvb
  22. nika
  23. xllend3

Congratulations!

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

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

Seriously, why bother and hold a Code Jam World Finals every year? they can simply give it to tourist. Wouldn't that be easier? :D

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

Interesting things I noticed during the Live Stream :-

  • tourist named one of his files stupid.cpp -___-

  • MAGIC = 200 :)

Anyway, the live stream was pretty bad!
The arena was dimly lit for some reason. Also, they only showed tourist's monitor throughout the contest, and said they didn't make arrangements for others' screens. Towards the end of the contest I really wanted to see what kevinsogo and Egor were working on since the scoreboard was so close! There were tedious and long breaks in the stream very frequently as well. They should really show somebody's screen during those breaks instead of playing pathetic music :P

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

    Wut is weird with those things? Everyone sometimes needs a magic number and giving stupid names to files is also rather common. I for example sometimes name files like "ass.cpp" or "nothing" (but in Polish). Just because tourist did this doesn't make that fact extraordinary :P.

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

      Sometimes I want to create a file nic.cpp (what means "nothing" in Polish) but it already exists so I create nothing.cpp. I will burn in hell for programmers.

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

      I think stupid.cpp is not just a random stupid name. It means a stupid solution (for a small input, for example).

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

      Swistakk, I never said that it's weird or extraordinary. For E in the codejam finals, he was tweaking his MAGIC and staring at outputs. He submitted large input with only a few minutes to go. Most people (including the panel) did not expect it to pass, but it did xD

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

        It's very common for tourist to submit his last solution with only a few minutes to go. It's a good strategy, he knows he doesn't have time to code anything else so he might as well make sure his solution is correct.

        In this specific case, although his approach for problem E is the simplest (conceptually), it looks really difficult to get precise enough. He must have had a feeling for those magic constants!

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

The improvement in kevinsogo's performance is quite remarkable from 26th last year to 2nd this year

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

As there was no analysis of the finals (sadly), I am asking here. Can anyone explain the idea behind the first problem? The statement is beautifully simple: given a regular expression describing integers, count how many integers there are <= N, which match the pattern.

I remember finite automata and regular expressions from CS classes fairly well, but haven't come up with a good idea to efficiently solve this problem, because N can be huge, up to 10^18. For small N I could just implement the RE as a FA and try one by one. For bigger N... maybe the pumping lemma comes into play, but I don't see how.

Just the main idea or even a hint would be great; I don't want to start reading solutions without trying a bit more first. Thanks!