Submission #75022

#TimeUsernameProblemLanguageResultExecution timeMemory
75022faustaadpCombo (IOI18_combo)C++17
100 / 100
57 ms492 KiB
#include "combo.h" #include<bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; char isi[4]={'A','B','X','Y'}; ll i,aw; string s; std::string guess_sequence(int N) { aw=3; if(press("AABB")) { if(press("AA")) aw=0; else aw=1; } else { if(press("XX")) aw=2; else aw=3; } s=isi[aw]; swap(isi[aw],isi[3]); for(i=1;i<N-1;i++) { ll tem=press(s+isi[0]+isi[0]+s+isi[0]+isi[1]+s+isi[0]+isi[2]+s+isi[1]); if(tem==i) s+=isi[2]; else if(tem==i+1) s+=isi[1]; else s+=isi[0]; } if(N>1) { if(press(s+isi[0])==N) s+=isi[0]; else if(press(s+isi[1])==N) s+=isi[1]; else s+=isi[2]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...