#include #include #include #include #include #include #include #include #include #include using namespace std; using namespace chrono; #define official #ifdef official #define cin inF #define cout outF #endif ifstream inF("equations.in"); ofstream outF("equations.out"); const int MAX_M=2000; const int MAX_N=1000; const int MAX_S=20; const long long MAX_X=1e6; const long long MAX_X1=1e6; const long long MAX_X_GEN=1e4; const int TRIES=2000; const double EPS=1e-6; const int EXACT_SCALE=0; int n,m,m2,s; struct Equation { long long a[MAX_N+100]; long long b[MAX_S+10]; long long aprox; long long exact; int num; void add (Equation& other, long long scalar) { for (int i=0; ib.aprox+b.exact; } int big_rand() { int r=rand()*RAND_MAX; return r+rand(); } Equation eqs[MAX_M]; long long xGCD(long long a, long long b, long long &x, long long &y) { long long lastx,lasty,temp,q; bool an=0,bn=0,sw=0; if (a<0) { a=-a; an=1; } if (b<0) { b=-b; bn=1; } if (a>m>>n; for (int i=0; i>eqs[i].a[j]; } cin>>eqs[i].exact; cin>>eqs[i].aprox; } cin>>s; for (int i=0; i>eqs[j].b[i]; } } } void output() { cout<>(currT-startT).count()<4); ++p1) { a1=eq.a[p1]; if (a1==0) continue; gcd=a1; xh=1; for (int i=0; iMAX_X || x<-MAX_X) break; for (int j=0; jmaxSol.score) maxSol=curr; //cerr<MAX_X || x<-MAX_X || y>MAX_X || y<-MAX_X) break; for (int j=0; jmaxSol.score) maxSol=curr; //cerr<MAX_X || x<-MAX_X || y>MAX_X || y<-MAX_X) break; for (int j=0; jmaxSol.score) maxSol=curr; //cerr<>(currT-start2T).count(); } currT=high_resolution_clock::now(); } } void smart_solve() { sort(eqs,eqs+m,cmp); maxSol.score=0; succ=0; for (int i=0; i>(currT-startT).count()<