Submission #417872

#TimeUsernameProblemLanguageResultExecution timeMemory
417872LouayFarahCombo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "bits/stdc++.h" #include "combo.h" using namespace std; #define pb push_back int press(string p); string guess_sequence(int n) { string res = ""; string temp = "ABXY"; for(int i = 0; i<3; i++) { string tr = ""; tr.pb(temp[i]); if(press(tr)==1) { res.pb(temp[i]); break; } } if(res.length()==0) res.pb('Y'); string used = ""; for(int i = 0; i<4; i++) { if(res[0]==temp[i]) continue; used.pb(temp[i]); } for(int i = 2; i<=n; i++) { string s = ""; s = s + res[0] + used[0]; s = s + res[0] + used[1] + used[0]; s = s + res[0] + used[1] + used[1]; s = s + res[0] + used[1] + used[2]; int k = press(s); if(k==(int)res.size()) res.pb(used[2]); else if(k==(int)res.size() + 1) res.pb(used[0]); else res.pb(used[1]); } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...