← All problemsSign in

Chef and medium problem

CodeChefRating 2778Open on judge ↗

Chef has an array. The size of the array is equal to N. Chef wants to make M queries. Each query has one of the two types: - 1 l r - Calculate some interesting function F for subarray indexed from l to r inclusive. - 2 l r - Modify the given array by removing all elements having indices in range from l to r and then putting these numbers at the beginning of array. Order of all other elements r

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