제출 #955854

#제출 시각아이디문제언어결과실행 시간메모리
955854ASGA_RedSea콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; //int press(string s){cout<<"press : "<<s<<" : ";int r;cin>>r;return r;} string guess_sequence(int n){ string s,c = "ABXY"; int f = 0; for(int i = 0;i < 3;i++){ f = press(string(1,c[i])); if(f){s += c[i];c.erase(i,1);break;} } if(!f){s += c.back();c.pop_back();} for(int i = 1;i < n;i++){ f = 0; for(int j = 0;j < 2;j++){ if(press(s + string(1,c[j])) > s.size()){f = 1;s += c[j];break;} } if(!f){s += c.back();} } return s; } //int main(){int n;cin>>n;cout<<guess_sequence(n);return 0;}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:13: error: 'press' was not declared in this scope
   11 |         f = press(string(1,c[i]));
      |             ^~~~~
combo.cpp:19:16: error: 'press' was not declared in this scope
   19 |             if(press(s + string(1,c[j])) > s.size()){f = 1;s += c[j];break;}
      |                ^~~~~