| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 144521 | arnold518 | Combo (IOI18_combo) | C++14 | 66 ms | 624 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 "combo.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 2000;
int N;
char S, P, Q, R;
string ans;
string guess_sequence(int _N)
{
int i, j;
N=_N;
string t; int res;
t=string(N, 'A')+string(N, 'B'); res=press(t);
if(res>0)
{
t=string(N, 'A'); res=press(t);
if(res>0) S='A', P='B', Q='X', R='Y';
else S='B', P='A', Q='X', R='Y';
}
else
{
t=string(N, 'X'); res=press(t);
if(res>0) S='X', P='Y', Q='A', R='B';
else S='Y', P='X', Q='A', R='B';
}
ans+=S;
if(N==1) return ans;
for(i=2; i<N; i++)
{
t=ans+P+P+ans+P+Q+ans+P+R+ans+Q; res=press(t);
if(res==ans.size()+2) ans+=P;
else if(res==ans.size()+1) ans+=Q;
else ans+=R;
}
t=ans+P; res=press(t);
if(res==N) ans+=P;
else
{
t=ans+Q; res=press(t);
if(res==N) ans+=Q;
else ans+=R;
}
return ans;
}Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
