# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
731789 | beaboss | Global Warming (CEOI18_glo) | C++14 | 93 ms | 5572 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;
#define s second
#define f first
#define pb push_back
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
const ll INF = 1e17 + 10ll;
const ll N = 2*1e5 + 10;
int main() {
int n, x;
cin >> n >> x;
vi vals(n);
vi dp(n);
vi cur;
for (int i = 0; i < n; i++) {
cin >> vals[i];
auto ind = lower_bound(cur.begin(), cur.end(), vals[i]) - cur.begin();
if (ind == cur.size()) cur.pb(vals[i]);
else cur[ind] = vals[i];
dp[i] = cur.size();
}
cout << dp[n-1] << 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... |