제출 #742226

#제출 시각아이디문제언어결과실행 시간메모리
742226Rafi22콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define st first #define nd second #define pb push_back #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() #define ll long long ll mod=1000000007; int inf=1000000007; ll infl=1000000000000000007; string guess_sequence(int n) { string ans=""; if(press("AB")) { if(press("A")) ans+='A'; else ans+='B'; } else { if(press("X")) ans+='X'; else ans+='Y'; } vector<char>V1={'A','B','X','Y'},V; for(auto x:V1) if(x!=ans[0]) V.pb(x); bool is=0; for(int i=2;i<=n;i++) { if(is) { if(press(ans+V[0])==i) ans+=V[0]; else ans+=V[1]; is=0; } else { int k=press(ans+V[0]+V[2]+ans+V[1]+V[2]); if(k<i) ans+=V[2]; else if(k==i) { if(press(ans+V[0])==i) ans+=V[0]; else ans+=V[1]; is=1; } else { if(press(ans+V[0])==i) ans+=V[0]; else ans+=V[1]; ans+=V[2]; i++; } } } return ans; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:19:8: error: 'press' was not declared in this scope
   19 |     if(press("AB"))
      |        ^~~~~
combo.cpp:36:16: error: 'press' was not declared in this scope
   36 |             if(press(ans+V[0])==i) ans+=V[0];
      |                ^~~~~
combo.cpp:42:19: error: 'press' was not declared in this scope
   42 |             int k=press(ans+V[0]+V[2]+ans+V[1]+V[2]);
      |                   ^~~~~