# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1100895 | vjudge1 | Fortune Telling 2 (JOI14_fortune_telling2) | C++17 | 892 ms | 44872 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;
const int N=2e5;
int st[12*N+1],n,q;
void update(int x, int low, int hi ,int i, int k)
{
if(low==hi) {st[x]=max(st[x],k); return;}
int mid = low+hi>>1;
if(i<=mid) update(x*2,low,mid,i,k);
else update(x*2+1,mid+1,hi,i,k);
st[x]=max(st[x*2],st[x*2+1]);
}
int getmx(int x, int low ,int hi, int i, int j)
{
if(low>hi || low >j || hi < i) return 0;
if(low>=i && hi<=j) return st[x];
int mid=low+hi>>1;
return max(getmx(x*2,low,mid,i,j), getmx(x*2+1,mid+1,hi,i,j));
}
int bit[3*N+100];
void add(int x)
{
for(; x<=2*n+q+1;x+=x&(-x))
{
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... |