Submission #544930

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5449302022-04-03 07:23:51benson1029Reconstruction Project (JOI22_reconstruction)C++14
7 / 100
5085 ms816024 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...