Submission #206902

#TimeUsernameProblemLanguageResultExecution timeMemory
206902vardan__02Cave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <algorithm> #include <iostream> #include <fstream> #include <cstring> #include <string> #include <vector> #include <cstdio> #include <queue> #include <deque> #include <stack> #include <list> #include <set> #include <map> #include "cave.h" using namespace std; typedef long long ll; #define MP make_pair #define PB push_back void get_d(vector<int> S) { vector<int> d; for(int i=0;i<S.size();i++) { S[i]=(S[i]+1)%2; int x=tryCombination(S); d.PB(x); S[i]=(S[i]+1)%2; } answer(S,d); } void exploreCave(int N) { int n = N, x = 0, y = 0; vector<int> s; for(int i=0;i<n;i++) s.PB(0); int i=0; while(i<=n-2) { x=tryCombination(s); if(x==-1) { get_d(s); return; } s[i+1]=(s[i+1]+1)%2; y=tryCombination(s); if(y==-1) { get_d(s); return; } if(x==y) s[i]=(s[i]+1)%2; i++; } x=tryCombination(s); if(x!=-1) s[n-1]=(s[n-1]+1)%2; get_d(s); return; }

Compilation message (stderr)

cave.cpp: In function 'void get_d(std::vector<int>)':
cave.cpp:22:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<S.size();i++)
                 ~^~~~~~~~~
cave.cpp:25:31: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
         int x=tryCombination(S);
                               ^
cave.cpp:29:15: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'void answer(int*, int*)'
     answer(S,d);
               ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:40:27: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
         x=tryCombination(s);
                           ^
cave.cpp:47:27: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
         y=tryCombination(s);
                           ^
cave.cpp:57:23: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
     x=tryCombination(s);
                       ^