CEN303_2016Questions |
Старт: 28.окт.2016 в 17:00:00
Финиш: 01.ноя.2016 в 05:00:00
Турнир завершён!
• Турнирная таблица
|
|
Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. 14-Spr2-70.
The Highest Peak of the Biggest Island
Indonesia is known as the country with the most number
of islands. There are around 17,000 islands there.
According to a new plan, government wants to build
a new army base on one of the biggest islands.
Because there are too many islands, it's
difficult to make an on site research through the islands.
For this purpose, they have taken satellite images
and want to find the biggest island. Satellite images
are nxm rectangular images having positive and
negative integers. Positive integers represent
the land spaces while zero and negative values represent
sea.
Question:
Write a program that accepts a rectangular satellite
image and finds the area of and highest peak of
the biggest island. Note:
None of the biggest area is bigger than 500.
Input specification
You will be first given two integers (n and m) which are
sides of the rectangular image.
Then, the following n lines will have comma separated
m integers where 1 ≤ (n, m) ≤ 150. The integers
in the rectangle vary between -200 and +200.
Output specification
Show two integers:
- the area of the biggest island
- the highest peak of it
Note: If there are several
islands with the same area show the one highest peak.
Sample Input
6 6
45, 30, -1, 2, 13, 24,
25, 17, -6, 5, 17, 30,
0, 3, -7, -2, 15, 32,
-6, -8, -1, -3, -2, 5,
-1, 5, -2, 3, 3, -4,
4, 8, -1, 5, 6, -17,
|
Sample Output
9 32
|
Для отправки решений необходимо выполнить вход.
|