# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
893273 | ksujay2 | Two Currencies (JOI23_currencies) | C++17 | 4265 ms | 33224 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;
using ll = long long;
int lg(unsigned long long i) { return i ? __builtin_clzll(1) - __builtin_clzll(i) : -1; }
struct BIT {
vector<ll> tree;
BIT(int n) { tree = vector<ll>(n + 1); }
ll sum(int k) { ll s = 0; while(k >= 1) s += tree[k], k -= k&-k; return s; }
void add(int k, ll x) { while (k < (int)tree.size()) tree[k] += x, k += k&-k; }
int lb(ll x) {
ll s = 0, p = 0;
for(int i = lg(tree.size()); i >= 0; i--)
if(p + (1 << i) < tree.size() && s + tree[p + (1 << i)] <= x)
p += (1 << i), s += tree[p];
return p;
}
};
struct Edge {
int a, b;
vector<int> c;
};
struct Query {
int S, E, i;
ll s;
};
const int BS = 450;
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... |