# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
493051 | _adis | 콤보 (IOI18_combo) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*input
*/
/*inhuman strength
#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx,avx2")
*/
#include<bits/stdc++.h>
#define foR(i,a,b) for(int i=a;i<=b;i++)
#define roF(i,a,b) for(int i=a;i>=b;i--)
#define _ff exit(0);
#define Sort(i,a,b) sort(i+a,i+a+b)
#define SORT(i,a,b) sort(i+a,i+a+b,greater<int>())
#define code_chef for(int i=1,x=0;i<=100000;i++){x++;cerr<<x;}
#define TLE cerr<<"\n" << 1.0*clock()/CLOCKS_PER_SEC << "\n";
#define F first
#define S second
#define sperm(a) next_permutation(a.begin(),a.end());
#define all(a) a.begin(),a.end()
#define nxhieu_speed cin.tie(0)->sync_with_stdio(false);
#define i2 pair<int,int>
#define getbit(x,i) ((x>>(i))&1)
#define batbit(x,i) (x|(1ll<<(i)))
#define tatbit(x,i) (x&~(1<<(i)))
#define RTE cout<<-1;_ff
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l, int r) {return l + rng() % (r - l + 1);}
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
struct Triple
{
int Fi;
int Se;
int Th;
};
bool operator >(Triple A, Triple B)
{
if (A.Fi == B.Fi && A.Se == B.Se) return (A.Th > B.Th);
if (A.Fi == B.Fi && A.Se != B.Se) return (A.Se > B.Se);
return (A.Fi > B.Fi);
}
bool operator <(Triple A, Triple B)
{
if (A.Fi == B.Fi && A.Se == B.Se) return (A.Th < B.Th);
if (A.Fi == B.Fi && A.Se != B.Se) return (A.Se < B.Se);
return (A.Fi < B.Fi);
}
bool operator ==(Triple A, Triple B)
{
return (A.Fi == B.Fi && A.Se == B.Se && A.Th == B.Th);
}
int Money;
void solve()
{
int n;
cin >> n;
string s;
cout << "AB" << '\n';
cout.flush();
vector<char> S;
cin >> Money;
if (Money == 1)
{
cout << "A";
cout.flush();
cin >> Money;
if (Money == 1)
{
S.push_back('B');
S.push_back('X');
S.push_back('Y');
s = s + 'A';
}
else
{
S.push_back('A');
S.push_back('X');
S.push_back('Y');
s = s + 'B';
}
}
else {
cout << 'X';
cout.flush();
cin >> Money;
if (Money == 1)
{
s = s + 'X';
S.push_back('B');
S.push_back('A');
S.push_back('Y');
}
else
{
s = s + 'Y';
S.push_back('B');
S.push_back('X');
S.push_back('A');
}
}
for (int i = 1; i < n; ++i)
{
cout << s << S[0] << s << S[1] << S[0] << s << S[1] << S[1] << s << S[1] << S[2] << '\n';
cout.flush();
cin >> Money;
if(Money==s.size()+1) s=s+S[0];
else if(Money==s.size()+2) s=s+S[1];
else s=s+S[2];
}
cout << s;
}
int main()
{
nxhieu_speed
int t = 1;
//cin >> t;
while (t-- > 0) solve();
return 0;
}