# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
285401 | Pichon5 | Combo (IOI18_combo) | C++17 | 64 ms | 580 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "combo.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
string guess_sequence(int N){
vector<char>v;
char arr[4]={'A','B','X','Y'};
int c=0;
string s="",ss;
if(press("X")==1){
s+='X';
}else{
if(press("Y")==1){
s+='Y';
}else{
if(press("A")==1){
s+='A';
}else{
s+='B';
}
}
}
for(int i=0;i<4;i++){
if(arr[i]!=s[0]){
v.pb(arr[i]);
}
}
for(int i=2;i<=N;i++){
for(int l=0;l<3;l++){
string ss=s+v[l];
if(l==2){
s+=v[l];
break;
}
if(press(ss)==i){
s=ss;
break;
}
}
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |