제출 #983591

#제출 시각아이디문제언어결과실행 시간메모리
983591SzymonKrzywda콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <iostream> #include <string> using namespace std; int call(string s); string guess_sequence(int N){ int k; char literka; string wynik,query; if (press("AB")){ if (press("A")){ literka = 'A'; } else{ literka = 'B'; } } else{ if (press("X")){ literka = 'X'; } else{ literka = 'Y'; } } wynik += literka; string li_1="",li_2="",li_3=""; for (auto i: "ABXY"){ if (i==literka) continue; if(li_1=="") li_1 = i; else if (li_2=="") li_2 = i; else li_3 = i; } for (int i=2; i<N; i++){ query = wynik+li_1+wynik+li_2+li_1+wynik+li_2+li_2+wynik+li_2+li_3; k = press(query); if (k-i == 1){ wynik += li_1; } else if(k-i == 2){ wynik += li_2; } else wynik += li_3; } if (N!=1){ if (press("AB")){ if (press("A")){ literka = 'A'; } else{ literka = 'B'; } } else{ if (press("X")){ literka = 'X'; } else{ literka = 'Y'; } } wynik += literka; } return wynik; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:9: error: 'press' was not declared in this scope
   10 |     if (press("AB")){
      |         ^~~~~
combo.cpp:39:13: error: 'press' was not declared in this scope
   39 |         k = press(query);
      |             ^~~~~
combo.cpp:50:13: error: 'press' was not declared in this scope
   50 |         if (press("AB")){
      |             ^~~~~