# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
139690 | Bazarkuly2003 | Combo (IOI18_combo) | C++14 | 2 ms | 336 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;
string guess_sequence(int N){
string s,q,t;
int m,k;
if(press("AB")==1){
if(press("A")==1){s="A";q="BXY";}else{s="B";q="AXY";}}else
if(press("X")==1){s="X";q="ABY";}else{s="Y";q="ABX";}
k=1;
while(k<N){
if(k*4+7>N*4){
m=press(s+q[0]+q[1]);
if(m==k+2){s+=q[0]+q[1];k+=2;}else
if(m==k+1){if(press(s+q[0])==k+1){s+=q[0];k++;} else{s+=q[1];k++;}
}else if(m==k){s+=q[2];k++;}
}
else{
t=s+q[0]+q[0]+s+q[0]+q[1]+s+q[0]+q[2]+s+q[1];
m=press(t);
if(m==k+0){s+=q[2];k++;}else
if(m==k+1){s+=q[1];k++;}else
if(m==k+2){s+=q[0];k++;}
}
return s;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |