Submission #384783

#TimeUsernameProblemLanguageResultExecution timeMemory
384783ngpin04Rabbit Carrot (LMIO19_triusis)C++14
0 / 100
2 ms364 KiB
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int a[N]; int n,m; int main() { ios_base::sync_with_stdio(0); cin.tie(0); //freopen("file.inp","r",stdin); cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> a[i]; a[i] -= i * m; } vector <int> lis(n); int ans = 0; for (int i = 1; i <= n; i++) { int len = lower_bound(lis.begin(), lis.end(), a[i]) - lis.begin(); lis[len] = a[i]; ans = max(ans, len); } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...