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

Автор Number_72, история, 17 месяцев назад, По-английски

Hello CodeForces. I've been trying to solve this problem (505C - Mr. Kitayuta, the Treasure Hunter) for the last hour but I hit a roadblock. Here's my submission: 212193996

It uses the idea of the editorial but somehow fails testcase 5. The expected output is 16790 but my code outputs 16791.

Thanks for your interest...

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

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

Hi! I believe you should remove your two conditions: (j > 0) and (j<2*ss) in your second and third if statements (as I think they are pointless). Instead, you should check if lastjump > 1 in your second state because if your lastjump is 1, then the next one cannot be 0. These changes should make you solution pass.