# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1109702 | KindaGoodGames | Global Warming (CEOI18_glo) | C++14 | 77 ms | 3012 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.
//11:48
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define tiii tuple<int,int,int>
using namespace std;
int main(){
int n, x;
cin >> n >> x;
vector<int> arr(n);
for(int i = 0; i < n; i++ ){
cin >> arr[i];
}
vector<int> dp;
for(int i = 0; i < n; i++){
auto it = upper_bound(dp.begin(),dp.end(),arr[i]) - dp.begin();
if(it >= dp.size()) {
dp.push_back(arr[i]);
}else{
dp[it] = arr[i];
}
}
cout << dp.size() << endl;
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |