# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
846969 | SUNWOOOOOOOO | Financial Report (JOI21_financial) | C++17 | 46 ms | 4432 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 mxN = 300005;
int n, d, A[mxN], lis[mxN];
int main()
{
scanf("%d %d", &n, &d);
for (int i = 1; i <= n; i++) scanf("%d", &A[i]);
int ans = 0;
lis[ans] = -1;
for (int i = 1; i <= n; i++){
if (A[i] > lis[ans]) lis[++ans] = A[i];
else {
int idx = lower_bound(lis, lis + ans, A[i]) - lis;
lis[idx] = A[i];
}
}
printf("%d\n", ans);
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... |