제출 #90989

#제출 시각아이디문제언어결과실행 시간메모리
90989too_stupidCombo (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include "combo.h" using namespace std; string guess_sequence(int N) { string p = ""; string k = "XYZ"; if(press("A")) { p+="A"; for(int i = 1 ; i < 4 * n ; i++) { for(int j = 0 ; j < 3 ; ++j) { if(press(p + k[j]) == (int)p.size() + 1) { p+=k[j]; break; } } } } else if(press("B")) { p+="B"; for(int i = 1 ; i < 4 * n ; i++) { for(int j = 0 ; j < 3 ; ++j) { if(press(p + k[j]) == (int)p.size() + 1) { p+=k[j]; break; } } } } else if(press("X")) { p+="X"; for(int i = 1 ; i < 4 * n ; i++) { for(int j = 0 ; j < 3 ; ++j) { if(press(p + k[j]) == (int)p.size() + 1) { p+=k[j]; break; } } } } else { p+="Y"; for(int i = 1 ; i < 4 * n ; i++) { for(int j = 0 ; j < 3 ; ++j) { if(press(p + k[j]) == (int)p.size() + 1) { p+=k[j]; break; } } } } return S; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:28: error: 'n' was not declared in this scope
   10 |    for(int i = 1 ; i < 4 * n ; i++)
      |                            ^
combo.cpp:27:25: error: 'n' was not declared in this scope
   27 | for(int i = 1 ; i < 4 * n ; i++)
      |                         ^
combo.cpp:42:25: error: 'n' was not declared in this scope
   42 | for(int i = 1 ; i < 4 * n ; i++)
      |                         ^
combo.cpp:57:25: error: 'n' was not declared in this scope
   57 | for(int i = 1 ; i < 4 * n ; i++)
      |                         ^
combo.cpp:70:10: error: 'S' was not declared in this scope
   70 |   return S;
      |          ^