Problem Description
Chiaki has 3n points p1,p2,…,p3n. It is guaranteed that no three points are collinear.
Chiaki would like to construct n disjoint triangles where each vertex comes from the 3n points.
 
Input
There are multiple test cases. The first line of input contains an integer T, indicating the number of test cases. For each test case:
The first line contains an integer n (1≤n≤1000) -- the number of triangle to construct.
Each of the next 3n lines contains two integers xi and yi (−109≤xi,yi≤109).
It is guaranteed that the sum of all n does not exceed 10000.
 
Output
For each test case, output n lines contain three integers ai,bi,ci (1≤ai,bi,ci≤3n) each denoting the indices of points the i-th triangle use. If there are multiple solutions, you can output any of them.
 
Sample Input
1
1
1 2
2 3
3 5
 
Sample Output
1 2 3
 
这个题目,因为output 是输出每个点的索引,所以定义一个结构体,放X Y num  num为索引,然后根据X(或者Y) 用sort, cmp排序,再每隔三个点输出一次num就可以了。难点是在对题意的理解上。

HDU 6300的更多相关文章

  1. HDU 6300.Triangle Partition-三角形-水题 (2018 Multi-University Training Contest 1 1003)

    6300.Triangle Partition 这个题就是输出组成三角形的点的下标. 因为任意三点不共线,所以任意三点就可以组成三角形,直接排个序然后输出就可以了. 讲道理,没看懂官方题解说的啥... ...

  2. 2018 Multi-University Training Contest - Team 1 题解

    Solved A HDU 6298 Maximum Multiple Solved B HDU 6299 Balanced Sequence Solved C HDU 6300 Triangle Pa ...

  3. HDU 2018 Multi-University Training Contest 1 Triangle Partition 【YY】

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6300 Triangle Partition Time Limit: 2000/1000 MS (Java ...

  4. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  5. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

  6. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

  7. HDU 4569 Special equations(取模)

    Special equations Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u S ...

  8. HDU 4006The kth great number(K大数 +小顶堆)

    The kth great number Time Limit:1000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64 ...

  9. HDU 1796How many integers can you find(容斥原理)

    How many integers can you find Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d ...

随机推荐

  1. mysql学习【第3篇】:使用DQL查询数据

    狂神声明 : 文章均为自己的学习笔记 , 转载一定注明出处 ; 编辑不易 , 防君子不防小人~共勉 ! mysql学习[第3篇]:使用DQL查询数据 DQL语言 DQL( Data Query Lan ...

  2. jetty在eclipse和Idea中的使用

    eclipse中的配置 下载 http://www.eclipse.org/jetty/download.html 下载保存到特定的位置,解压. 整合到eclipse中 这里通过在eclipse中安装 ...

  3. bug: '\xff' 转换成-1 而不是255

    后台给的值处理后 Byte rtncode = payload[0]; 打印payload[0]是'\xff', 增加 if (rtncode ==255 ){ ....} 的判断,跳里面去了 然后用 ...

  4. C# Asp.net 修改Ueditor编辑器上传图片保存路径

    默认情况下Ueditor图片上传的保存路径是在/ueditor/net/upload/目录下,(如:http://localhost/ueditor/net/upload/123.png), 但是有时 ...

  5. fio 测试 磁盘I/O: ls -1 /sys/block/sda/queue/ | awk '{cmd="cat "i$0; print i$0; system(cmd) }' i=`pwd`'/'

    小型计算机系统接口(SCSI,Small Computer System Interface) SAS(Serial Attached SCSI,串列SCSI) SCSI 硬盘名称: sd[a-p] ...

  6. (4.29)sql server中有关于GO的坑

    本问题基于上海sql server dba技术群提问分析总结而成: 群友问题: 就是一台服务器有数据库A,但没有数据库B(A和B有相同得表),我把B数据库的建表语句执行了在use A环境下了,为什么A ...

  7. (1.9)SQL优化——mysql导入导出优化

    (1.9)SQL优化——mysql导入导出优化 1.大批量插入数据 [1.1]MyISAM: (1)如果存在表且有数据,插入前先关闭所有非唯一索引. (2)如果表是空的,默认就是先导入数据再创建索引, ...

  8. 多周期MACD趋势共振制作的方法

    我浏览了创幻论坛.理想论坛,来到MACD股市技术分析俱乐部,真正找到自己的乐土. 做人要厚道!指标之王MACD既然被先辈们创造了出来,就应由我辈发扬光大!自吹自擂者.吝啬者都应自觉退出论坛既然来到这里 ...

  9. MySQL 从库down机

    MySQL 从库down机中午突然down机,重启后,从库同步报主键重复的错误. Could not execute Write_rows event on table operation_maste ...

  10. xshell帮助

    查看内置命令 $help Internal Commands:new: Creates a new session.open: Opens a session or the session dialo ...