a = int(input())
matrix= []
for i in range(a):
temp = [int(x) for x in input().split()]
matrix.append(temp)
path = []
for i in range(a):
temp = []
for j in range(a):
temp.append(0)
path.append(temp)
for i in range(a):
for j in range(a):
if(i+matrix[i][j] <= a-1):
path[i][j]+=1
if(i-matrix[i][j] <= a-1):
path[i][j]+=1
if(j+matrix[i][j] <= a-1):
path[i][j]+=1
if(j-matrix[i][j] <= a-1):
path[i][j]+=1
print(path[a-1][a-1]-1)
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
22 ms |
3300 KB |
Output isn't correct |
2 |
Incorrect |
22 ms |
3308 KB |
Output isn't correct |
3 |
Incorrect |
22 ms |
3308 KB |
Output isn't correct |
4 |
Incorrect |
24 ms |
3372 KB |
Output isn't correct |
5 |
Incorrect |
22 ms |
3308 KB |
Output isn't correct |
6 |
Incorrect |
24 ms |
3308 KB |
Output isn't correct |
7 |
Incorrect |
24 ms |
3300 KB |
Output isn't correct |
8 |
Incorrect |
24 ms |
3368 KB |
Output isn't correct |
9 |
Incorrect |
25 ms |
3368 KB |
Output isn't correct |
10 |
Incorrect |
23 ms |
3368 KB |
Output isn't correct |
11 |
Incorrect |
27 ms |
3436 KB |
Output isn't correct |
12 |
Incorrect |
31 ms |
3368 KB |
Output isn't correct |
13 |
Incorrect |
25 ms |
3360 KB |
Output isn't correct |
14 |
Incorrect |
25 ms |
3436 KB |
Output isn't correct |
15 |
Incorrect |
32 ms |
3368 KB |
Output isn't correct |
16 |
Incorrect |
40 ms |
3368 KB |
Output isn't correct |
17 |
Incorrect |
44 ms |
3488 KB |
Output isn't correct |
18 |
Incorrect |
45 ms |
3488 KB |
Output isn't correct |
19 |
Incorrect |
46 ms |
3496 KB |
Output isn't correct |
20 |
Incorrect |
49 ms |
3496 KB |
Output isn't correct |