Judge (2) P63370


Statement
 

pdf   zip

thehtml

To solve this exercise. use the same definitions of problem P14343.

Write a program that reads the submissions done in the Judge, and prints the following information:

  • The exercise with more green submissions (the exercise with the smallest identifier in a event of a tie, “-” if there is not any green submission).
  • The exercise with more students that have obtained a green (the exercise with the smallest identifier in a event of a tie, “-” if there is not any student with some green exercise).
  • The exercise with more students that have tried to solve it and have only obtained reds (the exercise with the smallest identifier in a event of a tie, “-” if there is not any student with any red exercise).
  • The exercise that more different students have tried to solve, with or without success (the exercise with the smallest identifier in a event of a tie, “-” if there is not any submission).
  • The exercise of the last submission (“-” if there is not any submission).

Input

Input consists of a natural n, followed by n 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 name of the 5 previously said exercises 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.

Public test cases
  • Input

    15
    40123456 TIPIC 1000 red
    40123456 TIPIC 2000 yellow
    40123456 TIPIC 3000 green
    77777777 GABY  5100 yellow
    11223344 FOFO  2300 yellow
    11223344 FOFO  1500 red
    40123456 FOFO  5000 green
    40123456 FOFO  4000 green
    40123456 FOFO  4400 green
    11223344 TIPIC 9600 green
    11223344 KITO  9000 yellow
    11223344 GABY  8200 red
    77777777 KITO  6000 green
    77777777 FOFO  7000 green
    77777777 TIPIC 8000 green
    

    Output

    exercise with more green submissions:   FOFO (4)
    exercise with more green students:      TIPIC (3)
    exercise with more red students:        GABY (1)
    exercise that more students have tried: FOFO (3)
    exercise of the last submission:        TIPIC
    
  • Input

    1
    00110011 TIPIC 100 yellow
    

    Output

    exercise with more green submissions:   -
    exercise with more green students:      -
    exercise with more red students:        -
    exercise that more students have tried: TIPIC (1)
    exercise of the last submission:        TIPIC
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++