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