← All problemsSign in

Fat Hut

CodeChefRating 2898Open on judge ↗

There are $N$ breakfasts in the restaurant `“Fat Hut”` where the Chef works. The $i^{th}$ breakfast has an attractiveness $A_i$ and cost $C_i$. The Chef has noticed that nobody takes the $j^{th}$ breakfast if there exists at least one breakfast $i$ such that $A_i \ge A_j$ and $C_i \lt C_j$. In other words, if a breakfast is less attractive and more expensive than any of the other dishes, then

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