# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
947514 | devkudawla | Journey (NOI18_journey) | C++17 | 74 ms | 36176 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int n, m, h;
const int N = 10010, M = 410;
int dp[N + 1][M + 1];
int prefix[N + 1][M + 1];
vector<vector<pair<int, int>>> graph(N + 1);
void solve(bool testCases = true) {
int T = 1;
if (testCases) cin >> T;
while (T--) {
cin >> n >> m >> h;
memset(dp, 0, sizeof(dp));
memset(prefix, 0, sizeof(prefix));
dp[0][0] = 1;
prefix[0][0] = dp[0][0];
for (int j = 1; j < m; j++) {
prefix[0][j] += prefix[0][j - 1] + dp[0][j];
prefix[0][j] = min(prefix[0][j], 500000001);
}
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < h; j++) {
int a, b;
cin >> a >> b;
if (i >= a) {
continue;
}
graph[a].push_back({i, b});
}
}
# | 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... |