# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433183 | benedict0724 | 역사적 조사 (JOI14_historical) | C++17 | 4090 ms | 9668 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int bucket = 316;
struct query
{
int s, e, i;
query() : query(0, 0, 0) {}
query(int _s, int _e, int _i) : s(_s), e(_e), i(_i) {}
bool operator < (const query &O)
{
if(s/bucket == O.s/bucket) return e < O.e;
return s/bucket < O.s/bucket;
}
};
ll X[100002], Y[100002], I[100002];
query Q[100002];
ll tree[400002];
void update(int i, int l, int r, int id, ll v)
{
if(l == r) { tree[i] += v; return; }
int m = (l + r)/2;
if(id <= m) update(i*2, l, m, id, v);
else update(i*2+1, m+1, r, id, v);
# | 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... |