| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1358952 | NValchanov | Combo (IOI18_combo) | C++20 | 8 ms | 548 KiB |
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e3 + 10;
string guess_sequence(int N)
{
string ans = "";
string rest = "";
if(press("AX") >= 1)
{
if(press("A"))
{
ans = "A";
rest = "BXY";
}
else
{
ans = "X";
rest = "ABY";
}
}
else
{
if(press("B"))
{
ans = "B";
rest = "AXY";
}
else
{
ans = "Y";
rest = "ABX";
}
}
for(int i = 2; i <= N; i++)
{
int cur = 0;
string test1 = ans + rest[0] + ans + rest[1];
string test2 = ans + rest[0] + ans + rest[2];
int t1 = press(test1);
if(t1 == 0)
{
cur = 2;
}
else
{
int t2 = press(test2);
bool c1 = !(t1 == i);
bool c2 = !(t2 == i);
cur = c1 * 2 + c2;
}
ans = ans + rest[cur];
}
return ans;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
