제출 #206905

#제출 시각아이디문제언어결과실행 시간메모리
206905vardan__02동굴 (IOI13_cave)C++14
컴파일 에러
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 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) { vector<int> d; for(int j=0;j<s.size();j++) { s[j]=(s[j]+1)%2; x=tryCombination(s); d.PB(x); s[j]=(s[j]+1)%2; } answer(s,d); return; } s[i+1]=(s[i+1]+1)%2; y=tryCombination(s); if(y==-1) { vector<int> d; for(int j=0;j<s.size();j++) { s[j]=(s[j]+1)%2; x=tryCombination(s); d.PB(x); s[j]=(s[j]+1)%2; } answer(s,d); 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; vector<int> d; for(int j=0;j<s.size();j++) { s[j]=(s[j]+1)%2; x=tryCombination(s); d.PB(x); s[j]=(s[j]+1)%2; } answer(s,d); return; }

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:28:27: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
         x=tryCombination(s);
                           ^
cave.cpp:32:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int j=0;j<s.size();j++)
                         ~^~~~~~~~~
cave.cpp:35:35: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
                 x=tryCombination(s);
                                   ^
cave.cpp:39:23: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'void answer(int*, int*)'
             answer(s,d);
                       ^
cave.cpp:43:27: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
         y=tryCombination(s);
                           ^
cave.cpp:47:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int j=0;j<s.size();j++)
                         ~^~~~~~~~~
cave.cpp:50:35: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
                 x=tryCombination(s);
                                   ^
cave.cpp:54:23: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'void answer(int*, int*)'
             answer(s,d);
                       ^
cave.cpp:61:23: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
     x=tryCombination(s);
                       ^
cave.cpp:65:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int j=0;j<s.size();j++)
                 ~^~~~~~~~~
cave.cpp:68:27: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'int tryCombination(int*)'
         x=tryCombination(s);
                           ^
cave.cpp:72:15: error: cannot convert 'std::vector<int>' to 'int*' for argument '1' to 'void answer(int*, int*)'
     answer(s,d);
               ^