제출 #1136863

#제출 시각아이디문제언어결과실행 시간메모리
1136863njoopCombo (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; string guess_sequence(int n) { char f, a, b, c; int val; string ans, t; val = press("AB"); if(val) { a = 'X'; b = 'Y'; val = press("A"); f = (val ? 'A' : 'B'); c = (!val ? 'A' : 'B'); } else { a = 'A'; b = 'B'; val = press("X"); f = (val ? 'X' : 'Y'); c = (!val ? 'X' : 'Y'); } ans.push_back(f); for(int i=2; i<n; i++) { t.clear(); t += ans + a + b; t += ans + a + c; t += ans + b; val = press(t); if(val == i+1) { ans.push_back(a); } else if(val == i) { ans.push_back(b); } else { ans.push_back(c); } } val = press(ans + a); if(val == n) return ans + a; val = press(ans + b); if(val == n) return ans + b; return ans + c; }

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

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