# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
203615 |
2020-02-21T15:30:19 Z |
Tadiorn |
Combo (IOI18_combo) |
C++14 |
|
3 ms |
256 KB |
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
/*int press(string lol)
{
cout << lol << ":\n";
int lollol;
cin >> lollol;
return lollol;
}*/
string guess_sequence(int N)
{
string f;
int te = press("AB");
if(te >= 1)
{
te = press("A");
if(te == 1)
{
f = "A";
}
else
{
f = "B";
}
}
else
{
te = press("X");
if(te == 1)
{
f = "X";
}
else
{
f = "Y";
}
}
if(f == "A")
{
for(int i = 1; i < N - 1; i++)
{
int t = press(f + "X"+ f + "YB" + f + "YX" + f + "YY");
if(t == (int)f.size())
{
f += "B";
}
else if(t == (int)f.size() + 1)
{
f += "X";
}
else //if(t == s.size() + 2)
{
f += "Y";
}
}
}
else if(f == "B")
{
int t = press(f + "X"+ f + "YA" + f + "YX" + f + "YY");
if(t == (int)f.size())
{
f += "A";
}
else if(t == (int)f.size() + 1)
{
f += "X";
}
else //if(t == s.size() + 2)
{
f += "Y";
}
}
else if(f == "X")
{
int t = press(f + "A"+ f + "BA" + f + "BB" + f + "BY");
if(t == (int)f.size())
{
f += "Y";
}
else if(t == (int)f.size() + 1)
{
f += "A";
}
else //if(t == s.size() + 2)
{
f += "B";
}
}
else //if(f == "Y")
{
int t = press(f + "A"+ f + "BA" + f + "BB" + f + "BX");
if(t == (int)f.size())
{
f += "X";
}
else if(t == (int)f.size() + 1)
{
f += "A";
}
else //if(t == s.size() + 2)
{
f += "B";
}
}
te = press(f + "A" + f + "B");
if(te >= N)
{
te = press(f + "A");
if(te == N)
{
f += "A";
}
else
{
f += "B";
}
}
else
{
te = press(f + "X");
if(te == N)
{
f += "X";
}
else
{
f += "Y";
}
}
return f;
}
/*int main()
{
int n;
cin >> n;
string rez = guess_sequence(n);
cout << rez << "\n";
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
2 ms |
200 KB |
Output is correct |
3 |
Correct |
2 ms |
200 KB |
Output is correct |
4 |
Correct |
1 ms |
200 KB |
Output is correct |
5 |
Correct |
2 ms |
200 KB |
Output is correct |
6 |
Correct |
1 ms |
200 KB |
Output is correct |
7 |
Correct |
1 ms |
200 KB |
Output is correct |
8 |
Correct |
1 ms |
200 KB |
Output is correct |
9 |
Correct |
1 ms |
200 KB |
Output is correct |
10 |
Correct |
2 ms |
200 KB |
Output is correct |
11 |
Correct |
2 ms |
200 KB |
Output is correct |
12 |
Correct |
3 ms |
200 KB |
Output is correct |
13 |
Correct |
1 ms |
200 KB |
Output is correct |
14 |
Correct |
2 ms |
200 KB |
Output is correct |
15 |
Correct |
1 ms |
200 KB |
Output is correct |
16 |
Correct |
1 ms |
200 KB |
Output is correct |
17 |
Correct |
2 ms |
200 KB |
Output is correct |
18 |
Correct |
1 ms |
200 KB |
Output is correct |
19 |
Correct |
1 ms |
200 KB |
Output is correct |
20 |
Correct |
1 ms |
200 KB |
Output is correct |
21 |
Correct |
1 ms |
200 KB |
Output is correct |
22 |
Correct |
2 ms |
200 KB |
Output is correct |
23 |
Correct |
2 ms |
200 KB |
Output is correct |
24 |
Correct |
2 ms |
200 KB |
Output is correct |
25 |
Correct |
1 ms |
200 KB |
Output is correct |
26 |
Correct |
1 ms |
200 KB |
Output is correct |
27 |
Correct |
1 ms |
200 KB |
Output is correct |
28 |
Correct |
1 ms |
200 KB |
Output is correct |
29 |
Correct |
1 ms |
200 KB |
Output is correct |
30 |
Correct |
2 ms |
200 KB |
Output is correct |
31 |
Correct |
2 ms |
200 KB |
Output is correct |
32 |
Correct |
1 ms |
200 KB |
Output is correct |
33 |
Correct |
1 ms |
200 KB |
Output is correct |
34 |
Correct |
2 ms |
200 KB |
Output is correct |
35 |
Correct |
2 ms |
200 KB |
Output is correct |
36 |
Correct |
2 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Wrong Answer: wrong guess. |
2 |
Halted |
0 ms |
0 KB |
- |