Submission #943446

#TimeUsernameProblemLanguageResultExecution timeMemory
943446abcvuitunggioNicelines (RMI20_nicelines)C++17
83.99 / 100
44 ms856 KiB
#include "nice_lines.h" #include <bits/stdc++.h> #define ld long double #define int long long using namespace std; const int x=1e5; const ld eps=1e-9; vector <int32_t> a,b; void dnc(ld l, ld r, ld lo, ld hi){ ld mid=(l+r)/2,m=query(x,mid); if (abs((lo+hi)/2-m)<eps) return; if (r-l<1){ int y=floor(r); int B=(y%x+x)%x; if (B>10000) B-=x; int A=(y-B)/x; a.push_back(A); b.push_back(B); return; } dnc(l,mid,lo,m); dnc(mid,r,m,hi); } void solve(int32_t subtask_id, int32_t N){ dnc(-2e9,2e9+1e-6,query(x,-2e9),query(x,2e9+1e-6)); the_lines_are(a,b); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...