#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 |
1 |
Incorrect |
6 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |