# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1021468 | khome | Combo (IOI18_combo) | C++17 | 34 ms | 596 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;
string guess_sequence(int N) {
vector<string> a;
a={"A", "B", "X", "Y"};
string res, cur, per = "";
int n;
for (string i : a){
if (press(i) == 1){
per = i;
res+=i;
break;
}
}
while (res.size()!=N){
n = res.size();
for (string i:a){
if (i != per && i != res[-1]+"0"){
// cout << "current res = " << res << ' ';
cur = res;
while (res.size()!=N){
res+=i;
}
// cout << " after = " << res << ' ';
int p = press(res);
if (p > n){
cur="";
for (int j = 0; j < p; j++){
cur += res[j];
}
// cout << "changed = " << cur << ' ';
}
res = cur;
// cout << "\n";
}
}
}
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |