# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
995380 | ducksaysquack | Combo (IOI18_combo) | C++17 | 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 <bits/stdc++.h>
#include "combo.h"
using namespace std;
string c[7] = {"A","B","X","Y","A","B","X"};
string guess_sequence(int N) {
string s = "Y"; int k = 4;
for(int i=0;i<3;i++) if(press(c[i])) s = c[i], k = i+1;
for(int i=0;i<n-1;i++) {
int x = press(s+c[k]+s+c[k+1]+c[k]+s+c[k+1]+c[k+1]+s+c[k+1]+c[k+2]);
if(x == s.size()+1) s += c[k];
else if (x == s.size()) s += c[k+2];
else s += c[k+1];
}
return s;
}