# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
714777 | dsyz | Fortune Telling 2 (JOI14_fortune_telling2) | C++17 | 312 ms | 33872 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;
using ll = long long;
#define MAXN (1000005)
bool cmp(pair<ll,ll> a,pair<ll,ll> b){
return max(a.first,a.second) > max(b.first,b.second);
}
ll fw[MAXN];
void upd(int x,ll nval) {
for(;x<MAXN;x+=x&(-x)) fw[x]+=nval;
}
ll query(int x) {
ll res = 0;
for(;x;x-=x&(-x)) res += fw[x];
return res;
}
ll sum(int a,int b) {
return query(b) - query(a-1);
}
struct node{
int s, e, m;
int val;
node *l, *r;
node (int S, int E){
s = S, e = E, m = (s+e)/2;
val = 0;
if(s != e){
l = new node(s, m);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |