# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1005392 | Unforgettablepl | Constellation 3 (JOI20_constellation3) | C++17 | 1564 ms | 49820 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.
// #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define int long long
struct segtree{
vector<pair<int,int>> tree;
segtree():tree(524288){}
void update(int k,int x){
k+=262144;
tree[k] = {x,k-262144};
while(k/=2){
tree[k]=max(tree[2*k],tree[2*k+1]);
}
}
int get(int l,int r){
l+=262144;r+=262144;
pair<int,int> ans = {0,0};
while(l<=r){
if(l&1)ans=max(ans,tree[l++]);
if(r%2==0)ans=max(ans,tree[r--]);
l/=2;r/=2;
}
return ans.second;
}
};
pair<int,int> adj[200001];
int tree[200001];
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... |