제출 #638232

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6382322022-09-05 04:32:39bonkJust Long Neckties (JOI20_ho_t1)C++14
100 / 100
168 ms14200 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int ans[N + 2];
vector<pair<int, int>>a, b;
struct Segtree{
int tree[4*N + 2];
void update(int l, int r, int i, int pos, int val){
if(l == r){
tree[i] = val;
return;
}
int mid = (l + r)/2;
if(pos <= mid) update(l, mid, 2*i, pos, val);
else update(mid + 1, r, 2*i + 1, pos, val);
tree[i] = max(tree[2*i], tree[2*i + 1]);
}
int query(int l, int r, int i, int left, int right){
if(l > right || r < left || l > r) return 0;
if(left <= l && r <= right) return tree[i];
int mid = (l + r)/2;
return max(
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...