Submission #450392

#TimeUsernameProblemLanguageResultExecution timeMemory
450392MohamedAliSaidaneCave (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) { vi comb(n,0); int first = tryCombination(comb); vi ass(n,0); vi st(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:20:32: error: cannot convert 'vi' {aka 'std::vector<int>'} to 'int*'
   20 |     int first = tryCombination(comb);
      |                                ^~~~
      |                                |
      |                                vi {aka std::vector<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:31:38: error: cannot convert 'vi' {aka 'std::vector<int>'} to 'int*'
   31 |             int ess = tryCombination(comb);
      |                                      ^~~~
      |                                      |
      |                                      vi {aka std::vector<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:36:17: error: 'state' was not declared in this scope; did you mean '_xstate'?
   36 |                 state[i] = comb[i];
      |                 ^~~~~
      |                 _xstate
cave.cpp:43:17: error: 'state' was not declared in this scope; did you mean '_xstate'?
   43 |                 state[i] = comb[i];
      |                 ^~~~~
      |                 _xstate
cave.cpp:50:12: error: 'state' was not declared in this scope; did you mean '_xstate'?
   50 |     answer(state,ass);
      |            ^~~~~
      |            _xstate