/**
____ ____ ____ ____ ____ ____
||l |||e |||i |||n |||a |||d ||
||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/__\|
**/
#include<bits/stdc++.h>
#define endl '\n'
#include "nice_lines.h"
using namespace std;
const int V = 1e4 + 10;
const long double eps = 1e-9;
struct point
{
long double x, y;
point(long double _x = 0, long double _y = 0)
{
x = _x;
y = _y;
}
};
struct line
{
point A, B;
long double k, m;
line(point _A, point _B)
{
A = _A;
B = _B;
k = (B.y - A.y) / (B.x - A.x);
/// k * A.x + m = A.y
m = A.y - A.x * k;
}
};
point intersection(line l1, line l2)
{
long double x = (l2.m - l1.m) / (l1.k - l2.k), y = l1.k * x + l1.m;
return point(x, y);
}
void solve(int subtask_id, int N)
{
point A1(3 * V * V, query(3 * V, 3 * V * V)), B1(3 * V * V + 1, query(3 * V, 3 * V * V + 1));
line l1(A1, B1);
point A2(- 3 * V * V, query(3 * V, - 3 * V * V)), B2(- 3 * V * V + 1, query(3 * V, - 3 * V * V + 1));
line l2(A2, B2);
point p = intersection(l1, l2);
vector < int > a, b;
int d = round(p.x);
for (int pa = -V; pa < V; pa ++)
{
int lf = d - pa * 3 * V;
if (lf > - V && lf < V)
{
a.push_back(pa);
b.push_back(lf);
break;
}
}
the_lines_are(a, b);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
304 KB |
Output is correct |
3 |
Correct |
0 ms |
208 KB |
Output is correct |
4 |
Correct |
1 ms |
300 KB |
Output is correct |
# |
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 |
1 ms |
208 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 |
1 ms |
208 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 |
- |