Submission #1144424

#TimeUsernameProblemLanguageResultExecution timeMemory
1144424crispxxCombo (IOI18_combo)C++20
10 / 100
10 ms408 KiB
#include <bits/stdc++.h> #include "combo.h" // #include "grader.cpp" using namespace std; #define all(x) x.begin(), x.end() #define nl '\n' string guess_sequence(int n) { vector<char> F {'B', 'X', 'Y'}; string p(n, 'A'); int pf = 0; if(press(p)) { p = string(n, 'B'); p[0] = 'A'; pf = 1; F.erase(find(all(F), 'B')); } if(!pf) { for(int i = 0; i < 2; i++) { p[0] = F[i]; int u = press(p); if(u) { p[0] = F[i]; pf = u; F.erase(find(all(F), F[i])); break; } } } if(!pf) { p[0] = F[2]; pf = 1; F.erase(find(all(F), F[2])); } pf = press(p); for(int i = 0; i < n; i++) { if(i < pf) continue; for(int j = 0; j < 2; j++) { p[i] = F[j]; int u = press(p); if(u - pf > 0) { pf = u; break; } } } // cout << p << nl; return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...