# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1168938 | PieArmy | Harbingers (CEOI09_harbingers) | C++20 | 145 ms | 33580 KiB |
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
struct Seg{
int n;
vector<int>tree;
void init(int N){
n=N;
tree.resize(n<<2,1e9+1);
}
int l,r;
void up(int node=1,int left=0,int right=-1){
if(right==-1)right=n-1;
if(left==right){
tree[node]=r;
return;
}
int mid=(left+right)/2;
if(l>mid)up(node*2+1,mid+1,right);
else up(node*2,left,mid);
tree[node]=min(tree[node*2],tree[node*2+1]);
}
void update(int tar,int x){
l=tar;r=x;
up();
}
int qu(int node=1,int left=0,int right=-1){
if(right==-1)right=n-1;
if(tree[node]>r)return -1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |