제출 #966605

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9666052024-04-20 06:26:27abczzBitaro's travel (JOI23_travel)C++14
15 / 100
433 ms18516 KiB
#include <iostream>
#include <array>
#define ll long long
using namespace std;
bool dir;
ll n, q, a, f, l, r, x, mid, A[200000], L[200000], R[200000];
struct SegTree{
array <ll, 2> st[800000];
void build(ll id, ll l, ll r) {
if (l == r) {
st[id] = {L[l], R[l]};
return;
}
ll mid = (l+r)/2;
build(id*2, l, mid);
build(id*2+1, mid+1, r);
st[id][0] = max(st[id*2][0], st[id*2+1][0]);
st[id][1] = min(st[id*2][1], st[id*2+1][1]);
}
ll queryL(ll id, ll l, ll r, ll ql, ll qr, ll w) {
if (qr < l || r < ql) return -1e18;
ll mid = (l+r)/2;
if (ql <= l && r <= qr) {
if (st[id][0] <= w) return -1e18;
else if (l == r) return l;
ll res = queryL(id*2+1, mid+1, r, ql, qr, w);
if (res == -1e18) res = queryL(id*2, l, mid, ql, qr, w);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...