# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
647928 | JANCARAPAN | 콤보 (IOI18_combo) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
const int dx[4]{1,0,-1,0}, dy[4]{0,1,0,-1};
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x);
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? ", " : ""), __print(i); cerr << "}";}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ", "; __print(x.second); cerr << '}';}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef DEBUG
#define dbg(x...) cerr <<__func__<<":"<<" [" << #x << "] = ["; _print(x); /*cerr << "\e[39m" << endl;*/
#else
#define dbg(x...)
#endif
#define ll long long;
#define ld long double;
//#define int long long
#define lwb(a, x) ( lower_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define upb(a, x) ( upper_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
#define F first
#define S second
#define vi vector<ll>
#define vvi vector<vi>
#define vvvi vector<vvi>
#define pb push_back
#define ii pair<ll,ll>
#define vpi vector<ii>
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define endl '\n'
#define sz(x) (ll)size(x)
#define rs resize
const ll N = 2e5+5, INF = 1e18, MOD = 1e9+7;
string ch = "ABXY";
string guess_sequence(int n) {
string s = "";
int block = -1;
if (press("A") == 1) block = 0;
else if (press("B") == 1) block = 1;
else if (press("X") == 1) block = 2;
else block = 3;
s += ch[block];
for (int i=1; i<n-1; i++) {
for (int j=0; j<4 && sz(s) < n; j++) {
if (block == j) continue;
if (press(s+ch[j]) > i) {
s += ch[j];
break;
}
}
}
return s;
}