Submission #943125

# Submission time Handle Problem Language Result Execution time Memory
943125 2024-03-11T08:34:46 Z Tuanlinh123 Nicelines (RMI20_nicelines) C++17
0 / 100
26 ms 688 KB
#include "nice_lines.h"
#include<bits/stdc++.h>
#define ll int
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ld long double
#define sz(a) ((ll)(a).size())
using namespace std;

const ld eps=1e-6;
void solve(ll subtask_id, ll n) 
{
    ll V=1e4, X=V*2+1;
    auto calc=[&](ld y){return query(X, y);};
    vector <ll> va, vb;
    function<void(ld, ld, ld, ld)> DnC=[&](ld l, ld r, ld fl, ld fr)
    {
        ld mid=(l+r)/2, fm=calc(mid);
        if (abs((fl+fr)/2-fm)<eps) return;
        if ((r-l)<1.0)
        {
            long double c=(calc(r+0.1)-fr-fl+calc(l-0.1))/2;
            long double d=sqrtl(max<long double>(0.0, 0.1*0.1-c*c));
            int a=round(d/c);
            if (mid<-eps) a=-a;
            int b=round(mid-(3e4)*a);
            va.push_back(a);
            vb.push_back(b);
            return;
        }
        DnC(l, mid, fl, fm), DnC(mid, r, fm, fr);
        return;
    };
    ld l=-V*X-V, r=V*X+V;
    DnC(l, r, calc(l), calc(r));
    the_lines_are(va, vb);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 688 KB Output is correct
2 Incorrect 1 ms 452 KB Incorrect
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 448 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 444 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 452 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 432 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 452 KB Incorrect
2 Halted 0 ms 0 KB -