# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90810 | tpoppo | Combo (IOI18_combo) | C++14 | 66 ms | 456 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<bits/stdc++.h>
#include "combo.h"
using namespace std;
int n;
string pref;
vector<char> valid ={'A','B','X','Y'};
void get_next(){
random_shuffle(valid.begin(),valid.end());
if(press(pref + valid[0] + pref + valid[1]) == pref.size()+1){
if(press(pref + valid[0]) == pref.size()+1){
pref += valid[0];
}else{
pref += valid[1];
}
}else{
pref += valid[2];
}
}
string guess_sequence(int N) {
n = N;
if(press("AB")){
if(press("A")){
pref = "A";
valid.erase(valid.begin());
}else{
pref = "B";
valid.erase(valid.begin()+1);
}
}else{
if(press("X")){
pref = "X";
valid.erase(valid.begin()+2);
}else{
pref = "Y";
valid.erase(valid.begin()+3);
}
}
for(int i=1;i<n;i++) get_next();
return pref;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |