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 <bits/stdc++.h>
#include "combo.h"
using namespace std;
string za_prvo(string tr){
if(press("AB")>0){
if(press("A")>0)
return "A";
return "B";
}
if(press("X")>0)
return "X";
return "Y";
}
string za_poslednje(string tr){
vector<string> moguci(0);
if(tr[0]!='A')moguci.push_back("A");
if(tr[0]!='B')moguci.push_back("B");
if(tr[0]!='X')moguci.push_back("X");
if(tr[0]!='Y')moguci.push_back("Y");
if(press(tr+moguci[0]+tr+moguci[1])>(int)(tr.size())){
if(press(tr+moguci[0])>(int)(tr.size()))
return moguci[0];
return moguci[1];
}
return moguci[2];
}
string classic(string tr){
vector<string> moguci(0);
if(tr[0]!='A')moguci.push_back("A");
if(tr[0]!='B')moguci.push_back("B");
if(tr[0]!='X')moguci.push_back("X");
if(tr[0]!='Y')moguci.push_back("Y");
int napredak=press(tr+moguci[0]+tr+moguci[1]+moguci[0]+tr+moguci[1]+moguci[1]+tr+moguci[1]+moguci[2])-(int)(tr.size());
if(napredak==1)
return moguci[0];
if(napredak==2)
return moguci[1];
return moguci[2];
}
string guess_sequence(int N){
string rez="";
rez+=za_prvo(rez);
if(N==1)
return rez;
for(int i=1; i<N-1; i++)
rez+=classic(rez);
rez+=za_poslednje(rez);
return rez;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |