| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1356155 | Charizard2021 | Combo (IOI18_combo) | C++17 | 8 ms | 472 KiB |
#include "combo.h"
#include<bits/stdc++.h>
using namespace std;
string pos = "ABXY";
string guess_sequence(int N){
string S = "";
for(int j =0; j < 3; j++){
string st = "";
st += pos[j];
int val = press(st);
if(val == 1){
S += pos[j];
break;
}
}
if(S.empty()){
S += 'Y';
}
for(int j = 1; j < N; j++){
string s2 = "";
int cnt = 0;
for(int k = 0; k < 4; k++){
if(S[0] != pos[k]){
if(cnt == 2){
break;
}
s2 += S;
s2 += pos[k];
cnt++;
}
}
if(press(s2) == (int)S.size() + 1){
string S3 = "";
cnt = 0;
string stuff = "";
for(int k = 0; k < 4; k++){
if(S[0] != pos[k]){
if(cnt == 1){
stuff += pos[k];
break;
}
S3 += S;
S3 += pos[k];
cnt++;
}
}
if(press(S3) == (int)S.size() + 1){
S = S3;
}
else{
S += stuff;
}
}
else{
for(int k = 3; k >= 0; k--){
if(S[0] != pos[k]){
S += pos[k];
break;
}
}
}
}
return S;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
