제출 #367798

#제출 시각아이디문제언어결과실행 시간메모리
367798mashrur_hossain콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; string guess_sequence(int n){ string s = ""; string a = "ABXY"; if(press("AB")){ if(press("A")){ a.erase(a.begin()); s+="A"; } else{ a.erase(a.begin()+1); s+="B"; } } else{ if(press("X")){ a.erase(a.begin()+2); s+='X'; } else{ s+="Y"; a.erase(a.begin()+3); } } // D(s); for(int i = 1;i<n-1;i++){ string guess = ""; for(int j = 0;j<4;j++){ guess+= s + a[0] + a[j]; } guess+=s+a[1]; int x = press(guess); if(x == i)s+=a[2]; else if(x==i+1)s+=a[1]; else if(x==i+2)s+=a[0]; } if(press(s+a[0]+s+a[1]) == n){ if(press(s+a[0]) == n){ s+= a[0]; }else{ s+=a[1]; } } else{ s+=a[2]; } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:5: error: 'press' was not declared in this scope
    8 |  if(press("AB")){
      |     ^~~~~
combo.cpp:35:11: error: 'press' was not declared in this scope
   35 |   int x = press(guess);
      |           ^~~~~
combo.cpp:41:5: error: 'press' was not declared in this scope
   41 |  if(press(s+a[0]+s+a[1]) == n){
      |     ^~~~~