# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433983 | Apiram | Combo (IOI18_combo) | C++14 | 59 ms | 556 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;
std::string guess_sequence(int N) {
int counts=0;
string p;
string k = "ABXY";
bool ok=false;
for (int i =0;i<3;++i){
if (press(p+k[i])>counts){
counts++;
p+=k[i];
k.erase(i,1);
ok=true;
break;
}
}
if (!ok){
k.erase(3,1);
counts++;
p+='Y';
}
while(p.length()<N){
ok=false;
for (int i =0;i<2;++i){
char c =k[i];
if (press(p+c)>counts){
counts++;
p+=c;
ok=true;
break;
}
}
if (!ok){
p+=k[2];
counts++;
}
}
return p;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |