Judge (1)

Consider the definition

    struct Submission {
        string idn;
        string exer;
        int time;
        string res;
    };

for the results of the submissions done in the Judge of P1, where @idn@ identifies the student who has done the sending (is a string of 9 digits), @exer@ is the identifier of the exercise (a string of 4 or 5 characters), @time@ is the moment of the sending (in seconds since the overture of the Judge), and @res@ is the result of the sending, which can be “green”, “yellow” or “red”.

Consider also the definition

    typedef vector<Submission> History;

to store all the submissions done in the Judge of P1. Two submissions never have the same field @time@.

Use these definitions in a program that reads all the submissions done in the Judge, and prints the following information:

Input

Input consists of a natural nn, followed by nn submissions, each one in a line, with the fields in the same order than in the definition of the type. Suppose that there are, at most, 20 students, 50 exercises and 1000 submissions.

Output

Your program must print the five previously said idn with the corresponding counters following the format of the instance.

Observation

This exercise is quite long. To compensate, it is not necessary that the sent solution is particularly efficient.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T10:09:17.353Z

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