| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1350595 | bozho | 콤보 (IOI18_combo) | C++20 | 5 ms | 412 KiB |
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int n)
{
char c[4] = {'B', 'X', 'A', 'Y'};
vector<int>id = {0, 1, 2, 3};
int f, l;
string idk = "";
for (int i = 0; i < 4; i++)
{
idk = "";
idk += c[i];
if (press(idk))
{
f = i;
break;
}
}
l = f;
string s = "", tr = "";
s += c[f];
for (int i = 0; i < n; i++)
tr += 'A';
tr[0] = c[f];
int op;
srand(time(nullptr));
while (s.size() < n)
{
random_shuffle(id.begin(),id.end());
for (auto j:id)
{
if (j == l || j == f)
continue;
for (int i = s.size(); i < n; i++)
tr[i] = c[j];
l = j;
op = press(tr);
for (int i = s.size(); i < op; i++)
s += c[l];
if (op > s.size())
break;
}
}
return s;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
