Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <queue>
- #include <algorithm>
- #include <cstring>
- #include <fstream>
- using namespace std;
- vector<pair<int, int> > graph[105];
- int main() {
- int n ,m;
- cin >> n >> m;
- for(int i =0; i < m; i++) {
- int a, b, c;
- cin >> a >> b >> c;
- graph[a].push_back(make_pair(c, b));
- graph[b].push_back(make_pair(c, a));
- }
- for(int i =0 ;i < n; i++) {
- sort(graph[i].begin(), graph[i].end());
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement