# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
947485 | devkudawla | Journey (NOI18_journey) | C++17 | 200 ms | 262144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int n, m, h;
const int N = 10010, M = 410;
int dp[N + 1][M + 1];
vector<vector<pair<int, int>>> graph(N + 1);
int func(int i, int j) {
if (i < 0 or j < 0) {
return 0;
}
if (dp[i][j] != -1) {
return dp[i][j];
}
int answer = 0;
for (auto [child, weight] : graph[i]) {
for (int wt = j - weight; wt >= 0; wt--) {
answer += func(child, wt);
}
}
return dp[i][j] = answer;
}
void solve(bool testCases = true) {
int T = 1;
if (testCases) cin >> T;
while (T--) {
cin >> n >> m >> h;
memset(dp, -1, sizeof(dp));
for (int i = 0; i < m; i++) {
dp[0][0] = 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |