제출 #390294

#제출 시각아이디문제언어결과실행 시간메모리
390294Marceantasy콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array const int mxN = 2e5, M = 1e9+7; string guess_sequence(int N){ string sequence = ""; string chars = "ABXY"; if(press("AB")){ if(press("A")){ sequence+="A"; chars.erase(chars.find("A"), 1); }else{ sequence+="B"; chars.erase(chars.find("B"), 1); } }else{ if(press("X")){ sequence+="X"; chars.erase(chars.find("X"), 1); }else{ sequence+="Y"; chars.erase(chars.find("Y"), 1); } } int val = 1; for(int i = 1; i<N; ++i){ int points = press(sequence+chars[0]+sequence+chars[1]+chars[0]+sequence+chars[1]+chars[1]+sequence+chars[1]+chars[2]); if(points == i){ sequence+=chars[2]; }else if(points == i+1){ sequence+=chars[0]; }else{ sequence+=chars[1]; } val++; } if(press(sequence+chars[0]+sequence+chars[1]) == val+1){ if(press(sequence+chars[0])){ sequence+=chars[0]; }else{ sequence+=chars[1]; } }else{ sequence+=chars[2]; } return sequence; } int main(){ guess_sequence(N); }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:8: error: 'press' was not declared in this scope
   12 |     if(press("AB")){
      |        ^~~~~
combo.cpp:31:22: error: 'press' was not declared in this scope
   31 |         int points = press(sequence+chars[0]+sequence+chars[1]+chars[0]+sequence+chars[1]+chars[1]+sequence+chars[1]+chars[2]);
      |                      ^~~~~
combo.cpp:41:8: error: 'press' was not declared in this scope
   41 |     if(press(sequence+chars[0]+sequence+chars[1]) == val+1){
      |        ^~~~~
combo.cpp: In function 'int main()':
combo.cpp:54:20: error: 'N' was not declared in this scope
   54 |     guess_sequence(N);
      |                    ^