Codeforces Round #265 (Div. 2)D(判断立方体)
来源:互联网 发布:淘宝卖家虚拟交易步 编辑:程序博客网 时间:2024/04/28 03:58
Peter had a cube with non-zero length of a side. He put the cube into three-dimensional space in such a way that its vertices lay at integer points (it is possible that the cube's sides are not parallel to the coordinate axes). Then he took a piece of paper and wrote down eight lines, each containing three integers — coordinates of cube's vertex (a single line contains coordinates of a single vertex, each vertex is written exactly once), put the paper on the table and left. While Peter was away, his little brother Nick decided to play with the numbers on the paper. In one operation Nick could swap some numbers inside a single line (Nick didn't swap numbers from distinct lines). Nick could have performed any number of such operations.
When Peter returned and found out about Nick's mischief, he started recollecting the original coordinates. Help Peter restore the original position of the points or else state that this is impossible and the numbers were initially recorded incorrectly.
Each of the eight lines contains three space-separated integers — the numbers written on the piece of paper after Nick's mischief. All numbers do not exceed 106 in their absolute value.
If there is a way to restore the cube, then print in the first line "YES". In each of the next eight lines print three integers — the restored coordinates of the points. The numbers in the i-th output line must be a permutation of the numbers in i-th input line. The numbers should represent the vertices of a cube with non-zero length of a side. If there are multiple possible ways, print any of them.
If there is no valid way, print "NO" (without the quotes) in the first line. Do not print anything else.
0 0 00 0 10 0 10 0 10 1 10 1 10 1 11 1 1
YES0 0 00 0 10 1 01 0 00 1 11 0 11 1 01 1 1
0 0 00 0 00 0 00 0 01 1 11 1 11 1 11 1 1
NO
- Codeforces Round #265 (Div. 2)D(判断立方体)
- Codeforces Round #265 (Div. 2) D. Restore Cube 立方体判断
- codeforces Round # 187(Div.2) D
- Codeforces Round #277 (Div. 2)(D)
- Codeforces Round #291 (Div. 2)(D)
- Codeforces Round #363 (Div. 2) D. Fix a Tree(并查集)(判断圆环)
- Codeforces Round #297 (Div. 2) -- D. Arthur and Walls (判断矩形)
- Codeforces Round #308 (Div. 2) D. Vanya and Triangles (判断三角形数量)
- Codeforces Round #378 (Div. 2) D题(二分答案,贪心判断)
- Codeforces Round #265 (Div. 2)D. Restore Cube 暴力
- Codeforces Round #265 (Div. 2) D. Restore Cube
- Codeforces Round #339 (Div. 2) D.Skills(贪心)
- Codeforces Round #232 (Div. 2) D(运算符重载)
- Codeforces Round #244 (Div. 2)D (后缀自动机)
- Codeforces Round #263 (Div. 2)D(树形DP)
- Codeforces Round #264 (Div. 2)D(图论+dp)
- Codeforces Round #266 (Div. 2)D(DP)
- Codeforces Round #254 (Div. 2)D(估计)
- 给晕针的童鞋一些参考
- O(N lgK) 时间内合并K个有序链表
- 《MFC游戏开发》笔记二 建立工程、调整窗口
- java-- 学生介绍
- 跳转到系统短信界面和预设短信内容
- Codeforces Round #265 (Div. 2)D(判断立方体)
- android学习笔记【1】KEYCODE列表
- 《MFC游戏开发》笔记三 游戏贴图与透明特效的实现
- Codeforces Round #265 (Div. 2)E(数位dp)
- 《MFC游戏开发》笔记四 键盘响应和鼠标响应:让人物动起来
- cocos2d-x 2.2.5 cocostudio
- OpenGl学习之glPushMatrix、glPopMatrix
- STL algorithm算法copy_backward(7)
- sqlserver 2012 账户强制过时修改