### CandidateNextYear's blog

By CandidateNextYear, history, 3 months ago, ,

Hi everyone
I've just wrote this code 72243144 that has the complexity of O(n.log(n)) which is the same run time of the tutorial solution but I'm stuck with TLE! any help about what's going on? thanks in advance

• -15

 » 3 months ago, # |   +8 endl is very slow as it requires to flush the output. Try replacing endl by '\n'. If you have the good complexity this should work.
 » 3 months ago, # |   -8 Cin Cout streams are slower than scanf and printf unless optimized. Use Scanf printf or add this to your code. ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); Also endl flushes the output which is slow so replace all endl in your code with '\n'.
 » 2 months ago, # | ← Rev. 3 →   -22 [Wrong]
•  » » 2 months ago, # ^ |   +14 simple operations of std::pair are always $O(\log n)$ ????????
•  » » 2 months ago, # ^ |   0 sir Pls Explain this I was not under that impression Sir