正文
增加 5 行删除 5 行
301 行未改动全部展开30230330430530630730830931031131231331410 行未改动32532632732832933033133233333433533684 行未改动301 行未改动全部展开std::uniform_int_distribution<ll> Rand(3, n-1);ll x =Rand(engine), y =x;ll c =Rand(engine);ll d =1;/*以下两种写法的期望复杂度都是正确的,但写法 1 的表现更好*//*----------写法 1----------*/x =getnext(x, c, n);y =getnext(y, c, n), y =getnext(y, c, n);for(int lim =1; x != y; lim =min(128, lim<<1)){/*提升约 0.1s */// for(int lim =1; x != y; lim =lim<<1){10 行未改动if(d != 1)return d;}return n;/*----------写法 2----------*//*这里还加了倍增 gcd 优化,可以作为参考*//*x =getnext(x, c, n);y =getnext(y, c, n), y =getnext(y, c, n);ll x2 =x, cnt =1;84 行未改动301 行未改动全部展开30230330430530630730830931031131231331410 行未改动32532632732832933033133233333433533684 行未改动301 行未改动全部展开std::uniform_int_distribution<ll> Rand(3, n-1);ll x =Rand(engine), y =x;ll c =Rand(engine);ll d =1;/*以下两种写法的期望复杂度都是正确的,但写法 1 的表现更好*//*----------写法 1----------*/x =getnext(x, c, n);y =getnext(y, c, n), y =getnext(y, c, n);for(int lim =1; x != y; lim =min(128, lim<<1)){/*提升约 0.1s */// for(int lim =1; x != y; lim =lim<<1){10 行未改动if(d != 1)return d;}return n;/*----------写法 2----------*//*这里还加了倍增 gcd 优化,可以作为参考*//*x =getnext(x, c, n);y =getnext(y, c, n), y =getnext(y, c, n);ll x2 =x, cnt =1;84 行未改动