제출 #921470

#제출 시각아이디문제언어결과실행 시간메모리
921470Intellegent콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define debug(x) cout << #x << " = " << x << "\n"; #define vdebug(a) cout << #a << " = "; for(auto x: a) cout << x << " "; cout << "\n"; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); #define random(a, b) rng() % (b - a + 1) + a string guess_sequence(int n){ string alpha = "ABXY"; string cur = ""; for (char c : alpha){ for (int i = 0; i < n; i++) cur += c; if (press(cur) > 0) break; cur = ""; } string new_alpha = ""; for (char c : alpha) if (c != cur[0]) new_alpha += c; alpha = new_alpha; for (int i = 1; i < n; i++){ for (char c : alpha){ cur[i] = c; if (press(cur) > i) break; } } return cur; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:7: error: 'press' was not declared in this scope
   16 |   if (press(cur) > 0) break;
      |       ^~~~~
combo.cpp:27:8: error: 'press' was not declared in this scope
   27 |    if (press(cur) > i) break;
      |        ^~~~~