# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
349502 | David_M | Combo (IOI18_combo) | C++14 | 0 ms | 0 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 p press
#define r return
std::string e,a="BXY";
std::string guess_sequence(int N){
p("XY")?ans='Y'-p("X"):ans='B'-p("A");
if(N==1)r ans;
if(ans!="A")a[(ans[0]-'B')%21]='A';
for(int i=1;i<N-1;i++)e+=a[p(e+a[1]+e+a[2]+a[0]+e+a[2]+a[1]+e+a[2]+a[2])-i];
if(p(ans+a[0])==N)r e+a[0];
if(p(ans+a[1])==N)r e+a[1];
r e+a[2];
}