제출 #480317

#제출 시각아이디문제언어결과실행 시간메모리
480317omg콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; void loop(string R, int combo) { R.push_back('A'); if (press(R) > combo) return; R.pop_back(); R.push_back('B'); if (press(R) > combo) return; R.pop_back(); R.push_back('X'); if (press(R) > combo) return; R.pop_back(); R.push_back('Y'); if (press(R) > combo) return; R.pop_back(); } string guess_sequence(int N) { string R=""; int comboCur=0; string target="AXYZ"; for (int i=0;i<N;i++) { for (int j=0;j<4; j++) { R.push_back(target[j]); if (press(R) > comboCur) break; R.pop_back(); } comboCur++; } cout<<R; }

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

combo.cpp: In function 'void loop(std::string, int)':
combo.cpp:5:7: error: 'press' was not declared in this scope
    5 |   if (press(R) > combo) return;
      |       ^~~~~
combo.cpp:8:7: error: 'press' was not declared in this scope
    8 |   if (press(R) > combo) return;
      |       ^~~~~
combo.cpp:11:7: error: 'press' was not declared in this scope
   11 |   if (press(R) > combo) return;
      |       ^~~~~
combo.cpp:14:7: error: 'press' was not declared in this scope
   14 |   if (press(R) > combo) return;
      |       ^~~~~
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:24:11: error: 'press' was not declared in this scope
   24 |       if (press(R) > comboCur) break;
      |           ^~~~~
combo.cpp:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
   30 | }
      | ^