# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
550757 | tht2005 | Financial Report (JOI21_financial) | C++17 | 139 ms | 5572 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, m, a[N], v[N];
int main() {
scanf("%d %d", &n, &d);
for(int i = 0; i < n; ++i) {
scanf("%d", a + i);
v[i] = a[i];
}
sort(v, v + n);
m = unique(v, v + n) - v;
for(int i = 0; i < n; ++i) {
a[i] = lower_bound(v, v + m, a[i]) - v;
}
for(int i = 0; i < n; ++i) {
v[i] = 2e9;
}
int res = 0;
for(int i = 0; i < n; ++i) {
int k = lower_bound(v, v + n, a[i]) - v;
v[k] = a[i];
res = max(res, k + 1);
}
printf("%d", res);
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... |