int n = 1e7; for (int i = 2; i <= n / i; ++i) if (!pri[i]) for (int j = i * i; j <= n; j += i) pri[j] = 1;
相关推荐