Submission #943438

#TimeUsernameProblemLanguageResultExecution timeMemory
943438abcvuitunggioNicelines (RMI20_nicelines)C++17
0 / 100
1 ms448 KiB
#include "nice_lines.h" #include <bits/stdc++.h> #define ld long double using namespace std; const int x=1e5; const ld eps=1e-9; vector <int> a,b; void add(int y){ int B=(y%x+x)%x; if (B>10000) B-=x; int A=(y-B)/x; a.push_back(A); b.push_back(B); } bool 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 0; if (r-l<1){ add(floor(r)); return 1; } dnc(l,mid,lo,m); dnc(mid,r,m,hi); } void solve(int subtask_id, int N){ dnc(-2e9,2e9+1,query(x,-2e9),query(x,2e9+1)); the_lines_are(a,b); }

Compilation message (stderr)

nicelines.cpp: In function 'bool dnc(long double, long double, long double, long double)':
nicelines.cpp:25:8: warning: control reaches end of non-void function [-Wreturn-type]
   25 |     dnc(mid,r,m,hi);
      |     ~~~^~~~~~~~~~~~
#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...