# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
566962 | birthdaycake | Just Long Neckties (JOI20_ho_t1) | C++17 | 205 ms | 14852 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 endl '\n'
#define int long long
#define mod 1000000007
#define boost ios_base::sync_with_stdio(false), cin.tie(NULL);
using namespace std;
int N,Left,Right,Type;
pair<int,int>a[4000001];
int b[4000001],ans[2000001];
int seg[4000001],seg2[4000001];
void Update(){
int ind = N + Left - 1;
seg[ind] = a[Left].first - b[Left - 1];
while(ind /= 2) seg[ind] = max(seg[ind * 2], seg[ind * 2 + 1]);
ind = N + Left - 1;
seg2[ind] = a[Left - 1].first - b[Left - 1];
while(ind /= 2) seg2[ind] = max(seg2[ind * 2], seg2[ind * 2 + 1]);
}
int Query(int l = 1, int r = N, int ind = 1){
if(l > Right || r < Left) return 0;
if(l >= Left && r <= Right){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |