# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
401507 | nandonathaniel | Floppy (RMI20_floppy) | C++14 | 131 ms | 16708 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 <stdlib.h>
#include <string.h>
#include "bits/stdc++.h"
#include "floppy.h"
using namespace std;
typedef pair<int,int> pii;
const int MAXN=40005,LOG=16;
int A[MAXN],n,kiri[MAXN],kanan[MAXN],subtree[MAXN],depth[MAXN],pa[LOG][MAXN];
vector<int> adj[MAXN];
pii tree[4*MAXN];
string bits,S;
void build(int now,int L,int R){
if(L==R){
tree[now]={A[L],L};
return;
}
int mid=(L+R)/2;
build(2*now,L,mid);
build(2*now+1,mid+1,R);
tree[now]=max(tree[2*now],tree[2*now+1]);
}
pii query(int now,int L,int R,int x,int y){
if(L>=x && R<=y)return tree[now];
if(L>y || R<x)return {-1000000005,0};
int mid=(L+R)/2;
return max(query(2*now,L,mid,x,y),query(2*now+1,mid+1,R,x,y));
}
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... |