# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
128132 | WannnabeIOI | Combo (IOI18_combo) | C++14 | 42 ms | 596 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 <vector>
using namespace std;
int head,len=1;
void start();
void end(int N);
string c="ABXY",S,id;
vector<std::string>h[4];
string generate_press(){
return S+id[0]+S+id[1]+id[0]+
S+id[1]+id[1]+S+id[1]+id[2];
}
string guess_sequence(int N){
start();
while(len<N-1){
int opt=press(generate_press())-len;
S+=id[(opt+2)%3];
++len;
}
if (len==N-1) end(N);
return S;
}
void start(){
S=id="";
if (press("AB")){
if (press("A")) S+=c[head=0]; //A
else S+=c[head=1]; //B
}
else{
if (press("X")) S+=c[head=2]; //X
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |