#include "bits/stdc++.h"
// #include "grader.cpp"
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
string g = "";
int p = 0;
set <char> h = {'A','B','X','Y'}, in[3000];
for(int i = 0; i < N; i++) {
in[i].clear();
for(auto k : h) {
in[i].insert(k);
}
}
for(auto j : h) {
g += j;
p++;
if(p == 4) break;
int calc = press(g);
if(calc == 1) break;
g.pop_back();
}
h.erase(g[0]);
for(int i = 1; i < N; i++) {
g += 'A';
in[i].erase(g[0]);
}
int pos = 1;
while(pos < N) {
if((int)in[pos].size() == 1) {
g[pos] = *in[pos].begin();
pos++;
}
if(pos == N) break;
for(int i = pos; i < N; i++) {
g[i] = *in[pos].begin();
}
int c = press(g);
if(c == N) break;
if(c == pos) {
in[pos].erase(g[pos]);
continue;
}
in[c].erase(g[c]);
pos = c;
}
return g;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |