# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
544930 | benson1029 | Reconstruction Project (JOI22_reconstruction) | C++14 | 5085 ms | 816024 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,w;
pair< int, pair<int,int> > ed[100005];
vector<int> used[100005], used2[100005], v[100005];
int dsu[505];
int find(int x) {
if(dsu[x]==x) return x;
else return dsu[x] = find(dsu[x]);
}
void merge(int x, int y) {
dsu[find(x)] = find(y);
}
bool cmp(int x, int y) {
return abs(w-ed[x].first) < abs(w-ed[y].first);
}
int main() {
ios::sync_with_stdio(false);
cin >> n >> m;
for(int i=0; i<m; i++) {
cin >> ed[i].second.first >> ed[i].second.second >> ed[i].first;
}
sort(ed, ed+m);
for(int i=1; i<=m; i++) {
for(int j=1; j<=n; j++) dsu[j] = j;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |