Created
August 19, 2021 22:03
-
-
Save Rockbet/34eb62965b717dd69d90e5e46c604353 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
const int maxn = 110; | |
vector<int> grafo[maxn]; | |
vector<pair<int,int>> arestas; | |
int main(){ | |
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); | |
int n, m; | |
cin >> n >> m; | |
for(int i=1; i<=m; i++){ | |
int u, v; | |
cin >> u >> v; | |
grafo[u].push_back(v); | |
grafo[v].push_back(u); | |
} | |
for(int i=1; i<n; i++){ | |
for(int j=i+2; j<=n; j++){ | |
arestas.push_back({i, j}); | |
} | |
} | |
cout << arestas.size() << "\n"; | |
for(int i=0; i<arestas.size(); i++){ | |
pair<int,int> x = arestas[i]; | |
cout << x.first << " " << x.second << "\n"; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment