← All problemsSign in

Sereja and Two Arrays

CodeChefRating 2517Open on judge ↗

Sereja and Arrays Sereja have an array that consist of n integers a[1], a[2], ..., a[n]. Also Sereja have an array that consist of m integers b[1], b[2], ..., b[m]. Sereja make next operations: - random_shuffle(b) — shuffle elements of b - random_merge(a, b) — merge array a and b to array a. From all possible merges Sereja chooses a random one. For better understanding you can imagine, that

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start