Unordered_map/map performance degradation on CF?

Revision en1, by yoshi_avx, 2026-05-22 13:07:40

It's that when I looked at this code: https://mirror.codeforces.com/contest/2231/submission/375517331.

I tried to maximize the run-time on this code on my PC, but it took at most 800ms, even if I generated very similar tests as test 20 for example. (I'm trying to maximizing mp's size, which is over $$$2.3\times 10^6$$$ in my tests, while test 20 is only $$$2.2\times 10^6$$$. I've also considered umap killer tests, and they peaked at about 1.5s on my system.)

This is probably a compiler/OS difference on Codeforces.

I'm using a 3.6 GHz Core i7-10750H (the extra L3 cache doesn't have much effect) and GCC 16.1.1 on Linux... Codeforces is using the same 3.6 GHz Skylake core with less L3 cache. Could anyone reproduce this?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English yoshi_avx 2026-05-22 13:08:41 4 Tiny change: 'to maximizing `mp`'s si' -> 'to maximize `mp`'s si'
en1 English yoshi_avx 2026-05-22 13:07:40 770 Initial revision (published)