# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
763230 | vjudge1 | Financial Report (JOI21_financial) | C++17 | 94 ms | 1448 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 <iostream>
#include <vector>
using namespace std;
int n, d, a[500005], f[500005], res = 0;
vector<int> v;
void trya(int i) {
if (i == n + 1) {
int flag = 0;
for (int j = 1; j < v.size(); j++) {
if (v[j] - v[j - 1] > d) {
flag = 1;
break;
}
}
if (flag == 1) return;
int d = 0, ma = -1;
for (int j = 0; j < v.size(); j++) {
if (ma < a[v[j]]) {
ma = a[v[j]];
d++;
}
}
res = max(res, d);
return;
}
trya(i + 1);
v.push_back(i);
trya(i + 1);
v.pop_back();
}
int main() {
cin >> n >> d;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
if (n <= 20) {
trya(1);
cout << res;
}
}
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... |