直接贴代码了: #include <stdio.h>#include <stdlib.h>typedef unsigned long uint32;#define N (624) // length of state vector#define M (397)#define K (0x9908B0DFU)
注:梅森素数,数组表示的是2^n-1的n,指数。 #include <stdio.h>#include <math.h>const int maxn = 40;const int MOD = 1e9+7;typedef long long ll;int a[45] = {2,3,5,7,13,17,19,31,61,89,107,127,521,607,1279,2203,2281,3