Question: Zscaler, Online Assessment Question | Data Analyst | Hackerman Lover Geometry | 2023
0
Entering edit mode

ADD COMMENTlink 14 months ago Delta 2.9k
0
Entering edit mode
#includeusing namespace std; struct segTree{ int size; vectormaximum; void init(int n) { size=1; while(size=rx || lx>=r) { return INT_MIN; } if(lx>=l && rx<=r) return maximum[root]; int m=(lx+rx)/2; int max1=maxx(l, r, 2*root+1, lx, m); int max2=maxx(l, r, 2*root+2, m, rx); return max(max1, max2); } int maxx(int l, int r) { return maxx(l, r, 0, 0, size); } }; int main() { int n, k; cin>>n>>k; int pnl[n]; for(int i=0;i>pnl[i]; vectorpresum(n); presum[0]=pnl[0]; for(int i=1;i
ADD COMMENTlink 14 months ago Rishi Sharma • 0
0
Entering edit mode
#includeusing namespace std; struct segTree{ int size; vectormaximum; void init(int n) { size=1; while(size=rx || lx>=r) { return INT_MIN; } if(lx>=l && rx<=r) return maximum[root]; int m=(lx+rx)/2; int max1=maxx(l, r, 2*root+1, lx, m); int max2=maxx(l, r, 2*root+2, m, rx); return max(max1, max2); } int maxx(int l, int r) { return maxx(l, r, 0, 0, size); } }; int main() { int n, k; cin>>n>>k; int pnl[n]; for(int i=0;i>pnl[i]; vectorpresum(n); presum[0]=pnl[0]; for(int i=1;i
ADD COMMENTlink 14 months ago Rishi Sharma • 0

Login before adding your answer.

Similar Posts
Loading Similar Posts