# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
659340 | Trisanu_Das | Jump (BOI06_jump) | Pypy 3 | 66 ms | 20912 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())
a = []
dp = []
for _ in range(n):
a.append([int(x) for x in input().split()])
dp.append([0] * n)
dp[0][0] = 1
for i in range(n):
for j in range(n):
if i < n - 1 and i + a[i][j] < n: dp[i + a[i][j]][j] += dp[i][j]
if j < n - 1 and j + a[i][j] < n: dp[i][j + a[i][j]] += dp[i][j]
print(dp[n-1][n-1])
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |