#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 ), the long-distance run test score (full mark ), the “Sunshine Long Run” score (full mark ), the physical fitness test score (full mark ), and the “Freshman Special Program” score (full mark ).
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 meters, and girls need to run meters. The scoring standard is:
| Boys | ||||||||||
| Girls |
“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 meters (including meters). For girls, the running distance is at least meters (including meters).
- The average speed (distance / (end time - start time)) is not slower than meters per second and not faster than meters per second.
- The total pause time must not exceed minutes seconds.
- The average stride length (distance / number of steps) must not exceed meters.
- The start time must be at least hours (including 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 | |||||||
|---|---|---|---|---|---|---|---|
| Count |
For the physical fitness test part, if the student meets the passing standard, they get the full points for this part; otherwise, they get points for this part.
The points of the “Freshman Special Program” consist of two parts: attendance counts for points, and the final assessment for 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 | |||||
|---|---|---|---|---|---|
| Count |
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 |
|---|---|---|---|---|---|---|---|---|---|---|
Input Format
Read data from standard input.
The first line contains a positive integer , the number of freshman students.
The next 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 of length (guaranteed to have no leading zeros), representing the student ID of the -th student.
- A character, M or F. M means the -th student is male, and F means the -th student is female.
- A non-negative integer between and , representing the course-specific score of the -th student.
- A string in the form
a'b"indicating that the -th student’s final long run test time is minutes seconds. - A character, P or F. P means the -th student passes the physical fitness test, and F means the -th student does not pass.
- A non-negative integer between and , representing the final assessment score of the -th student in the “Freshman Special Program.”
- A non-negative integer , representing the number of times the -th student participated in the “Class Training Camp.”
The next line contains a non-negative integer , the number of “Sunshine Long Run” records that need to be filtered.
The next 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 -th record. - A positive integer of length (guaranteed to have no leading zeros), representing the source student ID of the -th record.
- Two strings in the form
hh:mm:ss, representing the start time and end time of the -th record, respectively. - A non-negative floating-point number accurate to two digits after the decimal point, representing the exercise distance of the -th record in kilometers.
- A string in the form
a'b"indicating that the total pause time of the -th record is minutes seconds. - A non-negative integer , representing the total number of steps of the -th record.
The input format can be referred to in the sample file provided.
Output Format
Output to standard output.
The output contains 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 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$。
Copyright Information
From THUPC (THU Programming Contest) 2017.
Translated by ChatGPT 5
京公网安备 11011102002149号