# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
204473 | andrii | Combo (IOI18_combo) | C++14 | 63 ms | 568 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 a[] = {"A", "B", "X", "Y"};
string guess_sequence(int N) {
int v0 = press(string("AB"));
string p = "";
int f = 0;
if(v0 > 0){
int b = press(string("A"));
if(b > 0) p ="A";
else p="B", f= 1;
}else{
int b = press(string("X"));
if(b > 0) p ="X", f=2;
else p="Y", f=3;
}
for(int i = 1;i<N-1;i++){
string q = p;
q += a[(f+1)&3];
q += a[(f+1)&3];
q += p;
q += a[(f+1)&3];
q += a[(f+2)&3];
q += p;
q += a[(f+1)&3];
q += a[(f+3)&3];
q += p;
q += a[(f+2)&3];
//cout << q << '\n';
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |