Submission #328843

#TimeUsernameProblemLanguageResultExecution timeMemory
328843xiaowuc1Jump (BOI06_jump)Cpython 3
100 / 100
35 ms3436 KiB
n = int(input()) g = [] dp = [] for _ in range(n): g.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 + g[i][j] < n: dp[i+g[i][j]][j] += dp[i][j] if j < n-1 and j + g[i][j] < n: dp[i][j+g[i][j]] += dp[i][j] print(dp[n-1][n-1])
#Verdict Execution timeMemoryGrader output
Fetching results...