Submission #585810

#TimeUsernameProblemLanguageResultExecution timeMemory
585810Koosha_mvCombo (IOI18_combo)C++14
5 / 100
1 ms208 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
#define dbgv(v) cout<<#v<<" = "; f(i,0,v.size()) cout<<v[i]<<" "; cout<<endl
#define dbga(a,x,y) cout<<#a<<" = "; f(i,x,y) cout<<a[i]<<" "; cout<<endl
#define erorp(x) cout<<#x<<"={"<<x.F<<" , "<<x.S<<"}"<<endl
#define eror(x) cout<<#x<<'='<<(x)<<endl
#define f_(i,a,b) for(int i=a;i>=b;i--)
#define f(i,a,b) for(int i=a;i<b;i++)
#define nb(x) __builtin_popcount(x)
#define all(v) v.begin(),v.end()
#define bit(n,k) (((n)>>(k))&1)
#define Add(x,y) x=(x+y)%mod
#define maxm(a,b) a=max(a,b)
#define minm(a,b) a=min(a,b)
#define lst(x) x[x.size()-1]
#define sz(x) int(x.size())
#define mp make_pair
#define ll long long
#define pb push_back
#define S second
#define F first

int n;
string s;
vector<char> chr;

string guess_sequence(int _n) {
  string ans;
  n=_n;
  chr.pb('X'),chr.pb('Y'),chr.pb('A'),chr.pb('B');
  f(i,0,3){
    string p;
    p+=chr[i];
    if(press(p)>0){
      ans+=chr[i];
      chr.erase(chr.begin()+i);
      break;
    }
  }
  if(ans.size()==0) ans+=chr.back();
  f(i,1,n-1){
    string p=ans+chr[1];
    f(j,0,3) p=p+ans+chr[2]+chr[j];
    ans+=chr[press(p)-i];
  }
  if(press(ans+chr[0])==n) ans+=chr[0];
  else if(press(ans+chr[1])==n) ans+=chr[1];
  else ans+=chr[2];
  return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...