Submission #450394

#TimeUsernameProblemLanguageResultExecution timeMemory
450394MohamedAliSaidaneCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; #define pb push_back #define popb pop_back #define ff first #define ss second const int MOD = 1e9 + 7; const int MAX_N = 5004; bool visited[MAX_N]; void exploreCave(int n) { int comb[n]; memset(comb,0,sizeof(comb)); int first = tryCombination(comb); vi ass(n,0); vi state(n,0); int cnt = 0; while(cnt < n) { for(int i = 0; i < n ; i ++) { if(visited[i]) continue; comb[i] = 1 - comb[i]; int ess = tryCombination(comb); if(ess != -1 && ess < first) { comb[i] = 1 - comb[i]; ass[i] = ess; state[i] = comb[i]; visited[i] = true; cnt ++; } else if(ess > first) { ass[i] = first; state[i] = comb[i]; visited[i] = true; first = ess; cnt ++; } } } answer(state,ass); return ; }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:51:12: error: cannot convert 'vi' {aka 'std::vector<int>'} to 'int*'
   51 |     answer(state,ass);
      |            ^~~~~
      |            |
      |            vi {aka std::vector<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[]);
      |             ~~~~^~~