# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
763353 | giaminh2211 | Financial Report (JOI21_financial) | C++14 | 121 ms | 6440 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>
#include <algorithm>
using namespace std;
int d;
// Function to find the length of the longest increasing subsequence
int findLongestIncreasingSubsequence(const vector<int>& arr) {
int n = arr.size();
vector<int> lis;
for (int num : arr) {
auto it = lower_bound(lis.begin(), lis.end(), num);
if (it == lis.end()) {
lis.push_back(num);
} else {
*it = num;
}
}
return lis.size();
}
int main() {
int n;
cin >> n >> d;
vector<int> arr(n);
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int length = findLongestIncreasingSubsequence(arr);
cout << length << endl;
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... |