← All problemsSign in

Little Elephant and Movies

CodeChefRating 2293Open on judge ↗

Little Elephant from Zoo of Lviv likes to watch movies. There are N different movies (numbered from 0 to N − 1) he wants to watch in some order. Of course, he will watch each movie exactly once. The priority of ith movie is Pi. A watching of a movie is called exciting if and only if one of the following two conditions holds: - This is the first watching. - The priority of this movie is strict

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