# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305336 | daveeed | Combo (IOI18_combo) | C++17 | 59 ms | 576 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"
char terms[4] = {'A', 'B', 'X', 'Y'};
std::string guess_sequence(int N) {
std::string p = "";
std::string answer = "";
int s = -1;
for(int i = 0; i < N; i++){
p = answer + terms[0] + answer + terms[1];
if(press(p) > i){
if(s == 0){
answer += terms[1];
continue;
}
if(s == 1){
answer += terms[0];
continue;
}
p = answer + terms[0];
if(press(p) > i){
answer += terms[0];
if(i == 0)
s = 0;
}
else{
answer += terms[1];
if(i == 0)
s = 1;
}
}
else{
if(s == 2){
answer += terms[3];
continue;
}
if(s == 3){
answer += terms[2];
continue;
}
p = answer + terms[2];
if(press(p) > i){
answer += terms[2];
if(i == 0)
s = 2;
}
else{
answer += terms[3];
if(i == 0)
s == 3;
}
}
}
return answer;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |