# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
385511 | ismoilov | Combo (IOI18_combo) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).begin(), (x).end()
#define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
#define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++)
#define fv(c) for(int (a) = (1); (a) <= (c); (a)++)
#define fz(c) for(int (a) = (0); (a) < (c); (a)++)
#define fm(a,i,c) for(int (a) = (i); (a) > (c); (a)--)
#define fmm(a,i,c) for(int (a) = (i); (a) >= (c); (a)--)
#define pb push_back
#define in insert
#define ss second
#define ff first
void S()
{
int n;
cin >> n;
string s, c = "ABXY";
fp(i,0,4)
{
fp(j,0,n)
s += c[i];
cout << "press(" << '"' << s << '"' << ")" << endl;
int x;
cin >> x;
if(x > 0)
break;
s = "";
}
c.erase((c.find(s[0])), 1);
int f = 1, i = 1, j = 0;
while(f != n)
{
fp(k,i,n)
s[k] = c[j];
cout << "press(" << '"' << s << '"' << ")" << endl;
int x;
cin >> x;
if(x == f)
j ++, j %= 3;
else
{
i += x - f, f = x, j = (j + 1)%3;
}
}
cout << s << endl;
}
int main()
{
IOS;
S();
/*int t;
cin >> t;
while(t--)
S();*/
}