Submission #544625

#TimeUsernameProblemLanguageResultExecution timeMemory
544625LunaMemeCombo (IOI18_combo)C++14
0 / 100
0 ms208 KiB
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> ii; typedef vector<pair<int, int>> vii; typedef vector<int> vi; typedef long long ll; #define PB push_back #define MP make_pair #define FOR(i, x, y) for (ll i = x; i < y ; i ++) #include <combo.h> string guess_sequence(int n){ string s; string l[] = {"A", "B", "X", "Y"}; string start; vector<string> m; if (press("AB")){ if (press("A")){ start ="A"; } else start = "B"; } else if (press("X")) start = "X"; else start = "Y"; s = start; FOR(i, 0, 4){ if (l[i] != start){ m.PB(l[i]); } } FOR(i, 0, n - 2){ int guess = press(s + m[0] + s + m[1] + m[0] + s + m[1] + m[1] + s + m[1] + m[2]); if (guess == 0){ s += m[2]; } else if (guess == 1){ s += m[0]; } else { s += m[2]; } } if (press(s + "AB")){ if (press(s +"A")){ s += "A"; } else s += "B"; } else if (press(s + "X")) s +="X"; else s +="Y"; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...