# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1006363 | 2024-06-23T21:06:46 Z | vjudge1 | Rabbit Carrot (LMIO19_triusis) | C++17 | 0 ms | 348 KB |
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n,m; cin >> n >> m; int a[n],t,ans=1; for(int i=0; i<n; i++) { cin >> t; a[i]=t-i*m-m; } vector<int>b; vector<int>c; for(int i=0; i<n; i++) { if(a[i]>0) { ans++; continue; } if(b.size()==0){ b.push_back(0); c.push_back(-a[i]); continue; } b.push_back(int(2e9)); c.push_back(-a[i]); } for(int i=0; i<b.size(); i++) { b[upper_bound(b.begin(),b.end(),a[i])-b.begin()]=c[i]; } for(int i=b.size()-1; i>=0; i--) { if(b[i]<int(2e9)) { cout << i+ans; return 0; } } cout << ans-1; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |