# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1168650 | rayan_bd | Sequence (APIO23_sequence) | C++20 | 687 ms | 148368 KiB |
#include <bits/stdc++.h>
using namespace std;
const double INF = 5e18;
const int mxN = 5e5+100;
#define fi first
#define se second
#define all(v) v.begin(), v.end()
vector<int> seg[mxN*4];
vector<int> ar;
void build(int node,int start,int end){
if(start==end){
seg[node]={ar[start]};
return;
}
int mid=start+(end-start)/2;
build(node*2+1,start,mid);
build(node*2+2,mid+1,end);
merge(all(seg[node*2+1]),all(seg[node*2+2]),back_inserter(seg[node]));
}
int qry(int node,int start,int end,int l,int r,int k){
if(start>r||end<l) return 0;
if(start>=l&&end<=r) return upper_bound(all(seg[node]),k)-seg[node].begin();
int mid=start+(end-start)/2;
return qry(node*2+1,start,mid,l,r,k)+qry(node*2+2,mid+1,end,l,r,k);
# | 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... |