codeforces #398C Tree and Array 构造
来源:互联网 发布:软件项目质量保证方案 编辑:程序博客网 时间:2024/06/06 01:14
题目大意:给定一棵
对于每条边
操作结束后统计数对
现在给定
膜拜题解
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;int n;int main(){ int i; cin>>n; if(n==5) { puts("1 4 1"); puts("2 5 1"); puts("3 4 2"); puts("2 3 2"); puts("1 2"); puts("4 5"); return 0; } for(i=1;i<=n/2;i++) printf("%d %d 1\n",i,i+n/2); for(i=1;i+n/2+1<=n;i++) printf("%d %d %d\n",i+n/2,i+n/2+1,i+i-1); for(i=1;i<n/2;i++) printf("%d %d\n",i,i+1); printf("1 3\n"); return 0;}
0 0
- Codeforces 398C Tree and Array(构造)
- Codeforces 398C Tree and Array 构造
- codeforces #398C Tree and Array 构造
- Codeforces 658C Bear and Forgotten Tree 3【构造】
- CodeForces 658C Bear and Forgotten Tree 3(构造)
- Codeforces Round #251(Div. 2) 439C. Devu and Partitioning of the Array 构造
- Codeforces 718C C. Sasha and Array
- codeforces 658C Bear and Forgotten Tree 3构造-多么痛的领悟
- Codeforces 658 C. Bear and Forgotten Tree 3(树的构造)
- CodeForces 442C Artem and Array(贪心)
- codeforces 498 c Array and Operations
- codeforces 718 C.Sasha and Array
- codeforces 718C - Sasha and Array
- Codeforces 498C Array and Operations 题解
- [题解]codeforces 718c Sasha and Array
- Codeforces 296C Greg and Array【思维】
- Codeforces 459C Pashmak and Buses(构造)
- Codeforces 449C Jzzhu and Apples(构造)
- leetcode之 median of two sorted arrays
- nyoj-1167-阅读理解(筛法+打表)
- 实现mfc进程和qt进程之间的通信
- 写一个浮框固定在页面,单击可以消失
- Dijkstra算法求解单源点到其余各顶点的最短距离
- codeforces #398C Tree and Array 构造
- QT中QTableWidget的一些常用用法
- awk 初学
- 在多核FPGA上实现MCAPI
- STL运用的C++技术(4)---函数重载
- 重写equal 的同时为什么必须重写hashcode?
- 2014ACM/ICPC亚洲区北京站hdu5112~5122(dp,dfs)
- java 时间戳和时间互转工具 和 时间偏移量计算
- PDF的显示和浏览