[HELP] QTREE6 SPOJ getting TLE !!

Revision en1, by Libraion, 2020-03-08 11:28:51

Recently, I have tried doing QTREE6 on SPOJ.

I read and did the exactly same algorithm (with nearly same code) here and still got TLE.

This is my TLE submission.

The weird thing is his code just ran about 0.19 s, while mine getting over 1 s (even the code seems to be so similar). I have tried many ways like : switching scanf / cin, add some pragma lines, eliminate recursion of hld function ... but still it didn't work.

I really want to know the reasons so I can learn what really make my code so slow.

Thanks so much for reading <3.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Libraion 2020-03-08 11:28:51 728 Initial revision (published)