HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Albanian National Olympiads in Informatics > problem:


2010-3. 50300 - Matrix

Guest
• Discussion of problem (1)

Volume problems

• 2010-1. 50298 - Coins
• 2010-2. 50299 - Median
• 2010-3. 50300 - Matrix
• 2012-1. 50544 - Stock market
• 2012-2. 50545 - Diet
• 2012-3. 50721 - Palindrome
• 2012-4. 50680 - Triangle
• 2012-5. 50551 - Camelot
• 2013-1. 50591 - Leap year
• 2013-3. 50570 - Prime numbers in t...
• 2013-4. 50958 - ATM

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Olympiad 2010. Prepared by: Evis Hoxha. Difficulty Alpha

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

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

www.contester.ru