# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
700222 | LucasLe | Rabbit Carrot (LMIO19_triusis) | C++17 | 79 ms | 6836 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>
#define ll long long
using namespace std;
int main() {
ll N, M; cin >> N >> M;
vector<ll> b;
for (ll i = 1; i <= N; ++i) {
ll x; cin >> x;
if (x <= M * i) {
b.push_back(M * i - x);
}
}
vector<ll> lis;
for (ll x : b) {
ll pos = upper_bound(lis.begin(), lis.end(), x) - lis.begin();
if (pos == lis.size()) lis.push_back(x);
else lis[pos] = x;
}
cout << N - lis.size();
}
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... |