Submission #429520

#TimeUsernameProblemLanguageResultExecution timeMemory
429520ak2006Jump (BOI06_jump)Pypy 3
100 / 100
94 ms21392 KiB
n = int(input()) dp = [[0] * n for i in range(n)] dp[0][0] = 1 for i in range(n): arr = list(map(int,input().split())) for j in range(n): if arr[j] != 0 and arr[j] + i < n: dp[i + arr[j]][j] += dp[i][j] if arr[j] != 0 and arr[j] + j < n: dp[i][j + arr[j]] += dp[i][j] print(dp[n - 1][n - 1])
#Verdict Execution timeMemoryGrader output
Fetching results...