Submission #1092760

#TimeUsernameProblemLanguageResultExecution timeMemory
1092760TrinhKhanhDungCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define ll long long #define fi first #define se second #define sz(x) (int)x.size() #define ALL(v) v.begin(),v.end() #define MASK(k) (1LL << (k)) #define BIT(x, i) (((x) >> (i)) & 1) #define oo (ll)1e18 #define INF (ll)1e9 #define MOD (ll)(998244353) #include "combo.h> using namespace std; template<class T1, class T2> bool maximize(T1 &a, T2 b){if(a < b){a = b; return true;} return false;} template<class T1, class T2> bool minimize(T1 &a, T2 b){if(a > b){a = b; return true;} return false;} template<class T1, class T2> void add(T1 &a, T2 b){a += b; if(a >= MOD) a -= MOD;} template<class T1, class T2> void sub(T1 &a, T2 b){a -= b; if(a < 0) a += MOD;} template<class T> void cps(T &v){sort(ALL(v)); v.resize(unique(ALL(v)) - v.begin());} //int press(string p){ // cout << p << endl; // int n; cin >> n; // return n; //} string guess_sequence(int N){ const char buttons[] = {'A', 'B', 'X', 'Y'}; string cur = ""; int p = press("AB"); if(p){ if(press("A")) cur.push_back('A'); else cur.push_back('B'); } else{ if(press("X")) cur.push_back('X'); else cur.push_back('Y'); } vector<char> buttonsLeft; for(int i = 0; i < 4; i++) if(cur[0] != buttons[i]){ buttonsLeft.push_back(buttons[i]); } for(int i = 2; i <= N; i++){ for(int j = 0; j < 2; j++){ if(press(cur + buttonsLeft[j]) == i){ cur.push_back(buttonsLeft[j]); break; } } if((int)cur.size() < i) cur.push_back(buttonsLeft.back()); } return cur; } //int main(){ // ios_base::sync_with_stdio(0); cin.tie(0); //// freopen("durian.inp","r",stdin); //// freopen("durian.out","w",stdout); // // cout << guess_sequence(5); // // return 0; //}

Compilation message (stderr)

combo.cpp:12:10: warning: missing terminating " character
   12 | #include "combo.h>
      |          ^
combo.cpp:12:10: error: #include expects "FILENAME" or <FILENAME>
   12 | #include "combo.h>
      |          ^~~~~~~~~
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:41:13: error: 'press' was not declared in this scope
   41 |     int p = press("AB");
      |             ^~~~~