Repetitions, conflicts and coincidences in a list of people

Given a list of people described by an identifier and a name, you must count three things:

Input

The input consists of several cases. Each case starts with a positive natural nn in a separate line, which is the number of people. After that come nn lines, each one with a natural number and a string, which are the identifier and name of a person. At the end there is a blank line.

Output

For each case, the output has three natural numbers in one line, the number of repetitions, conflicts and coincidences in the list of people at the input.

Observation

Evaluation over 10 points:

It is understood that a fast solution is correct, with nlog(n)n\log(n) cost and passes all test cases, both public and private. A slow solution is defined as one that is not fast, but it is correct and passes the public test cases.

Problem information

Author: PRO1

Generation: 2026-01-25T16:01:43.655Z

© Jutge.org, 2006–2026.
https://jutge.org