Zeros sota la diagonal


Submit solution

Points: 10
Time limit: 5.0s
Memory limit: 256M

Author:
Problem types
Allowed languages
C#, Go, Java, Python

Donada una matriu quadrada de nombres, digues si tots els nombres per sota de la diagonal són 0.

Input Format

El primer nombre N que indica el tamany de la matriu.

A continuació venen els nombres de la matriu.

Constraints

-

Output Format

{ SI | NO }

Test Case 1

Input
2
1 2
0 4
Output
SI

Test Case 2

Input
3
0 0 0
0 0 0
0 0 0
Output
SI

Test Case 3

Input
4
1 2 3 4
0 2 3 4
0 0 3 4
0 0 0 4
Output
SI

Test Case 4

Input
3
0 0 0
1 0 0
0 0 0
Output
NO

Test Case 5

Input
3
0 0 0
0 1 0
0 0 0
Output
SI

Test Case 6

Input
3
0 0 0
0 0 0
1 0 0
Output
NO

Test Case 7

Input
3
0 0 0
0 0 0
0 1 0
Output
NO

Test Case 8

Input
5
11 12 13 14 15
21 22 23 24 25
31 32 33 34 35
41 42 43 44 45
51 52 53 54 55
Output
NO

Test Case 9

Input
5
11 12 13 14 15
 0 22 23 24 25
 0  0 33 34 35
 0  0  0 44 45
 0  0  0  0 55
Output
SI

Test Case 10

Input
2
1 2 0 3
Output
SI
Explanation
1 2 0 3   =>    1 2
                0 3

Test Case 11

Input
3
1 2 3 0 4 5 0 0 6
Output
SI
Explanation
                         1 2 3
1 2 3 0 4 5 0 0 6   =>   0 4 5
                         0 0 6

Test Case 12

Input
9
 1  5  7  3  6  4  0  0  9 
 0  7  8  5  0  9  3  6  3 
 0  0  6  8  9  6  8  1  5 
 0  0  0  3  4  8  8  5  9 
 0  0  0  0  0  1  8  8  8 
 0  0  0  0  0  8  7  3  1 
 0  0  0  0  0  0  1  3  4 
 0  0  0  0  0  0  0  0  6 
 0  0  0  0  0  0  0  0  2
Output
SI

Test Case 13

Hidden: this is a private test case!

Test Case 14

Hidden: this is a private test case!

Test Case 15

Hidden: this is a private test case!

Test Case 16

Hidden: this is a private test case!


Authorship: Gerard Falcó

CC BY-NC-SA 4.0