Submission #555797

#TimeUsernameProblemLanguageResultExecution timeMemory
555797inventiontimeCombo (IOI18_combo)C++17
100 / 100
32 ms560 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define int ll #define endl '\n' //comment for interactive #define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define pb push_back #define re resize #define ff first #define ss second #define all(x) (x).begin(), (x).end() #define loop(i, n) for(int i = 0; i < n; i++) #define loop1(i, n) for(int i = 1; i <= n; i++) #define print(x) cout << #x << ": " << x << endl << flush typedef long long ll; typedef vector<int> vi; typedef array<int, 2> ii; typedef array<int, 3> ti; typedef vector<ii> vii; typedef vector <ti> vti; typedef priority_queue<int> pq; template<class T> bool ckmin(T&a, T b) { bool B = a > b; a = min(a, b); return B; } template<class T> bool ckmax(T&a, T b) { bool B = a < b; a = max(a, b); return B; } const int inf = 1e17; //const int maxn = ; string guess_sequence(signed N) { char init = ' '; if(press("AB") >= 1) { if(press("A") >= 1) init = 'A'; else init = 'B'; } else { if(press("X") >= 1) init = 'X'; else init = 'Y'; } if(N == 1) return {init}; char d[4] = {'A', 'B', 'X', 'Y'}; vector<char> c; loop(i, 4) if(d[i] != init) c.pb(d[i]); string res = {init}; loop1(i, N-2) { int x = press( res + c[0] + res + c[1] + c[0] + res + c[1] + c[1] + res + c[1] + c[2] ); if(x == i) res += c[2]; else if(x == i+1) res += c[0]; else res += c[1]; } if(press(res + c[0]) == N) res += c[0]; else if(press(res + c[1]) == N) res += c[1]; else res += c[2]; return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...