# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
447534 | MohamedAliSaidane | Combo (IOI18_combo) | C++14 | 1 ms | 208 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 vector<int> vi;
#define pb push_back
#define popb pop_back
#define ff first
#define ss second
const int MOD = 1e9 + 7;
const ll INF = 1e18;
string guess_sequence(int n)
{
char but[4] = {'A','B','X','Y'};
string p = "";
string s = "";
int fr = -1;
for(int i = 0; i < 4; i ++)
{
string g = p + but[i];
int rep = press(g);
if(rep == 1)
{
fr = i;
s = g;
break;
}
}
int prog = 1;
int last = fr;
swap(but[fr],but[3]);
for(int i = 1; i < n - 1; i ++)
{
char b = but[0];
char x= but[1];
char y = but[2];
string g = s + b;
g += (s + x+x);
g += (s+ x+b);
g += (s+ x+y);
int tent = press(g);
if(tent == prog +1)
{
prog ++;
s += b;
}
else if(tent == prog + 2)
{
prog ++;
s += x;
}
else
{
prog ++;
s += y;
}
}
for(int j = 0; j < 3; j ++)
{
int tent = press(s+but[j]);
if(tent == n)
{
s += but[j];
break;
}
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |