# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
728882 | Toxtaq | Combo (IOI18_combo) | C++17 | 43 ms | 472 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 <bits/stdc++.h>
using namespace std;
int press(std::string p);
std::string guess_sequence(int N){
int n = N;
string res = "", s;
if(press("A")){
res += 'A';
s = "BXY";
}
else if(press("B")){
res += 'B';
s = "AXY";
}
else if(press("X")){
res += 'X';
s = "ABY";
}
else{
res += 'Y';
s = "ABX";
}
for(int i = 1;i < n;++i){
bool ok = 0;
for(int j = 0;j < 2;++j){
res += s[j];
if(press(res) == res.size()){
ok = 1;
break;
}
res.pop_back();
}
if(!ok){
res += s[2];
}
}
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |