제출 #802414

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8024142023-08-02 12:11:37Gabi88콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
/*
int press(string a){
int x; cout << a << endl; cin >> x; return x;
}*/
string guess_sequence(int n){
string s;
vector<char> v;
int t = press("AB");
int pos = 2;
if (t > 0){
t = press("A");
if (t == 1){ s = "A"; v.push_back('B'); v.push_back('X'); v.push_back('Y');}
else{ s = "B"; v.push_back('A'); v.push_back('X'); v.push_back('Y'); }
}else{
t = press("X");
if (t == 1){ s = "X"; v.push_back('A'); v.push_back('B'); v.push_back('Y'); }
else{ s = "Y"; v.push_back('A'); v.push_back('B'); v.push_back('X'); }
}
while(pos < n){
t = press(s+v[0]+s+v[1]+v[0]+s+v[1]+v[1]+s+v[1]+v[2]);
if (t == pos-1) s += v[2];
else if (t == pos) s += v[0];
else s += v[1];
pos++;
}
for(int i=0; i<2; i++){
t = press(s+v[i]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:10: error: 'press' was not declared in this scope
   11 |  int t = press("AB");
      |          ^~~~~