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;
int BB(int y)
{
long double ini = -1e12, fim = 1e12;
if(query(ini, y) < query(fim, y))
while(ini < fim)
{
long double m = (ini + fim)/2.0;
if(query(ini, y) == 0.0) return ini;
if(query(m, y) < query(ini, y)) ini = m;
else fim = m;
}
else
while(ini < fim)
{
long double m = (ini + fim)/2.0;
if(query(fim, y) == 0.0) return fim;
if(query(m, y) < query(fim, y)) fim = m;
else ini = m;
}
return ini;
}
void solve(int subtask_id, int N) {
vector <int> a, b;
if(N == 1)
{
long double x_1 = BB(0);
long double x_2 = BB(1);
a.push_back(1/(x_2 - x_1));
b.push_back(-x_1/(x_2 - x_1));
}
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... |