| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1317676 | eyadooz | Jump (BOI06_jump) | C++20 | 1 ms | 332 KiB |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int) (x).size()
#define endl '\n'
#define int long long
main()
{
cin.tie(0) -> sync_with_stdio(0);
int n;
cin >> n;
int dp[n][n]={};
dp[0][0]=1;
for(int i = 0;i < n;i++)
{
for(int j = 0;j < n;j++)
{
int x;
cin >> x;
if(i==n-1&&j==n-1) break;
// cout << i << " " << j << " " << dp[i][j] << endl;
if(i+x<n) dp[i+x][j]+=dp[i][j];
if(j+x<n) dp[i][j+x]+=dp[i][j];
}
}
cout << dp[n-1][n-1];
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
