# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
403929 | Ryednap | Rabbit Carrot (LMIO19_triusis) | C++14 | 36 ms | 3804 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;
#ifdef LOCAL
#include "uj.h"
#endif
int main() {
int n, m;
scanf("%d %d", &n, &m);
vector<long long> dp;
for(int i = 1; i <= n; ++i) {
long long x; scanf("%lld", &x);
x = i * (long long)m - x;
if(x < 0) continue;
if(dp.empty() || x >= dp.back()) {
dp.push_back(x);
} else {
*upper_bound(dp.begin(), dp.end(), x) = x;
}
}
printf("%d\n", n - (int)dp.size());
return 0;
}
Compilation message (stderr)
# | 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... |