# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
969353 | vjudge1 | Global Warming (CEOI18_glo) | C++17 | 0 ms | 0 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 = 2e5+5;
int n, x;
int main() {
cin >> n >> x;
vector<int> temp;
for(int i = 1; i <= n; ++i) {
cin >> arr[i];
auto itr = lower_bound(temp.begin(), temp.end(), arr[i]);
if(itr == temp.end())
temp.emplace_back(arr[i]);
else
*itr = arr[i];
}
cout << temp.size();
}