#P7426. [THUPC 2017] 体育成绩统计

[THUPC 2017] 体育成绩统计

Description

For freshmen, the overall score of the physical education course consists of five parts: the course-specific score (full mark 5050), the long-distance run test score (full mark 2020), the “Sunshine Long Run” score (full mark 1010), the physical fitness test score (full mark 1010), and the “Freshman Special Program” score (full mark 1010).

The course-specific score is given directly by the PE teacher.

The long-distance run test score is determined by the final long run test. Boys need to run 30003000 meters, and girls need to run 15001500 meters. The scoring standard is:

2020 1818 1616 1414 1212 1010 88 66 44 22
Boys 123012'30'' 130013'00'' 133013'30'' 140014'00'' 143014'30'' 151015'10'' 155015'50'' 163016'30'' 171017'10'' 180018'00''
Girls 6406'40'' 6576'57'' 7147'14'' 7317'31'' 7507'50'' 8058'05'' 8208'20'' 8358'35'' 8508'50'' 9009'00''

“Sunshine Long Run” uses a mobile App to record students’ extracurricular long running. By filtering the raw running data, we obtain the number of valid extracurricular runs, and then determine the score for this part.

A valid exercise record must satisfy all of the following:

  • For boys, the running distance is at least 30003000 meters (including 30003000 meters). For girls, the running distance is at least 15001500 meters (including 15001500 meters).
  • The average speed (distance / (end time - start time)) is not slower than 22 meters per second and not faster than 55 meters per second.
  • The total pause time must not exceed 44 minutes 3030 seconds.
  • The average stride length (distance / number of steps) must not exceed 1.51.5 meters.
  • The start time must be at least 66 hours (including 66 hours) later than the end time of the previous valid record.

The correspondence between the number of valid “Sunshine Long Run” records and the score for this part is:

Score 1010 99 88 77 66 44 22
Count [21,+)[21,+\infty) [19,20][19,20] [17,18][17,18] [14,16][14,16] [11,13][11,13] [7,10][7,10] [3,6][3,6]

For the physical fitness test part, if the student meets the passing standard, they get the full 1010 points for this part; otherwise, they get 00 points for this part.

The 1010 points of the “Freshman Special Program” consist of two parts: attendance counts for 55 points, and the final assessment for 55 points.

The attendance count is the sum of the number of times participating in the “Class Training Camp” and the number of valid “Sunshine Long Run” records. The correspondence between the attendance score and the attendance count is:

Score 55 44 33 22 11
Count [18,+)[18,+\infty) [15,17][15,17] [12,14][12,14] [9,11][9,11] [6,8][6,8]

It is not hard to see that accurately calculating everyone’s PE score is not an easy task. Therefore, the PE department teacher came to you, who are participating in the on-campus contest. He will provide all the data needed and hopes you can help compute each Tsinghua freshman’s overall PE score (on a percentage scale) and grade.

The correspondence between percentage scores and grades (and GPA) is:

A A- B+ B B- C+ C C- D+ D F
[95,100][95,100] [90,95)[90,95) [85,90)[85,90) [80,85)[80,85) [77,80)[77,80) [73,77)[73,77) [70,73)[70,73) [67,70)[67,70) [63,67)[63,67) [60,63)[60,63) [0,60)[0,60)

Input Format

Read data from standard input.

The first line contains a positive integer nn, the number of freshman students.

The next nn lines each describe one student (given in lexicographical order of student ID), with items separated by spaces. The data for one student include:

  • A positive integer pp of length 1010 (guaranteed to have no leading zeros), representing the student ID of the ii-th student.
  • A character, M or F. M means the ii-th student is male, and F means the ii-th student is female.
  • A non-negative integer ss between 00 and 5050, representing the course-specific score of the ii-th student.
  • A string in the form a'b" indicating that the ii-th student’s final long run test time is aa minutes bb seconds.
  • A character, P or F. P means the ii-th student passes the physical fitness test, and F means the ii-th student does not pass.
  • A non-negative integer ff between 00 and 55, representing the final assessment score of the ii-th student in the “Freshman Special Program.”
  • A non-negative integer cc, representing the number of times the ii-th student participated in the “Class Training Camp.”

The next line contains a non-negative integer mm, the number of “Sunshine Long Run” records that need to be filtered.

The next mm lines each describe one “Sunshine Long Run” record to be filtered (given in order of start time), with items separated by spaces. Each record includes:

  • A string in the form 2017MMDD, representing the completion date of the jj-th record.
  • A positive integer pp of length 1010 (guaranteed to have no leading zeros), representing the source student ID of the jj-th record.
  • Two strings in the form hh:mm:ss, representing the start time and end time of the jj-th record, respectively.
  • A non-negative floating-point number ll accurate to two digits after the decimal point, representing the exercise distance of the jj-th record in kilometers.
  • A string in the form a'b" indicating that the total pause time of the jj-th record is aa minutes bb seconds.
  • A non-negative integer ss, representing the total number of steps of the jj-th record.

The input format can be referred to in the sample file provided.

Output Format

Output to standard output.

The output contains nn lines. Please output, in lexicographical order of student ID, each student’s student ID, overall score on a percentage scale, and grade. Each student occupies one line, with items separated by spaces.

1
2015011233 M 34 14'30" P 3 3
8
20170508 2015011233 17:02:33 17:19:33 2.99 0'0" 3333
20170509 2015011233 17:12:15 17:38:46 3.01 2'3" 4300
20170510 2015011233 22:03:06 22:13:08 3.05 0'0" 2772
20170511 2015011233 22:08:05 22:28:13 3.02 5'3" 3775
20170512 2015011233 18:03:12 18:17:56 3.02 0'0" 2001
20170513 2015011233 17:30:23 17:46:08 3.01 0'0" 3020
20170513 2015011233 22:03:34 22:20:08 3.04 2'0" 3058
20170514 2015011233 07:16:22 07:32:34 3.00 0'0" 3244
2015011233 59 F

Hint

For 100%100\% of the testdata, $n\le 10^4,0\le a,b\le 59,0\le c\le 100,m\le 1.5\times 10^5,0\le l\le 100,0\le s\le 10^6$。

From THUPC (THU Programming Contest) 2017.

Translated by ChatGPT 5