Submission #936867

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9368672024-03-03 00:19:48IOrtroiiiTwo Currencies (JOI23_currencies)C++14
100 / 100
472 ms45072 KiB
#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]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

currencies.cpp: In function 'int main()':
currencies.cpp:93:12: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   93 |  for (auto [c, v] : cpts) {
      |            ^
currencies.cpp:129:9: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  129 |    auto [c, v] = cpts[md];
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...