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