Submission #552293

#TimeUsernameProblemLanguageResultExecution timeMemory
552293qadeptraiCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define oo 10000000000007 #define sci(x) scanf("%d", &x) #define scii(x, y) scanf("%d %d", &x, &y) #define pri(x) printf("%d ", x) #define pril(x) printf("%d\n", x) #define ii pair<int, int> #define ff first #define ss second #define vi vector<int> #define vii vector<ii> #define pb push_back #define mp make_pair #define ll long long #define fto(i, a, b) for (int i = a; i <= b; ++i) #define fdto(i, a, b) for (int i = a; i >= b; --i) #define maxN 100005 using namespace std; int n, m; char a[] = {'A', 'B', 'X', 'Y'}; //int press(string s) { // int x; // cout << s << endl; // cin >> x; // return x; //} string guess_sequence(int n) { string s = " "; fto(i, 0, 3) { s[0] = a[i]; // cout << s << endl; if(press(s) == 1) break; } char first = s[0]; fto(i, 1, n-1) { s = s + ' '; fto(j, 0, 3) { if(a[j] == first) continue; s[i] = a[j]; int coin = press(s); if(coin == i+1) { break; } } } return s; } //int main() { // cin >> n; // cout << guess_sequence(n); // // //}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:36:12: error: 'press' was not declared in this scope
   36 |         if(press(s) == 1) break;
      |            ^~~~~
combo.cpp:44:24: error: 'press' was not declared in this scope
   44 |             int coin = press(s);
      |                        ^~~~~