# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1092521 | hungnt | Financial Report (JOI21_financial) | C++14 | 425 ms | 36372 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
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
using ll = long long;
using ar2 = array<int,2>;
const int mxN = (int)3e5+10;
int n, d, dp[mxN], seg[mxN*2];
int a[mxN], p[mxN], sz[mxN], mn[mxN];
int findSet(int i){return i==p[i]?i:p[i]=findSet(p[i]);}
void unionSet(int i, int j){
int x = findSet(i), y = findSet(j);
if(x==y) return;
if(sz[x]<sz[y])swap(x,y);
p[y] = x, sz[x]+=sz[y];
mn[x]=mn[y]=min(mn[x],mn[y]);
}
void upd(int x, int v, int p=0, int l=1, int r=n){
if(l==r){ seg[p]=v; return; }
int mid = (l+r)/2; int rp = p+2*(mid-l+1);
if(x<=mid) upd(x,v,p+1,l,mid);
else upd(x,v,rp,mid+1,r);
seg[p] = max(seg[p+1],seg[rp]);
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |