Submission #305190

#TimeUsernameProblemLanguageResultExecution timeMemory
305190TemmieCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" void exploreCave(int n) { std::vector <int> a(n), b(n), ans(n), vis(n, 0); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) if (!vis[j]) a[j] = 0; int cur = tryCombination(a); int now = cur == -1 || cur > i ? 0 : 1; int l = 0, r = n - 1; while (l <= r) { int mid = (l + r) >> 1; for (int j = 0; j < n; j++) if (!vis[j]) a[j] = j <= mid ? now : 1 - now; int comp = tryCombination(a); if (comp == -1 || comp > i) b[i] = mid, r = mid - 1; else l = mid + 1; } a[b[i]] = now; vis[b[i]] = 69; ans[b[i]] = i; } answer(a, ans); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:8:28: error: cannot convert 'std::vector<int>' to 'int*'
    8 |   int cur = tryCombination(a);
      |                            ^
      |                            |
      |                            std::vector<int>
In file included from cave.cpp:2:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:14:30: error: cannot convert 'std::vector<int>' to 'int*'
   14 |    int comp = tryCombination(a);
      |                              ^
      |                              |
      |                              std::vector<int>
In file included from cave.cpp:2:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:22:9: error: cannot convert 'std::vector<int>' to 'int*'
   22 |  answer(a, ans);
      |         ^
      |         |
      |         std::vector<int>
In file included from cave.cpp:2:
cave.h:9:17: note:   initializing argument 1 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |             ~~~~^~~