← All problemsSign in

Spooky Sequences

CodeChefRating 2304Open on judge ↗

*“I am not a witch. I’m your wife.” \- Valerie, The Princess Bride* Once upon a time, in a distant land, a mischievous witch spied on a group of people who were enjoying their time together. Enveloped by a dark desire, she resolved to put an end to their merry gatherings and kill all $N$ people. There are $N$ people, and the witch knows that the $i$-th of them has a strength of $A_i$. The

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