# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
819161 | TS_2392 | Global Warming (CEOI18_glo) | C++14 | 31 ms | 972 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>
#define pb push_back
#define lwb lower_bound
#define all(x) (x).begin(), (x).end()
using namespace std;
const int N = 2e5 + 3;
int n, x;
vector<int> lis;
void solve(int v){
int i = lwb(all(lis), v) - lis.begin();
if(i == lis.size()) lis.pb(v);
else lis[i] = v;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin >> n >> x;
for(int i = 1; i <= n; ++i){
int a; cin >> a;
if(x != 0) solve(a + x);
solve(a);
}
cout << lis.size();
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |