Submission #1289430

#TimeUsernameProblemLanguageResultExecution timeMemory
1289430andreimCombo (IOI18_combo)C++20
5 / 100
1 ms392 KiB
#include "combo.h" #include <random> using namespace std; // 0 : A, 1 : B, 2 : X, 3 : Y mt19937 rng(42); char toBoutons[4] = {'A', 'B', 'X', 'Y'}; string genRandom(int N, string old) { string S = ""; do { S = ""; for (int i = 0; i < N; i++) S += toBoutons[uniform_int_distribution<int>(0, 3)(rng)]; } while (old[(int)old.length() - N + 1] == S[0]); return S; } string extractGood(int N, string S) { string res; for (int i = 0; i < N; i++) res += S[i]; return res; } string guess_sequence(int N) { int coinsPrec = 0; string p = ""; while (coinsPrec < N) { p = extractGood(coinsPrec, p) + genRandom(N - coinsPrec, p); coinsPrec = press(p); } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...