ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > CEN303_2016Questions > задача:


HW111. 50506 - The Biggest Island

CEN303_2016Questions

Старт: 28.окт.2016 в 17:00:00
Финиш: 01.ноя.2016 в 05:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (3)

Задачи турнира

• HW071. 51042 - The most frequent ...
• HW072. 51043 - Genome Sequencing
• HW081. 51044 - Number of Trees
• HW082. 50699 - Fighting Vampires
• HW083. 50671 - Phalanx
• HW091. 51061 - The Longest Path
• HW101. 50682 - Hotel Durres
• HW102. 51067 - Jumping frog
• HW111. 50506 - The Biggest Isl...
• HW112. 50698 - Ayran Delivery
• PE11. 51023 - Preparing Keyword I...
• PE12. 50835 - Club Presidency
• PE13. 51024 - Total Stock Price
• PE14. 50998 - CEN112 Homework, ...
• PE21. 51071 - Phalanx-2
• PE22. 51072 - Castle on chessboard
• RE1. 51079 - Key person - 2

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 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


Для отправки решений необходимо выполнить вход.

www.contester.ru