| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1326858 | Faisal_Saqib | Jump (BOI06_jump) | C++20 | 2 ms | 568 KiB |
#include <iostream>
using namespace std;
typedef long long ll;
const int N=102;
ll dp[N][N],g[N][N];
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
cin>>g[i][j];
}
}
g[n][n]=0;
dp[n][n]=1;
for(int i=n;i>=1;i--)
{
for(int j=n;j>=1;j--)
{
if(g[i][j]==0)continue;
if(j+g[i][j]<=n)
dp[i][j]+=dp[i][j+g[i][j]];
if(i+g[i][j]<=n)
dp[i][j]+=dp[i+g[i][j]][j];
}
}
cout<<dp[1][1]<<endl;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
