# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
313654 | analyticalprogrammer | Jump (BOI06_jump) | Cpython 3 | 49 ms | 3496 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |