제출 #266416

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
2664162020-08-15 08:51:19dolphingarlicTwo Antennas (JOI19_antennas)C++14
22 / 100
404 ms33448 KiB
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int oo = 1e9;
int n, a[200001], b[200001], h[200001], ans[200001];
vector<int> ins[400001], rem[400001];
int segtree[800001];
void build(int node = 1, int l = 1, int r = n) {
segtree[node] = -oo;
if (l != r) {
int mid = (l + r) / 2;
build(node * 2, l, mid); build(node * 2 + 1, mid + 1, r);
}
}
void update(int pos, int val, int node = 1, int l = 1, int r = n) {
if (l == r) segtree[node] = val;
else {
int mid = (l + r) / 2;
if (pos > mid) update(pos, val, node * 2 + 1, mid + 1, r);
else update(pos, val, node * 2, l, mid);
segtree[node] = max(segtree[node * 2], segtree[node * 2 + 1]);
}
}
int query(int x, int y, int node = 1, int l = 1, int r = n) {
if (l > y || r < x) return -oo;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...