# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
949168 |
2024-03-19T03:13:37 Z |
SoSmolSten |
Combo (IOI18_combo) |
C++17 |
|
1 ms |
344 KB |
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
string res = "";
int id = 0;
string c = "ABXY";
int v = press("AB");
if(v == 2) id = 0;
else if(v == 1){
if(press("A") == 1) id = 0;
else id = 1;
}else if(press("X") == 1) id = 2;
else id = 3;
res += c[id];
if(N == 1) return res;
swap(c[3], c[id]);
for(int i = 1; i < N - 1; ++i){
v = press(res + c[0] + c[0] + res + c[0] + c[1] + res + c[0] + c[2] + res + c[1]);
if(v == i + 2) {
res += c[0];
}else if(v == i + 1){
res += c[1];
}else res += c[2];
}
if(press(res + c[0] + res + c[1]) == N) {
if(press(res + c[0])) res += c[0];
else res += c[1];
}else res += c[2];
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Wrong Answer: wrong guess. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Incorrect |
0 ms |
344 KB |
Wrong Answer: wrong guess. |
6 |
Halted |
0 ms |
0 KB |
- |