이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "combo.h"
#define F first
#define S second
#define PB push_back
#define PF push_front
#define MP make_pair
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
const int maxn = 2e5 + 10;
map <int, char> mp;
string guess_sequence(int n){
mp[0] = 'A';
mp[1] = 'B';
mp[2] = 'X';
mp[3] = 'Y';
string t;
if (press("AB") == 1){
if (press("A") == 1)
throw;
else
swap(mp[0], mp[1]);
}
else{
if (press("X") == 1)
swap(mp[0], mp[2]);
else
swap(mp[0], mp[3]);
}
t += mp[0];
for (int i = 2; i <= n - 1; i++){
string s = t + mp[1] + mp[1] + t + mp[1] + mp[2] + t + mp[1] + mp[3] + t + mp[2];
int x = press(s);
if (x == i + 1)
t += mp[1];
else if (x == i)
t += mp[2];
else
t += mp[3];
}
if (press(t + mp[1] + t + mp[2]) == n){
if (press(t + mp[1]) == n)
t += mp[1];
else
t += mp[2];
}
else
t += mp[3];
return t;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |