anmolsainiii23's blog

By anmolsainiii23, history, 11 months ago, In English

Hey I participated in the Recent Div3 Contest. I was getting TLE at the Test Case3. I was confused where I did wrong. Please can anyone clarify where i did wrong. Any help would be helpful. Thankyou.

Submission Link Problem Link

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

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

first of all try to use map also for a[i] = 0 take a variable with initial value as 'a' and increment it and add to ans if a[i]=0 and only check map for a[i] other than 0

  • »
    »
    11 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    How does that make a huge difference? Can you tell me why it was showing TLE at tc3. I appreciate your advice brother. But can you explain me why using map for a[i] = 0 can make a huge difference.

»
11 months ago, # |
Rev. 4   Vote: I like it +3 Vote: I do not like it