← All problemsSign in

Chefina and Dishes

CodeChefRating 2831Open on judge ↗

There are $N$ chefs (numbered $1$ through $N$) and $M$ dishes (numbered $1$ through $M$). For each valid $i$, the $i$-th chef can cook dishes of exactly one type $F_i$. Also, each chef is a friend of $K$ different chefs. Whenever some chef cooks a dish, he asks all chefs who either are his friends or know how to cook this dish to evaluate the dish. No chef may evaluate his own dish. All 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