Why is method B faster , I just swap the order of k and q in a nested for loop?
I've just found something interesting, and you know that I was just trying different order of loop itertation: I was coding like:(the whole code context was just too long and you can ignore the part of not so important directly) #include <iostream> #include <algorithm> #include <chrono> #include <cstdio> #include <vector> #include <map> const int MAXM = 1e6 + 6; using Clock = std::chrono::steady_clock; static double elapsedUs (Clock::time_point a, Clock::time_point b) { return std::chrono::duration<double, std::micro>(b - a).count(); } int nxt[MAXM]; //int mapping[MAXM]; //int bases[MAXM]; //i
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.