# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
260691 | bigg | Global Warming (CEOI18_glo) | C++14 | 54 ms | 5496 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;
typedef long long ll;
const int MAXN = 2e5 + 10;
const ll INF =1e18;
ll dp[MAXN], v[MAXN];
int main(){
int n;
ll x;
scanf("%d %lld", &n, &x);
for(int i = 1; i <= n; i++) scanf("%lld", &v[i]), dp[i] = INF;
dp[0] = INF;
int ans = -1;
for(int i = 1; i <= n; i++){
int it1 = lower_bound(dp, dp + n, v[i]) - dp;
dp[it1] = v[i];
ans = max(ans, it1 + 1);
}
printf("%d\n",ans );
}
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... |