Submission #1251899

#TimeUsernameProblemLanguageResultExecution timeMemory
1251899kolpo0210Finding Routers (IOI20_routers)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int use_detector(int); int[] find_routers(int l, int n, int q) { vector<int> pos(n); pos[0] = 0; for (int i = 1; i < n; ++i) { int lo = pos[i-1] + 2, hi = l, mid, res = l; while (lo <= hi) { mid = ((lo + hi) / 2) / 2 * 2; int label = use_detector(mid); if (label >= i + 1) { res = mid; hi = mid - 2; } else { lo = mid + 2; } } pos[i] = 2 * res - pos[i - 1]; } return pos; }

Compilation message (stderr)

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