# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
684810 | KiriLL1ca | 가로등 (APIO19_street_lamps) | C++17 | 1450 ms | 324200 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>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)((x).size())
#define pb push_back
#define fr first
#define sc second
#define pw(x) (1ll << x)
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pll;
template <typename T> inline bool umax (T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool umin (T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
struct do_2d {
struct fen {
vector <int> t, cp;
inline void make () { sort(all(cp)); cp.erase(unique(all(cp)), cp.end()); t.resize(sz(cp) + 100); }
inline void _upd (int p, int x) { for (p += 5; p < sz(t); p += (p & -p)) t[p] += x; }
inline int _get (int p) { int res = 0; for (p += 5; p; p -= (p & -p)) res += t[p]; return res; }
inline void upd (int p, int x) {
p = lower_bound(all(cp), p) - cp.begin();
_upd(0, x); _upd(p + 1, -x);
}
inline int get (int r) {
r = lower_bound(all(cp), r) - cp.begin();
return _get(r);
# | 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... |