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 "combo.h"
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int N) {
string p = ""; char c[4]; c[0] = 'A'; c[1] = 'B'; c[2] = 'X'; c[3] = 'Y';
for(int j = 0; j < 4; j++) {
if(j == 0) p += c[j];
else p[0] = c[j];
if(press(p) == 1) {
if(j != 3) swap(c[j], c[3]);
break;
}
}
srand(52398339);
for(int i = 1; i < N; i++) {
int a = rand() % 3, b = rand() % 3;
if(a != b) swap(c[a], c[b]);
for(int j = 0; j < 3; j++) {
if(j == 0) p += c[j];
else p[i] = c[j];
if(press(p) == i + 1) break;
}
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |