# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
597253 | ThegeekKnight16 | Nicelines (RMI20_nicelines) | C++17 | 1 ms | 336 KiB |
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;
typedef long double dd;
void solve(int subtask_id, int N)
{
if (N == 1)
{
dd D = query(0.0, 0.0);
int a, b;
if (D == 0.0)
{
b = 0.0;
int ini = -1e4 - 10; int fim = 1e4 + 10;
while (ini < fim)
{
int m1 = ((fim - ini) / 3);
int m2 = 2*m1;
m1 += ini; m2 += ini;
if (fim - ini <= 2)
{
m1 = ini+1;
m2 = fim-1;
}
dd d1 = query((long double)1.0, (long double)m1);
dd d2 = query((long double)1.0, (long double)m2);
if (d1 == 0.0)
{
vector<int> respA, respB;
respA.push_back(m1); respB.push_back(b);
the_lines_are(respA, respB);
}
else if (d2 == 0.0)
{
vector<int> respA, respB;
respA.push_back(m2); respB.push_back(b);
the_lines_are(respA, respB);
}
if (d1 <= d2) fim = m2;
else if (d2 < d1) ini = m1;
}
vector<int> respA, respB;
respA.push_back(ini); respB.push_back(b);
the_lines_are(respA, respB);
}
else
{
vector<int> v;
v[-1] = 0;
}
}
else
{
return;
}
}
/*int main()
{
}*/
Compilation message (stderr)
# | 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... |