dhritishman22's blog

By dhritishman22, history, 3 days ago, In English

Submission: 93000577 Problem: 1042C - Array Product Can someone help me out? This works fine on the sample cases but shows tle on test case 6.

Edit: TLE was due to vector erase function. It works fine when set is used instead of vector.

 
 
 
 
  • Vote: I like it
  • +1
  • Vote: I do not like it

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

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

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

It worked fine when I used set instead of vector. TLE was due to vector erase function.

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

    Good, you corrected on your own ... yes its simple observation when you are erasing every time the last or first element or even erasing in increasing decreasing manner you should not be using vectors.