Random Number Generator
You may know how to write a random number generator (RNG) after solving this problem (SEAPROAR). Another way to write a RNG is to use linear recurrence relation. e.g. let's consider the following linear recurrence: Ai = (Ai−1 × C1 + Ai−2 × C2 + ... + Ai−k × Ck) mod 104857601, for i = k+1, k+2, ..., where k is a positive integer. You are given initial values A1, A2, ..., Ak and the coefficients
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start