제출 #1085937

#제출 시각아이디문제언어결과실행 시간메모리
1085937kiethm07콤보 (IOI18_combo)C++11
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define pii pair<int,int> #define iii pair<int,pii> #define fi first #define se second #define vi vector<int> #define all(x) x.begin(),x.end() #define TEXT "a" using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; const int inf = 1e9 + 7; const ld eps = 1e-8; const double pi = acos(-1); char ch[4] = {'A','B','X','Y'}; string guess_sequence(int n){ string s = ""; int f = -1; int g = press(s + ch[0] + ch[1]); if (g == 0){ g = press(s + ch[2]); if (g == 0) f = 3; else f = 2; } else{ g = press(s + ch[0]); if (g == 0) f = 1; else f = 0; } s += ch[f]; vector<int> a; for (int i = 0; i < 4; i++){ if (i == f) continue; a.push_back(i); } string g1,g2,g3; g1 = g2 = g3 = ""; g1 += ch[a[1]] + ch[a[0]]; g2 += ch[a[1]] + ch[a[1]]; g3 += ch[a[1]] + ch[a[2]]; for (int i = 2; i < n; i++){ int g = press(s + ch[a[0]] + s + g1 + s + g2 + s + g3); if (g == 0) s += ch[a[2]]; if (g == 1) s += ch[a[0]]; if (g == 2) s += ch[a[1]]; } g = press(s + ch[a[0]]); if (g == 0){ g = press(s + ch[a[1]]); if (g == 0) s += ch[a[2]]; else s += ch[a[1]]; } else s += ch[a[0]]; return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:28:13: error: 'press' was not declared in this scope
   28 |     int g = press(s + ch[0] + ch[1]);
      |             ^~~~~