Submission #1201491

#TimeUsernameProblemLanguageResultExecution timeMemory
1201491uranhishigFinding Routers (IOI20_routers)C++20
Compilation error
0 ms0 KiB
#include "routers.h" #include <bits/stdc++.h> using namespace std; std::vector<int> find_routers(int l, int n, int q) { int ans = 0; vector<int> v={0}; for (int i = 0; i < l; i++) { if(idx == 1) { ans = i; v.push_back(ans*2 - 2); return v; } int L = 0; int R = n; while (L + 1 < R) { int M = (L + R)/2; int idx = use_detector(i); } } }

Compilation message (stderr)

routers.cpp: In function 'std::vector<int> find_routers(int, int, int)':
routers.cpp:9:12: error: 'idx' was not declared in this scope
    9 |         if(idx == 1) {
      |            ^~~
routers.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
   22 | }
      | ^