Submission #530047

#TimeUsernameProblemLanguageResultExecution timeMemory
530047buidangnguyen05Cave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
/* input */ #include "cave.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 5e3; int n; vector<int> done, state, que; int query(int cnt) { for (int i = 0; i < n; ++i) { if (done[i]) que[i] = state[i]; else if (cnt) que[i] = 1; else que[i] = 0; if (!done[i] && cnt) --cnt; } return tryCombination(query); } void exploreCave(int _n) { n = _n; done.resize(n); state.resize(n); que.resize(n); int prev = query(0); for (int i = 0; i < n; ++i) { int L = 0, R = n - 1, pos = 0; while (L <= R) { int mid = (L + R) >> 1; int cur = query(mid); if ((prev == i && cur > i) || (prev != i && cur == i)) { pos = mid; R = mid - 1; } else L = mid + 1; } if (prev == i) state[pos] = 1; done[pos] = i; prev = query(0); } }

Compilation message (stderr)

cave.cpp: In function 'int query(int)':
cave.cpp:21:24: error: cannot convert 'int (*)(int)' to 'int*'
   21 |  return tryCombination(query);
      |                        ^~~~~
      |                        |
      |                        int (*)(int)
In file included from cave.cpp:5:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~