# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
348259 | nickmet2004 | Treatment Project (JOI20_treatment) | C++11 | 260 ms | 13924 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>
#define int long long
#define f first
#define s second
using namespace std;
const int N = 1e5 + 5 , inf = 1e18;
int n , m , T[N] , L[N], R[N] , C[N];
int a[N] , pos[N] , D[N];
vector<pair<int, int> > v;
struct Node{
int val , v;
Node(){}
Node(int val , int v) : val(val) ,v(v){}
Node operator+(const Node &A){
if(val <= A.val) return (*this);
else return A;
}
}E[1<<20];
void upd(Node A , int id , int l = 0 , int r = n - 1 , int pos = 0){
if(id < l || id > r) return;
if(l == r){
E[pos] = A; return;
}
int mid = (l + r) >> 1;
upd(A , id , l , mid , pos * 2 + 1); upd(A ,id , mid + 1 , r ,pos * 2 + 2);
E[pos] = E[pos * 2 + 1] + E[pos * 2 + 2];
}
Node get(int L , int R ,int l =0 , int r = n - 1, int pos = 0){
if(r < L || R < l) return Node(inf ,-1);
if(L <= l && r <= R) return E[pos];
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... |