# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
744892 | teo_thrash | Combo (IOI18_combo) | C++14 | 1 ms | 208 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>
#include "combo.h"
using namespace std;
string guess_sequence(int n) {
string p="AB", a="ABXY";
string S, curr;
vector<char> let;
if(!press("AB")){
p="XY";
}
char c=p[0];
if(!press(p.substr(0, 1))){
c=p[1];
}
S+=c;
for(int i=0; i<a.size(); i++){
if(a[i]!=c){
let.push_back(a[i]);
}
}
int coins=0;
for(int i=2; i<n; i++){
curr=S+let[0]+let[0] + S+let[0]+let[1] + S+let[0]+let[2] + S+let[1];
coins=press(curr);
if(coins==i+1){
S+=let[0];
}else{
if(coins==i){
S+=let[1];
}else{
S+=let[2];
}
}
}
if(press(S+let[0])==n){
S+=let[0];
}else{
if(press(S+let[1])==n){
S+=let[1];
}else{
S+=let[2];
}
}
return S;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |