# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
956249 |
2024-04-01T11:57:22 Z |
Faissel |
Combo (IOI18_combo) |
C++17 |
|
1 ms |
596 KB |
#include <bits/stdc++.h>
using namespace std;
#include "combo.h"
//#include "grader.cpp"
#define ll long long
#define endl '\n'
string guess_sequence(int n){
string y = "ABXY";
string ans = "";
if(press("AB")){
if(press("A")){
ans += 'A';
y.erase(y.begin());
}else{
ans += 'B';
y.erase(y.begin() + 1);
}
}else{
if(press("X")){
ans += 'X';
y.erase(y.begin() + 2);
}else{
ans += 'Y';
y.erase(y.begin() + 3);
}
}
for(int i=2;i<n;i++){
string u = ans + y[0];
string j = ans + y[1] + y[0] + ans + y[1] + y[1] + ans + y[1] + y[2];
string need = u+j;
int val = press(need);
if(val == i){
ans += y[0];
}else if(val == i+1){
ans += y[1];
}else{
ans += y[2];
}
cout << ans << endl;
}
if(n > 1){
if(press(ans + y[0]) == n){
ans += y[0];
}else{
if(press(ans + y[1]) == n){
ans += y[1];
}else{
ans += y[2];
}
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
344 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
416 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
500 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
596 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
344 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Runtime error |
0 ms |
344 KB |
Execution failed because the return code was nonzero |
18 |
Halted |
0 ms |
0 KB |
- |