Answer the question
In order to leave comments, you need to log in
Olympiad problem about People. How to solve this problem?
There are N people and integers A1, ..., AN; person i must be introduced to people ai. Can it be done?
Answer the question
In order to leave comments, you need to log in
I see that you have all the questions about the Olympiad problems, but it’s hard to answer them.
My advice is to take problems where you can find their analysis and / or see solutions, like on codeforces .
Here is the solution to this problem in python3:
xy = ({""}, {""})
for _ in range(int(input())):
for i, t in enumerate(input().split()):
xy[i].add(t)
print(max(map(len, xy)) // 2)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question