The problem is the first one in this pdf - http://icpc.amrita.ac.in/2013/wp-content/uploads/2013/12/ProblemsSets2013Asia-Amritapuri.pdf .
My code http://ideone.com/wfuME8 is a implementation of LRU using unordered_map and list.
But it is very slow. I can't even insert 10^6 elements in list in less than 3 secs.
What is the reason.
Judges at amritapuri suggested that this implementation should pass.