제출 #1333504

#제출 시각아이디문제언어결과실행 시간메모리
1333504mfmme23Nicelines (RMI20_nicelines)C++20
컴파일 에러
0 ms0 KiB
#include "nice_lines_h.h"
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;


long double get_slope(long double x, long double y) {
    const long double eps = 1e-4;
    return (query(x, y + eps) - query(x, y - eps)) / (2.0 * eps);
}

void find_points(long double x, long double y_min, long double y_max, 
                 long double slope_min, long double slope_max, vector<long double>& found_y) {

    if (abs(slope_max - slope_min) < 1e-9) return;


    if (y_max - y_min < 1e-1) {
        found_y.push_back((y_min + y_max) / 2.0);
        return;
    }

    long double mid = (y_min + y_max) / 2.0;
    long double slope_mid = get_slope(x, mid);
    
    find_points(x, y_min, mid, slope_min, slope_mid, found_y);
    find_points(x, mid, y_max, slope_mid, slope_max, found_y);
}

void solve(int subtask_id, int N) {
    long double X = 20000000;
    vector<long double> found_y;
    

    long double Y_LIMIT = 2e12; 
    find_points(X, -Y_LIMIT, Y_LIMIT, get_slope(X, -Y_LIMIT), get_slope(X, Y_LIMIT), found_y);

    vector<int> va, vb;
    for (auto y_val : found_y) {

        int a = round(y_val / X);
        int b = round(y_val - (long double)a * X);
        va.push_back(a);
        vb.push_back(b);
    }
    
    the_lines_are(va, vb); [cite: 36]
}

컴파일 시 표준 에러 (stderr) 메시지

nicelines.cpp:1:10: fatal error: nice_lines_h.h: No such file or directory
    1 | #include "nice_lines_h.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.