# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
232259 | dannber_BR | Combo (IOI18_combo) | C++14 | 109 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>
using namespace std;
string guess_sequence(int N) {
string Btns[] = {"A","B","X","Y"};
string s = "";
int p = 0;
if (press(Btns[0]) == 1) {
s += Btns[0];
p = 0;
}
else if (press(Btns[1]) == 1) {
s += Btns[1];
p = 1;
}
else if (press(Btns[2]) == 1){
s += Btns[2];
p = 2;
}
else if (press(Btns[3]) == 1) {
s += Btns[3];
p = 3;
}
for(int i = 2;i < N + 1;i++)
{
if (press(s + Btns[0]) == i) {
s += Btns[0];
}
else if (press(s + Btns[1]) == i) {
s += Btns[1];
}
else if (press(s + Btns[2]) == i){
s += Btns[2];
}
else if (press(s + Btns[3]) == i) {
s += Btns[3];
}
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |