Submission #943438

# Submission time Handle Problem Language Result Execution time Memory
943438 2024-03-11T13:14:40 Z abcvuitunggio Nicelines (RMI20_nicelines) C++17
0 / 100
1 ms 448 KB
#include "nice_lines.h"
#include <bits/stdc++.h>
#define ld long double
using namespace std;
const int x=1e5;
const ld eps=1e-9;
vector <int> a,b;
void add(int y){
    int B=(y%x+x)%x;
    if (B>10000)
        B-=x;
    int A=(y-B)/x;
    a.push_back(A);
    b.push_back(B);
}
bool dnc(ld l, ld r, ld lo, ld hi){
    ld mid=(l+r)/2,m=query(x,mid);
    if (abs((lo+hi)/2-m)<eps)
        return 0;
    if (r-l<1){
        add(floor(r));
        return 1;
    }
    dnc(l,mid,lo,m);
    dnc(mid,r,m,hi);
}
void solve(int subtask_id, int N){
    dnc(-2e9,2e9+1,query(x,-2e9),query(x,2e9+1));
    the_lines_are(a,b);
}

Compilation message

nicelines.cpp: In function 'bool dnc(long double, long double, long double, long double)':
nicelines.cpp:25:8: warning: control reaches end of non-void function [-Wreturn-type]
   25 |     dnc(mid,r,m,hi);
      |     ~~~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 448 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 444 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 440 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 440 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 448 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 440 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -