이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//I wrote this code 4 u today
#include <bits/stdc++.h>
#define vc vector
#define nd node*
#define pnd pair<nd, nd>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vc<pll> vpll;
typedef vc<vll> vvll;
typedef vc<vpll> vvpll;
template<const ll MOD>
struct mod_mul : std::multiplies<const ll> {
ll operator()(const ll a, const ll b) {
return (a * b) % MOD;
}
};
template<typename T>
inline void sort(T &a) {
sort(a.begin(), a.end());
}
template<typename T>
inline void unique(T &a) {
a.resize(unique(a.begin(), a.end()) - a.begin());
}
template<typename T>
inline void reverse(T &a) {
reverse(a.begin(), a.end());
}
const ll INF = 9023372036854775808ll;
const ll MOD = 1000000007ll;
int press(string p);
string guess_sequence(int N) {
string s;
if (press("XY")) if (press("X")) s = "X"; else s = "Y";
else if (press("A")) s = "A"; else s = "B";
if (N == 1) return s;
vc<string> ku;
{string tmp;tmp.push_back(' '); for (auto ch : string{"ABXY"}) if (ch != s[0]) tmp[0] = ch, ku.push_back(tmp);}
for (int i = 1; i + 1 < N; ++i) {
int c = press(s+ku[0]+ku[0]+s+ku[0]+ku[1]+s+ku[0]+ku[2]+s+ku[1]);
s += ku[(s.size() + 2) - c];
}
if (press(s+ku[0]+s+ku[1]) == N) if (press(s+ku[0]) == N) s += ku[0]; else s += ku[1];
else s += ku[2];
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |