# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
313803 | Jarif_Rahman | Combo (IOI18_combo) | C++17 | 54 ms | 444 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>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
str guess_sequence(int n){
str s = "";
int r = 0;
if(press("AB")){
if(press("A") > r) s+="A";
else s+="B";
}
else{
if(press("X") > r) s+="X";
else s+="Y";
}
r++;
if(n == 1) return s;
str ss = ""; for(char c: "ABXY") if(c != s[0]) ss+=str(1, c);
while(s.size() < n){
if(press(s+str(1, ss[0]) + s+str(1, ss[1])) > r){
if(press(s + str(1, ss[0])) > r) s+=str(1, ss[0]);
else s+=str(1, ss[1]);
}
else s+=str(1, ss[2]);
r++;
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |