# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
669703 | soondro2266 | Foehn Phenomena (JOI17_foehn_phenomena) | C++14 | 603 ms | 42956 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>
using namespace std;
#define int long long
struct seg{
int l, r, val, s, t, mid;
seg* ch[2] = {};
seg(int _l, int _r, int _s, int _t, vector<int> &arr):l(_l),r(_r),s(_s),t(_t){
if(l == r-1){
val = arr[l];
return;
}
mid = (l+r)/2;
ch[0] = new seg(l, mid, s, t, arr);
ch[1] = new seg(mid, r, s, t, arr);
pull();
}
int get(){
if(l == r-1){
if(val < 0){
return val*(0-t);
}
else{
return val*(0-s);
}
}
return val;
}
void pull(){
val = ch[0]->get() + ch[1]->get();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |