# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
491336 | cfalas | Combo (IOI18_combo) | C++17 | 1 ms | 200 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<bits/stdc++.h>
using namespace std;
#include "combo.h"
char letters[4] = {'A','B','X','Y'};
char first;
char next(int s){
int fi=-1;
for(int i=0;i<4;i++)
if(letters[i]==first) fi = i;
return letters[(fi + s)%4];
}
string guess_sequence(int N) {
string s = "";
int x = press("AB");
if(x>=1){
if(x == 2) s = "AB";
else if(press("A")==1) s = "A";
else s = "B";
}
else{
if(press("X")==1) s = "X";
else s = "Y";
}
first = s[0];
while((int)s.size()<N-1){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |