Submission #368205

#TimeUsernameProblemLanguageResultExecution timeMemory
368205OzyCombo (IOI18_combo)C++17
0 / 100
1 ms200 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for (int i = (a); i <= (b); i++) #define lli long long int #define debug(a) cout << #a << " = " << a << endl string res,p; lli a; vector<char> arr; void llena(lli tam) { rep(i,0,tam-1) p += res[i]; p += arr[0]; p += arr[0]; rep(i,0,tam-1) p += res[i]; p += arr[0]; p += arr[1]; rep(i,0,tam-1) p += res[i]; p += arr[0]; p += arr[2]; rep(i,0,tam-1) p += res[i]; p += arr[1]; } string guess_sequence(int N) { a = press("AB"); if (a > 0){ a = press("A"); if (a == 1) res = "A"; else res = "B"; } else { a = press("X"); if (a == 1) res = "X"; else res = "Y"; } if (res != "A") arr.push_back('A'); if (res != "B") arr.push_back('B'); if (res != "X") arr.push_back('X'); if (res != "Y") arr.push_back('Y'); rep(i,2,N-1) { p = ""; llena(i-1); a = press(p); if (a > i) res += arr[0]; else if (a == i) res += arr[1]; else res += arr[2]; } p = res; p += arr[0]; a = press(p); if (a == N) { res += arr[0]; return res; } else { p = res; p += arr[1]; if (a == N) { res += arr[1]; return res; } else { res += arr[2]; return res; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...