tourist's blog

By tourist, 13 months ago, translation, In English

1786A2 - Alternating Deck (hard version)

Problem author: KAN

Explanation
Code by KAN

1786B - Cake Assembly Line

Problem author: KAN

Explanation
Code by KAN

1785A - Monsters (easy version)

Problem author: tourist

Explanation
Code by tourist

1785B - Letter Exchange

Problem author: tourist

Explanation
Code by PavelKunyavskiy

1785C - Monsters (hard version)

Problem author: tourist

Explanation
Code by tourist

1785D - Wooden Spoon

Problem author: tourist

Explanation
Code by tourist

1785E - Infinite Game

Problem author: tourist

Explanation
Code by tourist

1785F - Minimums or Medians

Problem author: tourist

Explanation
Code by tourist, O(n^2)
Code by tourist, O(n)
  • Vote: I like it
  • +81
  • Vote: I do not like it

»
13 months ago, # |
  Vote: I like it +11 Vote: I do not like it

Thanks for the editorial,waiting from a long time.

»
13 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Finally an editorial! After a long week and a half.

»
5 months ago, # |
  Vote: I like it 0 Vote: I do not like it

can someone tell me, why this test case is NO according to tutorial code

3 2 2 8 13 100 2 10 100

here we do need to shift , 2nd dispenser will server first and second cake , so this should be YES right .(KAN)

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Another approach for B

If we are shifting to left it means we are moving in negative direction If we are shifting to right it means we are moving in positive direction

We can try all possible values of shifting by binary search, and compare if we want to shift in positive and negative direction and reduce the search space on each try

https://codeforces.com/contest/1786/submission/238301378