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:
The student with more green submissions. (the student with
smallest idn in a event of a tie, “-” if there is not any
green submission).
The student with more green exercises (the student with smallest
idn in a event of a tie, “-” if there is not any green
exercise).
The student with more red exercises (the student with smallest
idn in a event of a tie, “-” if there is not any red
exercise).
The student who has tried to solve (with or without success) more
different exercises (the student with smallest idn in a event of a tie,
“-” if there is not any submission).
The student who has done the last submission “-” if
there is not any submission).
Input consists of a natural , followed by 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.
Your program must print the five previously said idn with the corresponding counters following the format of the instance.
This exercise is quite long. To compensate, it is not necessary that the sent solution is particularly efficient.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T10:09:17.353Z
© Jutge.org, 2006–2026.
https://jutge.org