3

Crazy time difference between submissions with minimal changes

 6 months ago
source link: https://codeforces.com/blog/entry/126209
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

Crazy time difference between submissions with minimal changes

By wnmrmr, history, 10 hours ago,

Hi, if you compare this submission (296ms) with this one (3025ms), this is the difference:

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.

UPD: Calling the function build twice solves the problem


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK