# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
516940 | AngusWong | Combo (IOI18_combo) | C++17 | 28 ms | 600 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="ABXY", ans="";
if (press("AB")){
if (press("A")) ans="A", s="BXY";
else ans="B", s="AXY";
}else{
if (press("X")) ans="X", s="ABY";
else ans="Y", s="ABX";
}
if (n==1) return ans;
for (int i=2; i<n; i++){
int t=press(ans+s[0]+s[0]+ans+s[0]+s[1]+ans+s[0]+s[2]+ans+s[1]);
if (t==i+1) ans+=s[0];
else if (t==i) ans+=s[1];
else ans+=s[2];
}
for (int i=0; i<=1; i++){
if (press(ans+s[i])==n){
ans+=s[i];
break;
}
}
if (ans.length()!=n) ans+=s[2];
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |