제출 #618015

#제출 시각아이디문제언어결과실행 시간메모리
618015colossal_pepeFinancial Report (JOI21_financial)C++17
0 / 100
2 ms724 KiB
#include <iostream> using namespace std; const int N = 7005; int n, d, a[N], dp[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> d; for (int i = 0; i < n; i++) { cin >> a[i]; } int ans = 0; for (int i = 0; i < n; i++) { dp[i] = 1; for (int j = i - 1; j >= max(0, i - d); j--) { if (a[j] >= a[i]) continue; dp[i] = max(dp[i], 1 + dp[j]); } ans = max(ans, dp[i]); } cout << ans << '\n'; 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...