# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
77191 | toreto_back | Combo (IOI18_combo) | C++14 | 2 ms | 200 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>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef double D;
const ll mod=1e9+7;
const ll inf=(1ll<<61);
const int MX=3e5+9;
string guess_sequence(int n){
if(n==1){
if(press("A"))return "A";
if(press("B"))return "B";
if(press("X"))return "X";
return "Y";
}
string p="";
string ans="";
if(press("AB")){
if(press("ABAXAYBB")==1)ans+='B';
else ans+='A';
}
else{
if(press("XAXBXYYY")==1)ans+='Y';
else ans+='X';
}
if(ans=="A")p="BXY";
if(ans=="B")p="AXY";
if(ans=="X")p="ABY";
if(ans=="Y")p="AXB";
while(ans.size()<n-1){
int x=press(ans+p[0]+p[0]+ans+p[0]+p[1]+ans+p[0]+p[2]+ans+p[1]);
if(x==ans.size()+1){
ans+=p[1];
}
else if(x==ans.size())ans+=p[2];
else ans+=p[0];
}
if(press(ans+p[0])==n)return ans+p[0];
if(press(ans+p[1])==n)return ans+p[1];
return ans+p[2];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |