Submission #299592

#TimeUsernameProblemLanguageResultExecution timeMemory
299592BatyrCombo (IOI18_combo)C++17
5 / 100
1 ms200 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; #define pb push_back #define ff first #define ss second #define sz(a) (int)a.size() typedef long long ll; typedef vector<int> vi; typedef pair<int,int> pii; const ll inf=1e18; const int mod=1e9+7; const int maxn=1e5; string s; vector<char>v; //int press(string t){ // cout<<t<<'\n'; // int x; cin >> x; // return x; //} string guess_sequence(int N){ int jog = press("AB"); if(jog==2) s+='A'; else if(jog==1){ if(press("A")==1) s += 'A'; else s += 'B'; } else { if(press("X")==1) s += 'X'; else s += 'Y'; } if(s[0]=='A') v={'B','X','Y'}; else if(s[0]=='B') v={'A','X','Y'}; else if(s[0]=='X') v={'A','B','Y'}; else v={'A','B','X'}; for(int i = 1;i < N-1;i++){ string ask; ask += s+v[0]+v[0]; ask += s+v[0]+v[1]; ask += s+v[0]+v[2]; ask += s+v[1]; int now=press(ask); if(now==sz(s)+2) s+=v[0]; else if(now==sz(s)+1) s+=v[1]; else s+=v[2]; } // cout<<s<<'\n'; if(press(s+v[0])==sz(s)+1) s += v[0]; else if(press(s+v[1])==sz(s)+1) s += v[1]; else s += v[2]; return s; } //int main(){ // cout << guess_sequence(3); //}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...