Submission #1333516

#TimeUsernameProblemLanguageResultExecution timeMemory
1333516mfmme23Nicelines (RMI20_nicelines)C++20
Compilation error
0 ms0 KiB
#include "nice_lines.h"
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;
ц
struct Line {
    int a, b;
};



void find_lines(long double x, long double y_low, long double y_high, 
                long double f_low, long double f_high, vector<long double>& intersections) {

    long double y_mid = (y_low + y_high) / 2.0;
    long double f_mid = query(x, y_mid);

    if (abs(f_mid - (f_low + f_high) / 2.0) < 1e-9) {
        return;
    }

 
    if (y_high - y_low < 0.5) {
        intersections.push_back(round(y_mid));
        return;
    }

    find_lines(x, y_low, y_mid, f_low, f_mid, intersections);
    find_lines(x, y_mid, y_high, f_mid, f_high, intersections);
}

void solve(int subtask_id, int N) {

    long double constant_x = 20001; 

    long double y_min = -210000000.0;
    long double y_max = 210000000.0;
    
    vector<long double> intercepts;
    find_lines(constant_x, y_min, y_max, query(constant_x, y_min), query(constant_x, y_max), intercepts);
    
    vector<int> va, vb;
    for (long double y_val : intercepts) {

        int a = round(y_val / constant_x);
        int b = round(y_val - (long double)a * constant_x);
        va.push_back(a);
        vb.push_back(b);
    }

    the_lines_are(va, vb);
}

Compilation message (stderr)

nicelines.cpp:7:1: error: '\U00000446' does not name a type
    7 | ц
      | ^