Petya and Sequence
Little Petya likes integer numbers a lot. Recently he has received a sequence of integers as a gift from his mother. Petya calls a sequence of N integers Ai beautiful if there exist a sequence of N integer numbers Bi for which the following conditions hold: - At least one number Bi differs from 0. - For every j from 0 to N-1 the following holds: A0* Bj + A1* B(j + 1) mod N + ... + AN-1* B(j + N
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