# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
380852 | fl0rian | Combo (IOI18_combo) | C++14 | 88 ms | 560 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 <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string>
#include "combo.h"
#include <iostream>
using namespace std;
string lets[4]={"A","B","X","Y"};
std::string guess_sequence(int N) {
string ans="";
int dontUse=-1;
int found=0;
int i=0;
for(int i=0;i<4&&dontUse==-1;i++)
if(press(lets[i])==1)
dontUse=i;
ans+=lets[dontUse];
for(int i=1;i<N;i++){
found=0;
for(int j=0;j<4 && !found;j++)
if(dontUse!=j && press(ans + lets[j])==i+1 ){
ans+=lets[j];
found=1;
}
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |