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
Hitman: 2013-12-22 23:19:50

mazaa aa gya AC at 1 go !!!
nice & easy

Piyush Subedi: 2013-06-08 17:09:21

judge 12 driving me crazy! =.= assistance needed!...

BLANKRK: 2013-05-25 13:00:25

nice! nice! nice!
got accept in 2nd chance :D
cost 1 WA bcz of missng one condsn :P

Eduardo Nunes: 2013-04-28 13:08:26

AC thanks to Robert Milijaš comment ;-)
@Paul Draper, agreed

Haijun Deng: 2013-04-17 02:48:05

Still WA with the following Test Cases:
3
1 01:40
2 02:20
1 03:10

output
45:30
00:00

Last edit: 2013-04-17 02:52:26
kamalesh: 2012-12-27 14:54:21

enjoyed solving this!!!

Paul Draper: 2012-12-20 01:40:28

I recommend changing the sport to soccer. The points per scoring are ASSUMED TO BE ALWAYS THE SAME (i.e. not basketball).

To @Mohammed Khairy and @Andy William: the times are given in order.

Robert Milija┬╣: 2012-12-07 18:48:26

Watch out! Make sure that you print ALL THE ZEROES!
Input:
3
1 01:00
2 20:00
2 47:56

Output:
19:00
00:04

DEVANSH PARASHAR: 2012-09-30 12:59:12

some problem in judge 12
edit>>finally a green light for those who are stuck at judge 12 read and try to understand the format of output carefully and then evaluate the range of output

Last edit: 2012-09-30 19:15:06

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