Submission #1085363

#TimeUsernameProblemLanguageResultExecution timeMemory
1085363minggaCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; #define ln "\n" #define dbg(x) cout << #x << " = " << x << ln #define mp make_pair #define pb push_back #define fi first #define se second #define inf 2e18 #define fast_cin() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define out(file) freopen(file, "w", stdout) #define in(file) freopen(file, "r", stdin) #define all(x) (x).begin(), (x).end() #define sz(x) ((int)(x).size()) #define int long long int MOD = 1e9 + 7; char d[4] = {'A', 'B', 'X', 'Y'}; string guess_sequence(int n) { string ans = ""; char fir; for(int i = 0; i < 4; i++) { string cur = "" + d[i]; if(press(cur) == 1) { ans += d[i]; fir = d[i]; break; } } vector<char> vec; for(int i = 0; i < 4; i++) { if(d[i] == fir) continue; vec.pb(d[i]); } for(int i = 1; i < n; i++) { int cur = press(ans + d[0] + ans + d[1]); if(cur == sz(ans)) { ans += d[2]; } else { int cur = press(ans + d[0]); if(cur == sz(ans)) ans += d[1]; else ans += d[0]; } } return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(long long int)':
combo.cpp:29:8: error: 'press' was not declared in this scope
   29 |     if(press(cur) == 1) {
      |        ^~~~~
combo.cpp:41:17: error: 'press' was not declared in this scope
   41 |       int cur = press(ans + d[0] + ans + d[1]);
      |                 ^~~~~