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 ld;
typedef pair<ld, ld> pdd;
#define fi first
#define se second
#define mp make_pair
const ld BIG = (ld)1e4 + 3;
const int big = (int)1e4 + 3;
vector<int> aaa, bbb;
void fin(ld lohs, ld rasists, ld lk, ld rk){
if(lk < 0) lk = query(BIG, lohs);
if(rk < 0) rk = query(BIG, rasists);
if(rasists - lohs < 1.0){
int vista = ceil(lohs);
int B = vista % big;
int A = (vista - B) / big;
if(abs(A) > 1e4 || abs(B) > 1e4) return;
aaa.push_back(A);
bbb.push_back(B);
return;
}
ld mid = (lohs + rasists) * 0.5;
ld mk = query(BIG, mid);
if(abs((lk + rk) / 2.0 - mk) < 0.00001){
return;
}
fin(lohs, mid, lk, mk);
fin(mid, rasists, mk, rk);
}
void solve(int subtask_id, int N) {
/*
printf("subtask_id = %d, N = %d\n", subtask_id, N);
printf("query(0, 0) = %Lf\n", query(0, 0));
printf("query(1, 1) = %Lf\n", query(1, 1));
*/
ld lohs = -(BIG * BIG);
ld rasists = (BIG * BIG);
fin(lohs, rasists, -1.0, -1.0);
the_lines_are(aaa, bbb);
}
# | 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... |