# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
521751 | penguin133 | Rabbit Carrot (LMIO19_triusis) | C++14 | 1 ms | 204 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 dp[200005], A[200005];
int main(){
int n,m, maxi =0 ;cin >> n >> m;
for(int i=1;i<=n;i++)cin >> A[i], A[i] = m * i - A[i];
vector<int>v;
vector<int> :: iterator it;
for(int i=1;i<=n;i++){
if(A[i] < 0)continue;
if(v.empty() || A[i] >= v.back())v.push_back(A[i]);
else it = lower_bound(v.begin(), v.end() , A[i]), *it = A[i];
}
cout << n-v.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... |