Submission #788187

#TimeUsernameProblemLanguageResultExecution timeMemory
788187BulaCombo (IOI18_combo)C++17
5 / 100
1 ms208 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() //#define int ll const ll mod=1e9+7; string guess_sequence(int n){ string s="."; vector<string> v={"A","B","X","Y"}; int x=3; for(int i=0;i<3;i++){ int k=press(v[i]); if(k==1){ s=v[i]; x=i; break; } } if(s==".") s=v[3]; vector<string> t; for(int i=0;i<4;i++){ if(i!=x) t.pb(v[i]); } for(int i=1;i<n-1;i++){ string p=s+t[0]; for(int j=0;j<3;j++){ string k=s+t[1]; k+=t[j]; p+=k; } int N=(int) s.size(); int c=press(p); if(c==N){ s+=t[2]; }else if(c==N+1) s+=t[0]; else s+=t[1]; } for(int i=0;i<2;i++){ string p=s+t[i]; int c=press(p); if(c==n){ s+=t[i]; break; } } if((int) s.size() == n-1) s+=t[2]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...