Submission #1245192

#TimeUsernameProblemLanguageResultExecution timeMemory
1245192PlayVoltzHack (APIO25_hack)C++20
0 / 100
50 ms1832 KiB
#include "hack.h" #include <bits/stdc++.h> using namespace std; const int BLK = 31622; #define int long long #define pii pair<int, int> #define mp make_pair #define pb push_back #define fi first #define se second signed hack(){ vector<int> a, b; for (int i=1; i<=BLK; ++i)a.pb(i); for (int i=500000000; i<=1000000000+BLK; i+=BLK)b.pb(i); while (a.size()>1||b.size()>1){ if (a.size()<b.size())swap(a, b); vector<int> l, r, temp; for (int i=0; i<a.size()/2; ++i)l.pb(a[i]), temp.pb(a[i]); for (int i=a.size()/2; i<a.size(); ++i)r.pb(a[i]); for (auto c:b)temp.pb(c); if (collisions(temp))a=l; else a=r; } int n=abs(a[0]-b[0]), v=n, c=2; vector<int> vect; while (c*c<=v){ if (!(v%c))v/=c, vect.pb(c); else ++c; } if (v!=1)vect.pb(v); for (auto c:vect)if (collisions({1, n/c+1}))n/=c; return n; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...