이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int N){
// 30 points
// get first character;
string f = string(N,' ');
f[0] = 'Y';
string chs = "ABX";
for(char c: chs){
string s = string(1,c);
if(press(s)){
f[0] = c;
break;
}
}
// check 1 - n - 1 only three 2 character
string chk = "";
for(char c: "ABXY") if(c != f[0]){
chk += c;
}
for(int i = 1; i < N; i++){
for(int j = 0; j < 2; j++){
string s = f.substr(0,i) + chk[j];
if(press(s) == i + 1){
f[i] = chk[j];
break;
}
}
if(f[i] == ' ') f[i] = chk[2];
}
return f;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |