# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
393931 | tostes | Global Warming (CEOI18_glo) | C++17 | 198 ms | 19464 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>
//#include<iostream>
//#include<vector>
using namespace std;
#define _ << ' ' <<
#define pb push_back
#define all(x) begin(x), end(x)
#define mp make_pair
#define f first
#define s second
#define sz(x) int((x).size())
using ll = long long;
using db = long double;
using pl = pair<ll,ll>;
using pi = pair<int,int>;
void trad(vector<ll>a, ll x){
int n=a.size();
set < pl > lis;
vector < ll > tr(n,1);
for(int i=n-1; i>=0; i--){
auto p = lis.upper_bound({a[i],1e15});
if(p!=lis.end()){
tr[i]+=p->s;
}
lis.insert({a[i],tr[i]});
auto pp = lis.find({a[i],tr[i]});
if(next(pp)!=lis.end() and (next(pp)->s == tr[i])) lis.erase(pp);
else if(pp!=lis.begin() and (prev(pp)->s == tr[i])) lis.erase(prev(pp));
# | 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... |