2 Basic Problems
Language flexibility is given :- you can do it in java, python. Only condition is that you have to use only the basic libraries
Here are the time and space constraints and description for the problems:
1st problem:
Time Limit: 2 seconds
• Memory Limit: 256 Megabytes
persons are playing in playgrounds. At sunset persons come back to the home. We want to know which person(s) reaches the home the fastest.
Each Person is in some playground and some playgrounds may be empty. There are paths between
some pair of playgrounds (it is possible that two playgrounds have more than one path connecting them.) Starting from any playground a person can reach the home. persons are smart and they
always choose the shortest path to the home.
All persons move with a same constant speed, and multiple persons can use a same path at the same time. The
playground names are a small or capital English letter, i.e. a . . . z and A . . . Z . Before the sunset ,
a playground has a capital letter name if and only if a person is in it. The home is labeled as z and there is
no person in it before the sunset.
Input
• Line 1: Integer number P. (Number of paths that connect the playgrounds.)
• Lines 2 to P+1: Two letters and an integer number in each line, representing a path and the time it takes
the persons to pass it.
1 ≤ P ≤ 10^4
1 ≤ distance ≤ 1^03
Output
One line containing one letter and one integer number, representing any meadow whose cow(s) reaches the
stable the fastest (therefore definitely a capital letter) and the amount of time it take these cow(s) to reach the
stable.
Sample Test Cases
• Input
5
A d 9
B d 3
C e 9
d z 8
e z 3
• Output
B 11
2 Problem:
Time Limit: 2 seconds
• Memory Limit: 256 Megabytes
i will give you second one when you finish the first one, that is very easy and it is maximization problem.