# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
639602 | a_aguilo | Synchronization (JOI13_synchronization) | C++14 | 590 ms | 262144 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;
int N, M, Q;
vector<int> padre, activated;
vector<unordered_set<int>> information;
vector<pair<int, int>> bonds;
int root(int node){
if(padre[node] == node) return node;
return root(padre[node]);
}
void synchronise(int nodeA, int nodeB){
for(auto it = information[nodeA].begin(); it != information[nodeA].end(); ++it){
information[nodeB].insert(*it);
}
for(auto it = information[nodeB].begin(); it != information[nodeB].end(); ++it){
information[nodeA].insert(*it);
}
}
void mergeComponents(int nodeA, int nodeB) {
if(nodeA > nodeB){
int temp = nodeA;
nodeA = nodeB;
nodeB = temp;
}
//nodeA, el padre, es siempre de valor mas pequeño
# | 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... |