# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1038523 | vjudge1 | Combo (IOI18_combo) | C++17 | 1 ms | 380 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"
#include<bits/stdc++.h>
using namespace std;
std::string guess_sequence(int N) {
string str,buton;
if(press("AB"))
if(press("A"))
str="A",buton="BXY";
else str="B",buton="AXY";
else if(press("X"))
str="X",buton="ABY";
else str="Y",buton="ABX";
for(int i=2;i<N;i++){
int k=press(str+buton[0]+str+buton[1]+buton[0]+str+buton[1]+buton[1]+str+buton[1]+buton[2]);
if(k==str.size())str+=buton[2];
else if(k<str.size()+2)
str+=buton[0];
else str+=buton[1];
};
if(press(str+buton[0])==N)
str+=buton[0];
else if(press(str+buton[1])==N)
str+=buton[1];
else str+=buton[2],assert(press(str)==N);
return str;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |