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

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

So I was giving Codeforces Round #790 Div 4. I solved B (not efficiently) however my code gave wrong ans. After the contest was over I looked for the test case and ran in my personal ide. It worked fine there. It was also running on onliegdb.com

Link to my solution: https://codeforces.com/contest/1676/submission/156648104

I want to know why isn't my code running as intended? Thanks for any help!

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

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

You exit the function without reading the values when n is 1, so every test afterwards is reading the wrong data.