# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
130174 | rondojim | Combo (IOI18_combo) | C++17 | 106 ms | 1412 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 <string>
#include <vector>
using namespace std;
string guess_sequence(int N) {
string moves[4] = {"A","B","X","Y"};
string start;
for (int x = 0; x<4; x++){
if (x==3) {start = moves[3]; break;}
if (press(moves[x])==1){
start = moves[x];
break;
}
}
vector<string> newmoves;
for (int x = 0; x<4; x++){
if (moves[x][0]!=start[0]){
newmoves.push_back(moves[x]);
}
}
for (int x = 1; x<N; x++){
for (int y = 0; y<2; y++){
if (press(start+newmoves[y])==x+1){
start+=newmoves[y];
break;
}
}
if (start.size()<x+1) start+=newmoves[2];
}
return start;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |