# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
655664 | 2022-11-05T08:04:23 Z | tunay_kerem | Rabbit Carrot (LMIO19_triusis) | C++14 | 0 ms | 212 KB |
// author : tunay_ke #include <bits/stdc++.h> #define ii pair<int,int> #define PB push #define pb push_back #define st first #define nd second #define all(a) a.begin(),a.end() #define iii pair<ii,int> #define mid ((l+r)/2) #define endl "\n" using namespace std; int n,a,k; vector<int> v; int main() { cin>>n>>k; v.pb(0); for (int i = 0; i < n; ++i) { cin>>a; v.pb(a); } vector<long long int> fx; for (int i = 1; i <= n; ++i) { if(i*k-v[i]<0)continue; fx.pb(i*k-v[i]); } vector<long long int> lis; for (int i = 0; i < n; ++i) { int sonra=lower_bound(lis.begin(),lis.end(),fx[i])-lis.begin(); if(sonra==lis.size()){ lis.pb(fx[i]); } else lis[sonra]=fx[i]; } cout<<n-1-lis.size(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |