Submission #477046

#TimeUsernameProblemLanguageResultExecution timeMemory
477046Genius3435Combo (IOI18_combo)C++17
10 / 100
62 ms420 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; using namespace string_literals; const int t = chrono::high_resolution_clock::now().time_since_epoch().count(); inline int gen(int i) { static mt19937 rng = mt19937(t%10000/10); return rng() % i; } string guess_sequence(int N) { string cur = ""; cur.reserve(N); // Find first character (essentially random, so check each one) for (const char c: "ABXY") { if (press(""s+c)) { cur += c; break; } } for (int i = 1; i < N; ++i) { char s[5] = "ABXY"; random_shuffle(s, s+4, gen); for (const char c: s) { if (c == cur[0]) continue; cur += c; if (press(cur) == i+1) break; cur.pop_back(); } } return cur; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...