# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
600703 | enerelt14 | Combo (IOI18_combo) | C++14 | 35 ms | 584 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 ans, x;
for (int i=0;i<N;i++){
if (i==0){
if (press("AB")>0){
if (press("A")>0){
ans="A";
x="BXY";
}
else{
ans="B";
x="AXY";
}
continue;
}
if (press("X")>0){
ans="X";
x="ABY";
}
else{
ans="Y";
x="ABX";
}
continue;
}
if (i==N-1){
if (press(ans+x[0])==N)return ans+x[0];
if (press(ans+x[1])==N)return ans+x[1];
return ans+x[2];
}
int y=press(ans+x[0]+ans+x[1]+x[0]+ans+x[1]+x[2]+ans+x[1]+x[1]);
if (y==i)ans+=x[2];
if (y==i+1)ans+=x[0];
if (y==i+2)ans+=x[1];
}
if (N==1)return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |