Submission #313654

#TimeUsernameProblemLanguageResultExecution timeMemory
313654analyticalprogrammerJump (BOI06_jump)Cpython 3
0 / 100
49 ms3496 KiB
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 timeMemoryGrader output
Fetching results...