update ucpc2026

This commit is contained in:
2026-07-11 09:38:32 +09:00
parent 7176febe54
commit 0b8c2864ae
20 changed files with 329 additions and 163 deletions
+8 -10
View File
@@ -1,16 +1,14 @@
random_device rd; mt19937 rng(rd());
ll primary_root(ll p) {
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<ll> distrib(1, p-1);
//distrib(gen);
uniform_int_distribution<ll> dist(1, p-1);
auto gen = bind(dist, rng);
vl g = po_rho(p-1);
while(true) {
ll c = distrib(gen);
bool ok = true; ll u = p-1;
ll b = 1;
ll c = gen(), u = p-1, b = 1;
bool ok = true;
for(auto i:g) {
if(i != b) u = p-1;
ll x = pow(c, u/i, p);