제출 #206461

#제출 시각아이디문제언어결과실행 시간메모리
206461vardan__02콤보 (IOI18_combo)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> using namespace std; typedef long long ll; const long long N = 200005; const long long inf = 1e18; #define MP make_pair #define PB push_back string guess_sequence(int N) { string ans=""; string ban="ABXY"; int v=0, x; x = press('A') if(x==1) v=0; x = press('B') if(x==1) v=1; x = press('X') if(x==1) v=2; x = press('Y') if(x==1) v=3; ans=ban[v]; while(ans.size()!=n) { for(int i=0;i<=3;i++) { x = press(ans+ban[i]); if(x==ans.size()+1) { ans+=ban[i]; break; } } } return ans; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:25:9: error: 'press' was not declared in this scope
   25 |     x = press('A')
      |         ^~~~~
combo.cpp:38:23: error: 'n' was not declared in this scope
   38 |     while(ans.size()!=n)
      |                       ^
combo.cpp:43:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |             if(x==ans.size()+1)
      |                ~^~~~~~~~~~~~~~