3 times faster MT19937 in GCC

Revision en1, by oToToT, 2022-10-28 22:11:56

TL; DR: #include <ext/random> and use __gnu_cxx::sfmt19937 just as std::mt19937.

Hi all,

I'm here to share a thing that seems not that well-known in the whole community.

I test the two codes below in the Codeforces' custom test with input 1000000000

sfmt19937
mt19937

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English oToToT 2022-10-28 22:33:41 0 (published)
en2 English oToToT 2022-10-28 22:33:02 724
en1 English oToToT 2022-10-28 22:11:56 1050 Initial revision (saved to drafts)