# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
936867 | IOrtroiii | Two Currencies (JOI23_currencies) | C++14 | 472 ms | 45072 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;
template<typename T>
struct Fenwick {
vector<T> f;
Fenwick(int N = 0): f(N) {
}
void add(int x, T v) {
for (; x < int(f.size()); x |= (x + 1)) f[x] += v;
}
T get(int x) {
T ans{};
for (; x >= 0; x = (x & (x + 1)) - 1) ans += f[x];
return ans;
}
};
int main() {
ios_base::sync_with_stdio(false); cin.tie(nullptr);
int N, M, Q; cin >> N >> M >> Q;
vector<vector<int>> adj(N);
vector<array<int, 2>> E(N - 1);
for (int i = 0; i + 1 < N; ++i) {
cin >> E[i][0] >> E[i][1]; --E[i][0], --E[i][1];
adj[E[i][0]].push_back(E[i][1]);
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... |