Submission #918929

#TimeUsernameProblemLanguageResultExecution timeMemory
918929Gwynbleidd_Combo (IOI18_combo)C++14
100 / 100
12 ms1972 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { vector<string> a = {"A", "B", "X", "Y"}; string ans = ""; if(!press(a[0] + a[1])){ if(!press(a[2])){ ans+=a[3]; } else{ ans+=a[2]; a[2] = a[3]; } } else{ if(!press(a[0])){ ans+=a[1]; a[1] = a[3]; } else{ ans+=a[0]; a[0] = a[3]; } } if(N==1) return ans; for (int i = 1; i < N - 1; i++) { int t = press(ans + a[0] + a[0] + ans + a[0] + a[1] + ans + a[0] + a[2] + ans + a[1]); if(t == i + 2){ ans+=a[0]; } else if(t == i + 1){ ans+=a[1]; } else{ ans+=a[2]; } } if(press(ans+a[0])==N){ ans+=a[0]; } else if(press(ans+a[1])==N){ ans+=a[1]; } else{ ans+=a[2]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...