# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
72124 | IDxTree (#118) | 박스런 (FXCUP3_box) | C++17 | 159 ms | 11564 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define va first
#define vb second
using namespace std;
typedef pair<int,int> pii;
const int mx = 5e5 + 5, ms = 1.05e6;
struct Segtree{
int n, seg[ms], *a;
int _i(int now, int s, int e){
//printf("_i(%d %d %d)\n",now,s,e);
if(s == e){
//printf("seg[%d] = %d\n",now,a[s]);
return seg[now] = a[s];
}
int m = (s+e)/2;
seg[now] = max(_i(now<<1,s,m), _i(now<<1|1,m+1,e));
//printf("seg[%d] = %d\n",now,seg[now]);
return seg[now];
}
Segtree(){}
Segtree(int n, int *a):n(n),a(a){
//printf("n = %d, a = %p\n",n,a);
_i(1,1,n);
}
int midx(int now, int s, int e, int l, int r, int v){
//printf("midx(%d,%d,%d,%d,%d,%d)\n",now,s,e,l,r,v);
if(e < l || s > r) return INT_MAX;
if(seg[now] < v) return INT_MAX;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |