이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
char start( string &s )
{
char c;
if ( press("A") ) c = 'A';
else if ( press("B") ) c = 'B';
else if ( press("X") ) c = 'X';
else c = 'Y';
for ( auto i: "ABXY" ) {
if ( i != c ) s += i;
}
return c;
}
string generate( string S, string s )
{
return S + s[0] + S + s[1];
}
string guess_sequence(int N)
{
string S, s, p;
vector < string > a = {"A", "B", "X", "Y"};
S += start(s);
for ( int i = 1; i < N; i++ ) {
p = generate( S, s );
if ( press(p) == i + 1 ) {
if ( press(S + s[0]) == i + 1 ) S += s[0];
else S += s[1];
}
else S += s[2];
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |