Submission #445355

#TimeUsernameProblemLanguageResultExecution timeMemory
445355silverfishCombo (IOI18_combo)C++14
10 / 100
87 ms552 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define pb push_back set<char> st = {'A', 'B', 'X', 'Y'}; string guess_sequence(int n) { srand(time(0)); string ans=""; vector<char> c; for(char ch : st){ if(press(ans+ch)){ ans.pb(ch); for(char cch : st) if(cch != ch) c.pb(cch); break; } } for(int i = 1; i < n; ++i){ random_shuffle(c.begin(), c.end()); for(char ch : c){ if(press(ans + ch) == i+1){ ans.pb(ch); break; } } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...