Submission #670625

#TimeUsernameProblemLanguageResultExecution timeMemory
670625gustavo_dCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int exploreCave(int n) { int confirmed[n]; int test[n]; int correspondence[n]; for (int i = 0; i < n; i++) test[i] = 0; ios_base::sync_with_stdio(false); cin.tie(NULL); for(int to_try = 0; to_try<n; to_try++) { int l = 0; int r = n; while (l != r) { int mid = (l+r) / 2; for (int i = l; i<r; i++) { if (confirmed[i] != -1) test[i] = confirmed[i]; else { if (i < mid) test[i] = 0; else test[i] = 1; } } int tried = tryCombination(test); if (to_try != tried) { r = mid; } else { l = mid + 1; } } confirmed[i] = l; correspondence[l] = i; } answer(confirmed, correspondence); return 0; }

Compilation message (stderr)

cave.cpp:5:5: error: ambiguating new declaration of 'int exploreCave(int)'
    5 | int exploreCave(int n) {
      |     ^~~~~~~~~~~
In file included from cave.cpp:1:
cave.h:10:6: note: old declaration 'void exploreCave(int)'
   10 | void exploreCave(int N);
      |      ^~~~~~~~~~~
cave.cpp: In function 'int exploreCave(int)':
cave.cpp:33:19: error: 'i' was not declared in this scope
   33 |         confirmed[i] = l;
      |                   ^