# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
557238 | NintsiChkhaidze | trapezoid (balkan11_trapezoid) | C++14 | 327 ms | 44260 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 pb push_back
#define s second
#define f first
#define ll long long
#define int ll
#define left (h<<1),l,((l+r)>>1)
#define right ((h<<1)|1),((l+r)>>1) + 1,r
using namespace std;
const int N = 400005,mod = 30013;
map <int,int> mp;
int a[N],b[N],c[N],d[N];
pair <int,int> t[4*N];
vector <int> v;
set <pair<pair<int,int>,pair<int,int> > > st;
vector <pair<pair<int,int>,int> > vec;
void upd(int h,int l,int r,int idx,int val1,int val2){
if (l == r){
if (val1 == t[h].f) t[h].s = (val2 + t[h].s)%mod;
else if (val1 > t[h].f) t[h] = {val1,val2};
return;
}
if(idx > (l+r)/2) upd(right,idx,val1,val2);
else upd(left,idx,val1,val2);
if (t[h*2].f > t[h*2 + 1].f) t[h] = t[h*2];
else if (t[h*2].f < t[h*2 + 1].f) t[h] = t[h*2 + 1];
else t[h] = {t[h*2].f,(t[h*2].s + t[h*2+1].s)%mod};
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |