|
Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Olimpiada Kombetare 2010. Pergatiti: Evis Hoxha.
Сложность Альфа
Matrix
Given a matrix A ‘mxn’ with numbers 0 or 1. Write a program that finds a way from the top row to the botton one by following the neighbour '1'-s. Two '1'-s are called neighbor vertically or horizontally.
Input
Two integers are given, m and n, where 3<=m, n<=25. m shows number of rows, while n shows number of columns.
Output
Show FOUND if there can be found a way. Otherwise show NOT FOUND.
Input I
|
3 5
1 0 1 1 0
0 1 0 1 1
1 1 1 0 1 |
Output 1 |
FOUND |
Input II
|
3 5
1 0 1 1 0
0 1 0 1 0
1 1 1 0 1 |
Output II |
NOT FOUND |
Для отправки решений необходимо выполнить вход.
|