Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

AbhishekAg's blog

By AbhishekAg, history, 6 years ago, In English

Getting TLE on test case 8 for this problem. I read the editorial which had O(n) complexity. My soln has a complexity of O(n *log n) but as n has an upper bound of 2e5 it should pass right (if it is correct)?

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

»
6 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

The link isn't working

»
6 years ago, hide # |
 
Vote: I like it +26 Vote: I do not like it

This "cur=cur+t[nc];" works for O(|cur|) Change it to "cur+=t[nc];".

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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