Submission #573175

#TimeUsernameProblemLanguageResultExecution timeMemory
573175Dan4LifeFinancial Report (JOI21_financial)C++17
0 / 100
4056 ms2756 KiB
#include <bits/stdc++.h> using namespace std; int n, d, dp[300010], a[300010]; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n >> d; for(int i = 0; i < n; i++) cin >> a[i]; reverse(a, a+n); fill(dp, dp+n, 1); for(int i = 1; i < n; i++){ for(int j = i-1; j>=max(0,i-d); j--) if(a[j]>a[i]) dp[i] = max(dp[i], dp[j]+1); } cout << *max_element(dp, dp+n); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...