Submission #1085350

#TimeUsernameProblemLanguageResultExecution timeMemory
1085350minggaCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include "cave.h" #include "bits/stdc++.h" using namespace std; #define ln "\n" #define dbg(x) cout << #x << " = " << x << ln #define mp make_pair #define pb push_back #define fi first #define se second #define inf 2e18 #define fast_cin() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define out(file) freopen(file, "w", stdout) #define in(file) freopen(file, "r", stdin) #define all(x) (x).begin(), (x).end() #define sz(x) ((int)(x).size()) #define int long long int MOD = 1e9 + 7; void exploreCave(int n) { int comb[n], ans1[n], ans2[n]; vector<int> vis(n, 0); for(int i = 0; i < n; i++) { comb[i] = 0; } for(int i = 0; i < n; i++) { int s = tryCombination(comb); int col = (s > i or s == -1) ? 0 : 1; int l = 0, r = n - 1, res; while(l <= r) { int m = (l + r) >> 1; for(int i = l; i <= m; i++) { if(vis[i]) continue; comb[i] ^= 1; } int cur = tryCombination(comb); for(int i = l; i <= m; i++) { if(vis[i]) continue; comb[i] ^= 1; } if(cur < i and cur != -1) { l = m + 1; } else { res = m; r = m - 1; } } ans1[i] = col; ans2[res] = i; vis[res] = 1; } answer(ans1, ans2); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(long long int)':
cave.cpp:31:28: error: cannot convert 'long long int*' to 'int*'
   31 |     int s = tryCombination(comb);
      |                            ^~~~
      |                            |
      |                            long long int*
In file included from cave.cpp:1:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:40:32: error: cannot convert 'long long int*' to 'int*'
   40 |       int cur = tryCombination(comb);
      |                                ^~~~
      |                                |
      |                                long long int*
In file included from cave.cpp:1:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:56:10: error: cannot convert 'long long int*' to 'int*'
   56 |   answer(ans1, ans2);
      |          ^~~~
      |          |
      |          long long int*
In file included from cave.cpp:1:
cave.h:9:17: note:   initializing argument 1 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |             ~~~~^~~