제출 #1038609

#제출 시각아이디문제언어결과실행 시간메모리
1038609eysbutnoFinding Routers (IOI20_routers)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = array<int, 2>; #define all(x) begin(x), end(x) #define sz(x) (int) (x).size() int[] find_routers(int l, int n, int q) { int res[n]; res[0] = 0; for (int i = 1; i < n; i++) { int lo = res[i - 1] + 1, hi = l - 1; while (lo < hi) { int mi = (lo + hi + 1) / 2; use_detector(mi) == i - 1 ? lo = mi : hi = mi - 1; } res[i] = res[i - 1] + 2 * (lo - res[i - 1]); } return res; }

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

routers.cpp:8:4: error: structured binding declaration cannot have type 'int'
    8 | int[] find_routers(int l, int n, int q) {
      |    ^~
routers.cpp:8:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
routers.cpp:8:4: error: empty structured binding declaration
routers.cpp:8:7: error: expected initializer before 'find_routers'
    8 | int[] find_routers(int l, int n, int q) {
      |       ^~~~~~~~~~~~