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;
typedef long long ll;
int main() {
ll n, x, i;
cin >> n >> x;
vector <ll> xd;
xd.assign(n, 0);
for(i=0;i<n;i++) {
cin >> xd[i];
}
vector<ll> lol = {xd[0]};
for (i = 1; i < n; ++i) {
if (xd[i] > lol.back()) {
lol.push_back(xd[i]);
}
else {
auto it = lower_bound(lol.begin(), lol.end(), xd[i]);
*it = xd[i];
}
}
cout << lol.size() << endl;
return 0;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |