Submission #743172

#TimeUsernameProblemLanguageResultExecution timeMemory
743172salmonNicelines (RMI20_nicelines)C++14
0 / 100
12 ms208 KiB
#include <bits/stdc++.h> using namespace std; #include "nice_lines.h" void solve(int subtask_id, int N) { if(subtask_id != 1){ the_lines_are({1}, {0}); return; } long double epsilon = 0.001; long double topgrad = (query(0,100000000000) - query(0,100000000000 - 1)); long double s = -1000000000000; long double e = 999999999999; for(int i = 0; i < 200; i++){ long double m1 = (s + e)/2; long double m2 = (s + e)/2 + 1; if(!(abs((query(0,m1) - query(0,m2)) - topgrad) < epsilon)){ s = m1; } else{ e = m2; } } long double xone = 0; long double yone = s; s = -1000000000000; e = 999999999999; for(int i = 0; i < 200; i++){ long double m1 = (s + e)/2; long double m2 = (s + e)/2 + 1; if(!(abs((query(1,m1) - query(1,m2)) - topgrad) < epsilon)){ s = m1; } else{ e = m2; } } int a = (int) round(s - yone); int b = (int) round(yone); the_lines_are({a}, {b}); }

Compilation message (stderr)

nicelines.cpp: In function 'void solve(int, int)':
nicelines.cpp:30:14: warning: unused variable 'xone' [-Wunused-variable]
   30 |  long double xone = 0;
      |              ^~~~
#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...