제출 #197704

#제출 시각아이디문제언어결과실행 시간메모리
197704kshitij_sodani콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <iostream> #include <bits/stdc++.h> using namespace std; typedef long long int llo; #define mp make_pair #define pb push_back string guess_sequence(int n){ string s=""; int aa; aa=press(s+"A"); if(aa==1){ s+="A";} else{ aa=press(s+"B"); if(aa==1){ s+="B"; } else{ aa=press(s+"X"); if(aa==1){ s+="X"; } else{ s+="Y"; } } } string b="B"; string x="X"; string y="Y"; if(s=="B"){ b="A"; } else if(s=="X"){ x="A"; } else if(s=="Y"){ y="A"; } for(int co=1;co<n;co++){ aa=press(s+b+s+x+y+s+x+x+s+x+b); if(aa==co){ s+=y; } else if(aa==co+1){ s+=b; } else{ s+=x; } } aa=press(s+b); if(aa==n){ s+=b; } else{ aa=press(s+x); if(aa==n){ s+=x; } else{ s+=y; } } return s; } int main(){ return 0; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:5: error: 'press' was not declared in this scope
   11 |  aa=press(s+"A");
      |     ^~~~~