Submission #998486

#TimeUsernameProblemLanguageResultExecution timeMemory
998486ezzzayCombo (IOI18_combo)C++14
5 / 100
1 ms344 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back std::string guess_sequence(int N) { string s; vector<string>h={"A","B","X","Y"}; if(press(h[0]+h[1])){ if(press(h[1]))swap(h[0],h[1]); } else if(press(h[2])){ swap(h[0],h[2]); } else{ swap(h[0],h[3]); } s+=h[0]; int k=1; for(int i=2;i<N;i++){ string tmp=s+h[1]+s+h[2]+h[1]+s+h[2]+h[2]+s+h[2]+h[3]; int t=press(tmp); if(t==k+1){ s+=h[1]; } else if(t==k+2){ s+=h[2]; } else{ s+=h[3]; } k++; } if(press(s+h[1])==k+1){ s+=h[1]; } else if(press(s+h[2])==k+1){ s+=h[2]; } else{ s+=h[3]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...