punk_hazard's blog

By punk_hazard, history, 2 weeks ago, In English

I've been trying to find problem in my code but am not able to and everytime i get wrong answer at test case 7.

now i'm stuck. I don't know what i'm doing wrong please look at my submission.276320513 ignore the function findCharL and findCharR.

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

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

//#define int long long to prevent the overflow

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thankyou so much

    now i feel kind of pathetic

    i made sum variable as a long long but forgot to make my vector as long long

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

AC

I think problem was just in prefix sum array. I changed it to long long and fixed the indexing it worked.

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

vi is vector, causing overflows while you compute the prefix sum