MIDO - KOSARK


 

Slavko has started to follow the NBA league. The game duration is exactly 48 minutes. When a game 
ends, the statistics are shown. Slavko has written down whenever a team scored. He is curious about 
how long each team was in the lead.  
INPUT 
The first line of input contains one integer N (1 ≤ N ≤ 100). The following N lines describe events 
when a team scored. 
Each description consists of a team that scored, which is either  1 or  2, and a timestamp in format 
MM:SS (minutes:seconds), the time when a team scored. Minutes and seconds are zero padded and 
from ranges [00, 47] and [00, 59] (inclusive). The given timestamps are unique. 
OUTPUT 
The first line of output must contain the duration that the first team was in the lead. 
The second line of output must contain the duration that the second team was in the lead. 
All durations should be in MM:SS format, with leading zeros

 

Slavko has started to follow the NBA league. The game duration is exactly 48 minutes. When a game 

ends, the statistics are shown. Slavko has written down whenever a team scored. He is curious about 

how long each team was in the lead.  

INPUT 

The first line of input contains one integer N (1 ≤ N ≤ 100). The following N lines describe events 

when a team scored. 

Each description consists of a team that scored, which is either  1 or  2, and a timestamp in format 

MM:SS (minutes:seconds), the time when a team scored. Minutes and seconds are zero padded and 

from ranges [00, 47] and [00, 59] (inclusive). The given timestamps are unique. 

OUTPUT 

The first line of output must contain the duration that the first team was in the lead. 

The second line of output must contain the duration that the second team was in the lead. 

All durations should be in MM:SS format, with leading zeros.

SAMPLE TESTS

 

input 

1 01:10 

2 21:10 

2 31:30 

output 

20:00 

16:30 

 

 

 


hide comments
nadstratosfer: 2017-10-23 16:35:00

A bit tedious but figured out an useful thing in the process. Test cases from comments prevented some headache, thanks fellas.

hunnychauhan: 2017-07-22 10:35:29

when 1 is in lead and further 1-1 takes place then it is not to be taken .....

Jaydeep Khandelwal: 2015-09-15 18:42:17

GREEN in one go.....

anshal dwivedi: 2015-08-13 15:26:27

Ahh..! finally AC one very silly mistake caused 2 WA.! nice problem

Mitesh Kothari: 2015-06-05 21:30:45

Nice problem ! :) But would be much better if timings are not provide in order!

---@@@----: 2015-06-01 05:34:40

nice question...
time is always given in order.. :)
Those who are getting WA should try following test cases :
3
2 01:10
2 21:10
1 31:30

2
1 01:00
1 47:59

:.Mohib.:: 2015-05-10 04:02:12

Yo....AC at one go.... :)

kartikay singh: 2015-04-07 13:35:18

Stuck at judge 12 :( plz help

Last edit: 2015-04-07 13:35:43
Master_Card: 2014-07-12 19:09:21

Stuck at judge 12.Plz Help

ritish: 2014-01-26 02:36:08

i'm also taking care of range but still WA at judge 12


Added by:Kawmia Institutes
Date:2011-02-16
Time limit:0.209s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:COCI