Submission #199502

#TimeUsernameProblemLanguageResultExecution timeMemory
199502monus1042Combo (IOI18_combo)C++17
10 / 100
88 ms432 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string aux("ABXY"); string use=""; string S=""; int coins=0; for (int i=0; i<4; i++){ string gg; gg.push_back(aux[i]); coins=press(gg); if (coins){ S+=aux[i]; for(int j=0; j<4; j++) if (aux[j]!=aux[i]) use.push_back(aux[j]); break; } } while((int)S.size()!=N){ for (int i=0; i<3; i++){ S+=use[i]; int ne=press(S); if (ne==coins+1){ coins=ne; break; }else S.pop_back(); } } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...