Submission #1241475

#TimeUsernameProblemLanguageResultExecution timeMemory
1241475MateiKing80popa (BOI18_popa)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "popa.h" using namespace std; int solve(int n, int* left, int* right) { int rad = -1; stack<int> s; for (int i = 0; i < n; i ++) { left[i] = right[i] = -1; while (s.size() && query(i, i, s.top(), i)) { right[s.top()] = left[i]; left[i] = s.top(); s.pop(); } if (s.size()) right[s.top()] = i; else root = i; s.push(i); } return root; }

Compilation message (stderr)

popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:19:25: error: 'root' was not declared in this scope
   19 |                         root = i;
      |                         ^~~~
popa.cpp:22:16: error: 'root' was not declared in this scope
   22 |         return root;
      |                ^~~~