bhikkhu's blog

By bhikkhu, history, 6 years ago, In English

http://codeforces.me/contest/982/problem/D

I don't get why we need to add +1 to a[i]. I understand that we need to add if n = 1. But why do we need to do so in other cases?

  • Vote: I like it
  • 0
  • Vote: I do not like it

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

Really slow but found a test case

3

1 5 2