| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 730096 | thimote75 | Jump (BOI06_jump) | C++14 | 2 ms | 468 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
__int128 dp[101][101];
int jump[101][101];
int n;
void update (int i, int j) {
if (i + 1 == n && j + 1 == n) return ;
/*cout << (long long)(dp[i][j]) << " ";
if(j + 1 == n) cout << endl;*/
if (i + jump[i][j] < n) dp[i + jump[i][j]][j] += dp[i][j];
if (j + jump[i][j] < n) dp[i][j + jump[i][j]] += dp[i][j];
}
string to_string (__int128 val) {
string S = "";
if (val == 0) return "0";
while (val != 0) {
S += (char) (48 + (val % 10));
val /= 10;
}
reverse(S.begin(), S.end());
return S;
}
int main () {
dp[0][0] = 1;
cin >> n;
for (int i = 0; i < n; i ++)
for (int j = 0; j < n; j ++)
cin >> jump[i][j];
for (int i = 0; i < n; i ++)
for (int j = 0; j < n; j ++)
update(i, j);
cout << to_string(dp[n - 1][n - 1]) << endl;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
