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;
int main() {
int n,d; cin >> n >> d;
vector<int> v(n); for (int &i : v) cin >> i;
vector<int> dp; // dp[i] = minimum ending of lis size i
for (int i : v) {
auto pt = upper_bound(dp.begin(), dp.end(), i);
if (pt == dp.end()) dp.push_back(i);
else *pt = i;
}
cout << dp.size();
}
# | 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... |