# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1072506 | ivaziva | Bouquet (EGOI24_bouquet) | C++14 | 139 ms | 36436 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 MAXN 200001
long long n;
long long l[MAXN],r[MAXN];
long long dp[MAXN][2];
set<pair<long long,long>> cuvamo[MAXN];
long long seg[MAXN*4];
void update(long long node,long long ll,long long rr,long long pos,long long val)
{
if (ll==rr) seg[node]=val;
else
{
long long mid=(ll+rr)/2;
if (pos<=mid) update(2*node,ll,mid,pos,val);
else update(2*node+1,mid+1,rr,pos,val);
seg[node]=max(seg[2*node],seg[2*node+1]);
}
}
long long query(long long node,long long ll,long long rr,long long a,long long b)
{
if (a>b) return 0;
if (ll==a and rr==b) return seg[node];
long long mid=(ll+rr)/2;
return max(query(2*node,ll,mid,a,min(b,mid)),query(2*node+1,mid+1,rr,max(a,mid+1),b));
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |