Submission #587814

#TimeUsernameProblemLanguageResultExecution timeMemory
587814IvanJCombo (IOI18_combo)C++17
5 / 100
1 ms208 KiB
#include "combo.h" #include<bits/stdc++.h> #define all(a) (a).begin(), (a).end() using namespace std; string guess_sequence(int n) { string p = "", s = ""; if(press("A")) s = "A"; else if(press("B")) s = "B"; else if(press("X")) s = "X"; else s = "Y"; set<string> S; S.insert("A"), S.insert("B"), S.insert("X"), S.insert("Y"); S.erase(s); vector<string> v(all(S)); for(int i = 1;i < n - 1;i++) { p = s + v[0]; for(int j = 0;j < 3;j++) p += s + v[1] + v[j]; int x = press(p); if(x == (int)s.size() + 1) s += v[0]; else if(x == (int)s.size() + 2) s += v[1]; else s += v[2]; } if(press(s + v[0]) == n) s += v[0]; else if(press(s + v[1]) == n) s += v[1]; else s += v[2]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...