This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "nice_lines.h"
using namespace std;
const int LIM = 1e4, inf = 1e9+7;
const long double EPS = 1e-9;
void solve(int subtask_id, int N){
int l = -LIM, r = LIM, b = -inf, a = -inf;
while (true){
if (r-l < 3){
for (int i = l; i <= r; i++)
if (query(0, i) <= EPS){
b = i;
break;
}
break;
}
int m1 = l+(r-l)/3, m2 = r-(r-l)/3;
if (query(0, m1) > query(0, m2)) l = m1; else r = m2;
}
l = -2*LIM, r = 2*LIM;
while (true){
if (r-l < 3){
for (int i = l; i <= r; i++)
if (query(1, i) <= EPS){
a = i-b;
break;
}
break;
}
int m1 = l+(r-l)/3, m2 = r-(r-l)/3;
if (query(1, m1) > query(1, m2)) l = m1; else r = m2;
}
the_lines_are({a}, {b});
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |