Can any one expline to me why my code takes 1620 ms to get the answer?

Revision en1, by DiaaEddin, 2017-07-17 16:29:25

I solved Mister B and PR Shifts using trie ... Time complexity of my code is O(n * log(n)) where maximum n = 1000000 ... but it takes about 1620 ms at least to get the answer, so can anyone please tell me why? this is my first submission: http://mirror.codeforces.com/contest/819/submission/28102807 and this is the best code I came up with: http://mirror.codeforces.com/contest/819/submission/28110510 sorry for my bad English. thanks.

Tags trie

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English DiaaEddin 2017-07-17 21:47:04 385
en1 English DiaaEddin 2017-07-17 16:29:25 663 Initial revision (published)