HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Linear Data Structures: Arrays > problem:


50300 - Matrix

Guest
• Discussion of problem (1)

Section problems

• 50382 - Parkside's Other Triangle
• 51171 Question 3
• 51093 - rgb2gray
• 51165 Question 1
• 51175 Question 2
• 51092 - Even and Odd
• 51095 - Normal and Trace
• 50423 - Numbers square
• 50300 - Matrix
• 50319 - Toll Plazas
• 50977 - Gaussian Elimination
• 50380 - Sum of the Numbers in the ...
• 50318 - Product Info
• 50326 - Matrix Operations
• 50395 - Page "Like" Averages
• 50410 - Zero Padding
• 50329 - Draw Matrix-1

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