이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int N) {
srand(time(NULL));
for (int i = 0; i < 10000; i++) {
}
set<char> X = {'A', 'B', 'X', 'Y'};
string s = "";
for (auto it = X.begin(); it != X.end(); it++) {
int x = press(s + *it);
if (x != 0) {
s += *it;
X.erase(*it);
break;
}
}
if (s == "") {
return s;
}
string Y = "";
for (auto it = X.begin(); it != X.end(); it++) {
Y += *it;
}
int prev = 1;
bool ok = true;
while (ok) {
ok = false;
int x;
set<int> W;
while ((int) W.size() != 3) {
int rn = ((rand() + rand())% 3);
if (!W.count(rn)) {
x = press(s + Y[rn]);
if (x > prev) {
s += Y[rn];
prev++;
break;
}
W.insert(rn);
}
}
if ((int) s.size() == N || x == prev) {
break;
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |