# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
542648 | RaresFelix | Combo (IOI18_combo) | C++17 | 1 ms | 208 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "combo.h"
using namespace std;
#include <set>
std::string guess_sequence(int N) {
/*std::string p = "";
for (int i = 0; i < 4 * N; ++i) {
p += 'A';
}
int coins = press(p);
std::string S = "";
for (int i = 0; i < N; ++i) {
S += 'A';
}*/
string incep_char;
if(press("AB")) incep_char = press("A") ? "A" : "B";
else incep_char = press("X") ? "X" : "Y";
string cguess = incep_char;
set<string> Posib{"A", "B", "X", "Y"};
Posib.erase(incep_char);
string A, B, C;
A = *Posib.begin(); Posib.erase(A);
B = *Posib.begin(); Posib.erase(B);
C = *Posib.begin(); Posib.erase(C);
for(int i = 1; i < N - 1; ++i) {
int rasp = press(cguess + A + A + cguess + A + B + cguess + A + C + cguess + B);
if(rasp == cguess.size() + 2) cguess += A;
else if(rasp == cguess.size() + 1) cguess += B;
else cguess += C;
}
if(press(cguess + A) == N) return cguess + A;
if(press(cguess + B) == N) return cguess + B;
return cguess + C;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |