# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
217398 | 2020-03-29T14:19:47 Z | Just_Solve_The_Problem | 코알라 (JOI13_koala) | C++11 | 5 ms | 512 KB |
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = (int)1e5 + 7; int k, m, d, a, n; int t[N], b[N]; ll dp[N]; ll get(int i, int j) { int dis = t[j] - t[i]; return -(dis + d - 1) / d * a; } main() { scanf("%d #%d %d %d %d", &k, &m, &d, &a, &n); m -= k - 1; for (int i = 1; i <= n; i++) { scanf("%d %d", &t[i], &b[i]); t[i] -= k - 1; } t[n + 1] = m; for (int i = 1; i <= n + 1; i++) { for (int j = 0; j < i; j++) { dp[i] = max(dp[i], dp[j] + b[i] - get(j, i)); } } cout << dp[n + 1]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 5 ms | 512 KB | Execution killed with signal 8 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 5 ms | 384 KB | Execution killed with signal 8 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 5 ms | 512 KB | Execution killed with signal 8 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |