Help in ZCO Q1 Singing Tournament

I attempted the question Singing Tournament at https://www.codechef.com/ZCOPRAC/problems/SINGTOUR/

I submitted a brute force solution which fetched 15 points.

I’m unable to come up with an efficient solution for this question. Could someone please give me hints to solve this? I see that many users have solved the problem. I can’t find any editorial or hints.
Thanks!

@infinitepro

The editorial is here : SINGTOUR-Editorial
Unfortunately, I had not tagged it with the editorial tag, which must have been the reason for not finding the editorial. It has been fixed now!
:smile:

1 Like

Thank you!
I’ll go through it

CAN THE JAVA SOLUTION ALSO BE SHARED. MY SOLUTION SEEMS TO BE WORKING ON BLUE J AS WELL AS ON CODE CHEF BUT STILL MY SCORE REMAINS ZERO.
ALSO HOW AM I SUPPOSED TO DO SUBTASKS AS SEPERATE PROGRAMS OR SHOULD THEY BE INCLUDED IN SAME ONE. IF YES HOW?

PLEASE ANSWER MY QUERY AS SOON AS POSSIBLE ITS KINDA URGENT

Why the caps?
Sadly, I don’t know Java, so you are on your own, unless you read someone else’s JAVA code or somebody translates my code to java.

Can you define working?

I usually don’t debug others solutions, tho I could help you if my code is not understandable.

Subtasks are meant to be sub problems, or generalized versions of the actual problem that you are trying to solve. More specifically, you don’t need to code one solution for each subtask. So your solution for the last subtask will also (mostly) solve for all the previous subtasks (but not vice versa).

I think you mean specialized.

1 Like

thanks for the help about the subtask query.
by working I mean logic is right and it executes for all sorts of inputs but I guess there is something missing which is required for here like as a general part of the code…