Submission #647929

#TimeUsernameProblemLanguageResultExecution timeMemory
647929JANCARAPANCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int dx[4]{1,0,-1,0}, dy[4]{0,1,0,-1}; void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __print(long long x) {cerr << x;} void __print(unsigned x) {cerr << x;} void __print(unsigned long x) {cerr << x;} void __print(unsigned long long x) {cerr << x;} void __print(float x) {cerr << x;} void __print(double x) {cerr << x;} void __print(long double x) {cerr << x;} void __print(char x) {cerr << '\'' << x << '\'';} void __print(const char *x) {cerr << '\"' << x << '\"';} void __print(const string &x) {cerr << '\"' << x << '\"';} void __print(bool x) {cerr << (x ? "true" : "false");} template<typename T, typename V> void __print(const pair<T, V> &x); template<typename T> void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? ", " : ""), __print(i); cerr << "}";} template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ", "; __print(x.second); cerr << '}';} void _print() {cerr << "]\n";} template <typename T, typename... V> void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);} #ifdef DEBUG #define dbg(x...) cerr <<__func__<<":"<<" [" << #x << "] = ["; _print(x); /*cerr << "\e[39m" << endl;*/ #else #define dbg(x...) #endif #define ll long long #define ld long double; //#define int long long #define lwb(a, x) ( lower_bound((a).begin(), (a).end(), (x)) - (a).begin()) #define upb(a, x) ( upper_bound((a).begin(), (a).end(), (x)) - (a).begin()) #define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());} #define F first #define S second #define vi vector<ll> #define vvi vector<vi> #define vvvi vector<vvi> #define pb push_back #define ii pair<ll,ll> #define vpi vector<ii> #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(), (a).rend() #define endl '\n' #define sz(x) (ll)size(x) #define rs resize const ll N = 2e5+5, INF = 1e18, MOD = 1e9+7; string ch = "ABXY"; string guess_sequence(int n) { string s = ""; int block = -1; if (press("A") == 1) block = 0; else if (press("B") == 1) block = 1; else if (press("X") == 1) block = 2; else block = 3; s += ch[block]; for (int i=1; i<n-1; i++) { for (int j=0; j<4 && sz(s) < n; j++) { if (block == j) continue; if (press(s+ch[j]) > i) { s += ch[j]; break; } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:72:9: error: 'press' was not declared in this scope
   72 |     if (press("A") == 1) block = 0;
      |         ^~~~~
combo.cpp:82:17: error: 'press' was not declared in this scope
   82 |             if (press(s+ch[j]) > i) {
      |                 ^~~~~