# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
963738 | Soumya1 | 치료 계획 (JOI20_treatment) | C++17 | 326 ms | 34924 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll inf = 1e18;
const int l2 = 2e9 + 10;
struct SegmentTree {
int n;
vector<pair<int, int>> t;
vector<multiset<pair<int, int>>> mst;
SegmentTree(int _n) {
n = _n;
t.assign(4 * n, {l2, l2});
mst.resize(n + 1);
}
void update(int x, int lx, int rx, int i, pair<int, int> v, bool erase) {
if (lx == rx) {
if (erase) mst[lx].erase(mst[lx].find(v));
else mst[lx].insert(v);
if (mst[lx].empty()) t[x] = {l2, l2};
else t[x] = *mst[lx].begin();
return;
}
int mx = (lx + rx) >> 1;
if (i <= mx) update(x << 1, lx, mx, i, v, erase);
else update(x << 1 | 1, mx + 1, rx, i, v, erase);
t[x] = min(t[x << 1], t[x << 1 | 1]);
}
pair<int, int> query(int x, int lx, int rx, int l, int r) {
if (l > rx || lx > r || l > r) return {l2, l2};
if (l <= lx && r >= rx) return t[x];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |