3

Getting TLE despite of O(n) time complexity

 2 years ago
source link: http://codeforces.com/blog/entry/96951
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Today there was Google's Kickstart round H and I have a doubt in the question 3 of it, here's that link to the problem , I have solved this using a doubly linked list data structure for efficient replacements and anyone can easily analyze that over all time time complexity is O(n) , here's is the link to my code.Can someone please tell the reason for the TLE over large inputs..


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK