Unordered_map vs Policy Based Data Structure Issue

Правка en1, от dx24816, 2018-12-10 06:07:21

Hello,

Recently, I was doing Cow Run (http://www.usaco.org/index.php?page=viewproblem2&cpid=265), and I at first used the Policy Based Data Structure faster map (https://codeforces.com/blog/entry/60737), but I TLE'd on the last 4 test cases. I then switched back to using the unordered_map, and I passed all the test cases. Can anyone tell me the reason why the unordered_map was faster? I was under the impression that the PBDS map was faster. Thanks!

Code with unordered_map: https://ideone.com/Id7SZM Code using PBDS map: https://ideone.com/sA4UJG

To run this code, simply submit them in a file to the USACO website above, and use C++11.

-dx24816

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский dx24816 2018-12-10 06:07:21 712 Initial revision (published)