#include <bits/stdc++.h>
using namespace std;
#include "nice_lines.h"
#define maxn 10000
#define EPS 1e-6
typedef long double ld;
#define dist(a,b,x,y) (ld)abs(y-a*x-b)/pow(1+a*a,0.5)
void solve(int subtask_id,int N){
ld x1=query(1,20000),x2=query(1,20001);
ld inv=1/(x2-x1);
int a=(int)(pow(inv*inv-1,0.5)+EPS);
int b=(int)(20001-x2*pow(a*a+1,0.5)-a+EPS);
if(abs(dist(a,b,1,20001)-x2)>EPS){
a=-a;
b=(int)(20001-x2*pow(a*a+1,0.5)-a+EPS);
}
the_lines_are({a},{b});
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Incorrect |
0 ms |
208 KB |
Incorrect |
4 |
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 |
296 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
296 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |