Computer Science, asked by greeshma021999, 10 months ago

Problem Statement
Discussions
My Submissions
Rajat and Food Party (100 Marks)
Rajat has just finished school and decided to go to a party with friends. In the party, he declares that he will start
eating food items with low-calorie content like bread and then will move to items that contain more calories like the
burger, until there is no food left(he will start eating in such a manner that he will eat high-calorie content only after
finishing low-calorie content). Once Rajat starts to eat the burger he will not eat a burger again, so the calorie content
of the food never decreases with time i.e. he can eat any food one time only.
You should help Rajat by indicating an order in which he can eat the foods in the way he wishes.
Input Format
Each test case starts with N, the number of available food items.
Next N lines follow, mentioning the name of each food, where a name has less than 51 characters and has no white
spaces.
Then there is another line with an integer Mand M lines in the form F1 F2 will follow, indicating that food F2 has
more calorie that food F1, so Rajat should eat food F1 before he starts eating food F2.
Be sure that this relation is transitive.
Constraints
1 <=N<= 100
0 <= M <= 200


SimranPanda: hi
SimranPanda: yup

Answers

Answered by nova56
4

Answer:

hey can u attach the required attachment message me down in comments


nova56: sis ☺️
SimranPanda: hm
SimranPanda: bye
nova56: bye ☺️
nova56: hope so I helped u sis ☺️
SimranPanda: yup
nova56: :)
nova56: sis ☺️
SimranPanda: ☺☺.
nova56: ahhh
Similar questions