Submission #573170

#TimeUsernameProblemLanguageResultExecution timeMemory
573170Dan4LifeFinancial Report (JOI21_financial)C++17
0 / 100
4027 ms5544 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); dp[0] = 1; for(int i = 1; i < n; i++) for(int j = i-1; j>=max(0,i-d); j--) dp[i] = max(dp[i], a[j]>a[i]?dp[j]+1: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...