yesbutno1685's blog

By yesbutno1685, history, 12 days ago, In English

I have a question on this question: https://codeforces.com/problemset/problem/1409/E

I am getting a TLE on test five (or when n hits its maximum value). My code gives the correct answer, given infinite amount of time, I just need help on figuring out why it TLEs.

From my knowledge, all I do is binary search and do a linear scan, so that's about nlgn time. However, when I submit it, it does not run in time, so I suspect that there is something that I am not catching. I've tried for a long time and still could not figure out why my code is TLE-ing.

I hope you guys can help me out

Thanks in advance!

code (in java): https://codeforces.com/contest/1409/submission/93014244

Code
 
 
 
 
  • Vote: I like it
  • +3
  • Vote: I do not like it

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

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

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

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