# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
708241 | Dan4Life | Fortune Telling 2 (JOI14_fortune_telling2) | C++17 | 938 ms | 73136 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>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pb push_back
#define int long long
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
const int mxN = (int)2e5+10, LINF = (int)1e18;
vector<int> v, w[mxN];
int n, m, q, mxSz, sum;
unordered_map<int,int> ind;
int a[mxN], b[mxN], t[mxN], orig[3*mxN], segTree[6*mxN];
template<class T> using ordered_set = tree<T,null_type, less<T>,
rb_tree_tag,tree_order_statistics_node_update>;
ordered_set<pair<int,int>> S;
void upd(int i, int v, int p=0, int l=0, int r=mxSz-1){
if(l==r){ segTree[p]=max(segTree[p],v); return; }
int mid = (l+r)/2; int lp = p+1, rp = p+2*(mid-l+1);
if(i<=mid) upd(i,v,lp,l,mid);
else upd(i,v,rp,mid+1,r);
segTree[p] = max(segTree[lp],segTree[rp]);
}
int query(int i, int j, int p=0, int l=0, int r=mxSz-1){
if(i>r or j<l or i>j) return 0;
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... |