Submission #414861

#TimeUsernameProblemLanguageResultExecution timeMemory
414861Mohammed_AtalahCombo (IOI18_combo)C++17
10 / 100
64 ms540 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { char cs[4] = {'A', 'B', 'X', 'Y'}; string res = ""; for (int i = 0; i < 4; i++) { string s = ""; s += cs[i]; s += cs[i]; if (press(s) == 1) { res += cs[i]; cs[i] = '0'; // cout << res << endl; break; } } if (N == 1) { return res; } for (int i = 1; i < N; i++) { for (int e = 0; e < 4; e++) { if (cs[e] == '0') { continue; } string check = res; check += cs[e]; // cout << check; if (press(check) == i + 1) { res += cs[e]; break; } } } // cout << res << endl; return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...