제출 #540278

#제출 시각아이디문제언어결과실행 시간메모리
540278PiejanVDCFinancial Report (JOI21_financial)C++17
0 / 100
4061 ms5796 KiB
#include <bits/stdc++.h> using namespace std; signed main() { int n,d; cin>>n>>d; vector<int>v(n); for(auto &z : v) cin>>z; vector<int>dp(n+5); int mx = 1; for(int i = 0 ; i < n ; i++) { dp[i] = 1; for(int j = i-1 ; j >= max(0, i - d) ; j--) { if(v[j] < v[i]) dp[i] = max(dp[i], dp[j] + 1); } mx = max(mx, dp[i]); } cout << mx; 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...