Median Time Limit: 1 Second Memory Limit: 65536 KB Recall the definition of the median of elements where is odd: sort these elements and the median is the -th largest element. In this problem, the exact value of each element is not given, but relatio…
Description We know that if a phone number A is another phone number B’s prefix, B is not able to be called. For an example, A is 123 while B is 12345, after pressing 123, we call A, and not able to call B. Given N phone numbers, your task is to find…
Description Both Saya and Kudo like balloons. One day, they heard that in the central park, there will be thousands of people fly balloons to pattern a big image. They were very interested about this event, and also curious about the image. Since the…
G.Code the Tree Time Limit: 2 Sec Memory Limit: 128 MB Submit: 35 Solved: 18 [Submit][Status][Web Board] Description A tree (i.e. a connected graph without cycles) with vertices numbered by the integers 1, 2, ..., n is given. The "Prufer" code…