# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
170209 | arnold518 | Street Lamps (APIO19_street_lamps) | C++14 | 1787 ms | 66748 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;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 3e5;
int N, Q, A[MAXN+10];
set<int> S, E;
pii range(int x) { return pii(*(--S.upper_bound(x)), *E.lower_bound(x)); }
pll operator + (const pll &p, const pll &q) { return pll(p.first+q.first, p.second+q.second); }
struct Data
{
int t, y, x; pll val;
bool operator < (const Data &p) const { return x<p.x; }
};
vector<Data> todo;
struct BIT
{
pll tree[MAXN+10];
void update(int i, pll v) { for(; i<=N; i+=(i&-i)) tree[i]=tree[i]+v; }
pll query(int i) { pll ret(0, 0); for(; i>0; i-=(i&-i)) ret=ret+tree[i]; return ret; }
void flush(int i) { for(; i<=N; i+=(i&-i)) tree[i]=pll(0, 0); }
}bit;
Compilation message (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |