# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
574578 | 2022-06-08T21:31:04 Z | beaboss | Rabbit Carrot (LMIO19_triusis) | C++14 | 1 ms | 340 KB |
#include <bits/stdc++.h> using namespace std; int mod = 1000000007; typedef long long ll; int main() { int n, m; cin >> n >> m; vector<int> vals(n); for (int i = 0; i < n; i++) { cin >> vals[i]; } vector<int> dp(n + 1, 0); for (int i = 0; i < n; i++) { if (m * (i + 1) < vals[i]) continue; int best; int best_s = 0; for (int j = 0; j < i; j++) { if (vals[i] > vals[j] + m * (i - j)) continue; if (dp[j + 1] >= best_s) { best_s = dp[j + 1]; best = j; } } dp[i + 1] = 1 + dp[best + 1]; } cout << n - dp[n] << endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |