#P7632. [COCI 2010/2011 #5] KOŠARKA
[COCI 2010/2011 #5] KOŠARKA
Description
Slavko has started following the NBA. A game lasts exactly minutes. After a game ends, statistics are shown. Every time a team scores, Slavko writes it down. He is curious about how long each team stays in the lead.
Input Format
The input consists of lines.
The first line contains an integer , the number of events.
The next lines describe the moments when a team scores.
Each line contains the team that scored ( or ) and a time.
The time format is . If the minutes or seconds are , they are padded with a leading .
Output Format
The first line outputs the total time during which Team is in the lead.
The second line outputs the total time during which Team is in the lead.
All durations should be in format, with leading zeros.
1
1 20:00
28:00
00:00
3
1 01:10
2 21:10
2 31:30
20:00
16:30
5
1 01:10
1 02:20
2 45:30
2 46:40
2 47:50
45:30
00:10
Hint
Sample Explanation #1
Team scores a point at exactly minutes, making the score , and takes the lead.
During the next minutes, Team does not score, so Team keeps the lead the whole time.
Constraints
For of the testdata, , minutes , seconds .
Notes
The score for this problem follows the original COCI settings, with a full score of .
Translated from COCI2010-2011 CONTEST #5 T2 KOŠARKA.
Translated by ChatGPT 5
京公网安备 11011102002149号