# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
259874 | peuch | Global Warming (CEOI18_glo) | C++17 | 57 ms | 3960 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 MAXN = 2e5 + 10;
const int INF = 2e9 + 7;
int n, x;
int v[MAXN];
int dp[MAXN];
int ans;
int main(){
scanf("%d %d", &n, &x);
for(int i = 1; i <= n; i++){
scanf("%d", &v[i]);
dp[i] = INF;
}
for(int i = 1; i <= n; i++){
int k = lower_bound(dp, dp + n + 1, v[i]) - dp;
dp[k] = v[i];
ans = max(ans, k);
}
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... |