Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×

Morphy's blog

By Morphy, history, 7 years ago, In English

CodeChef April Cook-Off 2018 will be on Sunday, 22nd April, 2018 at 21:30 IST.

This is the first contest that I set this year. So far I set only one contest per year, so it can be called alei yearly contest :)

There will be 5 puzzles for each division, and you have to solve them in 2.5h. I challenge top coders to solve it in yandex time i.e ~100 minutes.

The puzzles are based on the problems faced by Suzumo in his daily life at ChefLand.

See you in the ranklist!

UPD. Congratulations to the winners!

Div 1

 tourist (perfect score)  natsugiri  ilyakor

Div 2

 YogayoG  owly  stark_arya

  • Vote: I like it
  • +44
  • Vote: I do not like it

»
7 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Sunday "20"?"22" at 21:30 (IST)?

  • »
    »
    7 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thank you for noticing.

    The contest starts in ~3h.

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

What was the intended solution for RUNDIR? I tried to do binary search + 2-SAT but kept getting TLE.

  • »
    »
    7 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I solved it using dynamic programming. Sort all the positions and try all possibilities. Here's my solution for reference https://www.codechef.com/viewsolution/18338444

  • »
    »
    7 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    I solved it using 2-d dp, where one state is of index on which you are and 2nd state is the direction of previous index ( ie it went left or right ).

    Have a look at this for transitions.

  • »
    »
    7 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    First sort all points by x co-ordinate.

    Now binary search on time and greedily assign left or right to all points (first try to assign left if not assign right). If it is possible to assign all points then the given time is possible

    My solution : https://www.codechef.com/viewsolution/18338433

  • »
    »
    7 years ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    Spent 2hrs debugging my solution, but couldn't, Can anyone find any bugs in my solution.

    Morphy can you give me the testcase on which my code fails? Thanks :)

    Link to solution

    never mind, had some bug while printing double value

»
7 years ago, # |
  Vote: I like it +40 Vote: I do not like it

Hope you enjoyed the contest!

Unofficial editorials in my blog: https://aleigorithms.wordpress.com/2018/04/21/april-cook-off-2018/

»
7 years ago, # |
  Vote: I like it +1 Vote: I do not like it

WHERE IS RUSSIAN STATEMENTS?????!?!?!?!?!??!?!?!?!?!!??!?!?!!