# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
550756 | tht2005 | Financial Report (JOI21_financial) | C++17 | 4045 ms | 5452 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
int n, d, a[N], f[N];
int main() {
scanf("%d %d", &n, &d);
for(int i = 0; i < n; ++i) {
scanf("%d", a + i);
}
for(int i = 0; i < n; ++i) {
f[i] = 1;
for(int j = i - 1; j >= 0 && i - j <= d; --j) {
if(a[j] < a[i]) {
f[i] = max(f[i], f[j] + 1);
}
}
}
printf("%d", *max_element(f, f + n));
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |