Crazy time difference between submissions with minimal changes
Difference between en5 and en6, changed 8 character(s)
Hi, if you compare [this submission (296ms)](https://mirror.codeforces.com/contest/1625/submission/247553687)↵
with [this one (3025ms)](https://mirror.codeforces.com/contest/1625/submission/247553671), this is the difference:↵

![ ](/predownloaded/f7/10/f710edf10feb3d3703b8216e7db32852c34aa728.png)↵

I think this is crazy because `g` is a `vector<vector<int>>` with size `3 * 10^5` with at most `3 * 10^5` entries, and the function `build` that returns `g` is called once in the program. ↵
This huge time difference is the same on both 64-bit C++ compilers, but it is not present in the 32-bit C++ compiler.↵

UDP: Calling the function `build` twice solves the problem↵

1. [Normal submission (3041ms)](https://mirror.codeforces.com/contest/1625/submission/247645824)↵

2. [Changed submission (327ms)](https://mirror.codeforces.com/contest/1625/submission/247645857)↵

![ ](/predownloaded/f9/98/f998c8e3c0435b23122b0744e82c240ee38f18ba.png)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en7 English wnmrmr 2024-02-21 20:21:26 2 Tiny change: 'iler.\n\nUDP: Calling ' -> 'iler.\n\nUPD: Calling '
en6 English wnmrmr 2024-02-21 20:19:37 8 Tiny change: '7645857)\n\n![ ](/pr' -> '7645857)\n![ ](/pr' (published)
en5 English wnmrmr 2024-02-21 20:17:42 317 (saved to drafts)
en4 English wnmrmr 2024-02-21 16:29:50 0 (published)
en3 English wnmrmr 2024-02-21 16:28:48 28 Tiny change: 'ers, but is not p' -> 'ers, but it is not p'
en2 English wnmrmr 2024-02-21 16:25:38 317 Tiny change: 'ze `3 * 10 ^ 5` with at' -> 'ze `3 * 10^5` with at'
en1 English wnmrmr 2024-02-21 16:18:40 322 Initial revision (saved to drafts)