Codeforces 330B Road Construction
来源:互联网 发布:淘宝ca证书下载 编辑:程序博客网 时间:2024/05/07 00:54
题目链接:Codeforces 330B Road Construction
m < n / 2,所以必然有一个节点与所有边都相连(画出来的。。),所以边数就是n - 1。
#include<iostream>#include <cstring>using namespace std;bool e[1001];int main(){ int n,m; int x,y; memset(e,0,sizeof(e)); cin >> n >> m; int i; for (i = 0; i < m; i++) { cin >> x >> y; e[x] = e[y] = true; } for (i = 1; i <= n; i++) if (!e[i]) break; cout << n -1 << endl; for (int j = 1; j <= n; j++) if (i != j) cout << j << " " << i <<endl;}
0 0
- Codeforces 330B Road Construction
- codeforces 330B Road Construction
- Codeforces Round #192 (Div. 2) (330B) B.Road Construction
- Codeforces Round 192 B. Road Construction
- Problem-330B-Ceodeforces Road Construction(思维)
- B. Road Construction
- B. Road Construction
- codeforce B. Road Construction
- Codeforces Round #192 (Div. 2)-B. Road Construction
- CF 330B Road Construction 构造路径 水题
- cf 192 div2 B. Road Construction
- Road Construction
- poj3352 - Road Construction
- poj 3352 Road Construction
- POJ 3352 Road Construction
- POJ3352--Road Construction
- POJ 3352: Road Construction
- Aizu 2249 Road Construction
- WINCE 6.0支持的UI语言种类
- cocos2dx 一套资源做完美分辨率适配(不拉伸无黑边全屏显示)
- frameset、iframe框架登录跳转, 处理session为空的登录页面问题
- 十大数据挖掘算法及各自优势
- 都教兽”来沪 粉丝挤破头为见一面花2.5万
- Codeforces 330B Road Construction
- 研发中的微观管理
- Java对象实例化问题
- 性能测试起步
- UIPageControl 常用方法
- 阿里笔试题-算法题
- Interop type 'Microsoft.Office.Interop.Word.ApplicationClass' cannot be embedded. Use the applicable
- Unity3D研究院之2D游戏软件开发制作
- 【我所认知的BIOS】—> uEFI AHCI Driver(1) — uEFI开始其实不是很复杂