Submission #873353

#TimeUsernameProblemLanguageResultExecution timeMemory
873353bobbilykingJump (BOI06_jump)Cpython 3
100 / 100
19 ms3420 KiB
n = int(input()) arr = [list(map(int, input().split())) for _ in range(n)] dp = [[0 for _ in range(n)] for _ in range(n)] dp[0][0]=1 arr[n-1][n-1] = 2 # print("\n".join(' '.join(str(x) for x in v) for v in arr)) for i in range(n): for j in range(n): if i + arr[i][j] < n: dp[i+arr[i][j]][j]+=dp[i][j] if j + arr[i][j] < n: dp[i][j+arr[i][j]]+=dp[i][j] # print(' '.join(str(x) for x in dp[i])) print(dp[n-1][n-1])
#Verdict Execution timeMemoryGrader output
Fetching results...