# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
699208 | Baytoro | Combo (IOI18_combo) | C++17 | 39 ms | 592 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;
#define ios ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fr first
#define sc second
#define endl '\n'
//#define int long long
//#define ll long long
void fopn(string name){
freopen((name+".in").c_str(),"r",stdin);
freopen((name+".out").c_str(),"w",stdout);
}
const long long INF=1e18,mod=1e9+7;
string guess_sequence(int n) {
string ans,a="A",b="B",c="X",d="Y";
int s=press(a+b);
if(s>=1){
if(press(b)==1)
swap(a,b);
}
else{
if(press(c))
swap(a,c);
else
swap(a,d);
}
ans=a;
for(int i=1;i<n-1;i++){
int k=press(ans+b+ans+c+b+ans+c+c+ans+c+d);
if(k==(int)ans.size()+1) ans=ans+b;
else if(k==(int)ans.size()+2) ans=ans+c;
else ans=ans+d;
}
if(n>1){
s=press(ans+b+ans+c);
if(s==n){
if(press(ans+b)==n)
ans=ans+b;
else
ans=ans+c;
}
else
ans=ans+d;
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |