# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
429520 | ak2006 | Jump (BOI06_jump) | Pypy 3 | 94 ms | 21392 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.
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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |