Submission #775578

#TimeUsernameProblemLanguageResultExecution timeMemory
7755781binCombo (IOI18_combo)C++14
0 / 100
0 ms208 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; #define all(v) v.begin(), v.end() typedef long long ll; string str; int x; string guess_sequence(int n){ x = press("AB"); string S; if(x == 1){ x = press("A"); S = x ? "A" : "B"; } else{ x = press("X"); S = x ? "X" : "Y"; } for(char c : "ABXY") if(c && c != S[0]) str += c; for(int i = 1; i < n - 1; i++){ string s = S + str[0] + S + str[1] + str[0] + S + str[1] + str[1] + S + str[1] + str[2]; x = press(s); if(x == i) S += str[2]; else if(x == i + 1) S += str[0]; else str += str[1]; } x = press(S + str[0]); if(x == n) S += str[0]; else{ x = press(S + str[1]); if(x == n) S += str[1]; else S += str[2]; } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...