bansalarpan4's blog

By bansalarpan4, history, 4 hours ago, In English

does anyone have any viable explanation for the following submission failing on test case 3 Submission — 297549624 ques 2042B - Game with Colored Marbles

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

»
4 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by bansalarpan4 (previous revision, new revision, compare).

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

change size of vector a to 1001

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

Your modified code that got accepted

You were using 0 based indexing at one place and 1 based indexing at another place

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

take your initial array 1001 when u iterate from 1 to n a space is left for 1000 to store or u can make your for loop like this for(int i=0 ; i<=1000 ; ++i)