제출 #769273

#제출 시각아이디문제언어결과실행 시간메모리
769273Mery2005콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #include <algorithm> #include <queue> #include <cmath> #include <vector> #include <list> #include <string> #include <unordered_map> #include <map> #include <set> #include <stack> #include <string> #include <iomanip> #include <fstream> using namespace std; void fastio() { ios_base::sync_with_stdio(false); cin.tie(0); } const long long mod = 1e9+7; const int N = 3e6+5; int a[N] , dp[N]; string guess_sequence(int N){ string t; char x[4]; if(press("A")){ t = "A"; x[0] = 'B'; x[1] = 'X'; x[2] = 'Y'; } if(press("B")){ t = "B"; x[0] = 'A'; x[1] = 'X'; x[2] = 'Y'; } if(press("X")){ t = "X"; x[0] = 'B'; x[1] = 'A'; x[2] = 'Y'; } if(press("Y")){ t = "Y"; x[0] = 'B'; x[1] = 'X'; x[2] = 'A'; } string s = t; int num = 1; for(int i = 2 ; i <= N ; i++){ for(int j = 0 ; j < 3 ; j++){ string temp = s; temp += x[j]; if(press(temp) > num){ num++; s = temp; break; } } } return s; } // int main() { // return 0; // }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:30:6: error: 'press' was not declared in this scope
   30 |   if(press("A")){
      |      ^~~~~
combo.cpp:36:6: error: 'press' was not declared in this scope
   36 |   if(press("B")){
      |      ^~~~~
combo.cpp:42:6: error: 'press' was not declared in this scope
   42 |   if(press("X")){
      |      ^~~~~
combo.cpp:48:6: error: 'press' was not declared in this scope
   48 |   if(press("Y")){
      |      ^~~~~
combo.cpp:60:10: error: 'press' was not declared in this scope
   60 |       if(press(temp) > num){
      |          ^~~~~