# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
731771 | jk410 | Two Currencies (JOI23_currencies) | C++17 | 3037 ms | 36932 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define all(v) v.begin(),v.end()
#define pb push_back
#define ll long long
using namespace std;
struct segmentTree {
vector<ll> tree;
void init(int n) {
tree.clear();
tree.resize(1 << (int)ceil(log2(n)) + 1);
}
void update(int lx, int rx, ll v, int l, int r, int n) {
if (r < lx || rx < l)
return;
if (lx <= l && r <= rx) {
tree[n] += v;
return;
}
int m = (l + r) >> 1;
update(lx, rx, v, l, m, n << 1);
update(lx, rx, v, m + 1, r, n << 1 | 1);
}
ll query(int x, int l, int r, int n) {
if (r < x || x < l)
return 0;
if (l == r)
return tree[n];
int m = (l + r) >> 1;
return query(x, l, m, n << 1) + query(x, m + 1, r, n << 1 | 1) + tree[n];
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |