제출 #1007176

#제출 시각아이디문제언어결과실행 시간메모리
1007176GTA콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> // #include "combo.h" using namespace std; #define fr(m,n,k) for(int m=n;m<=k;m++) #define sz size() #define all(v) v.begin(), v.end() int n; string guess_sequence(int N) { n = N; string v = "ABXY"; string p, s; int a; p = "AB"; int x = press(p); if (x >= 1) { p = "A"; int x = press(p); if (x == 1) a = 0; else a = 1; } else { p = "X"; int x = press(p); if (x == 1) a = 2; else a = 3; } s = v[a]; vector<int> rem = {0, 1, 2, 3}; rem.erase(find(all(rem), a)); fr(i, 2, n - 2) { p = ""; for (auto z : rem) p += s, p += rem[0], p += z; p += s, p += rem[1], p += v[a]; int x = press(p); if (x == i) { a = rem[2]; } else if (x == i + 1) { a = rem[1]; } else { a = rem[0]; } s += v[a]; } p = "AB"; x = press(p); if (x >= 1) { p = "A"; int x = press(p); if (x == 1) a = 0; else a = 1; } else { p = "X"; int x = press(p); if (x == 1) a = 2; else a = 3; } s = v[a]; return p; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:13:13: error: 'press' was not declared in this scope
   13 |     int x = press(p);
      |             ^~~~~