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. [daily][ulimit][coredump] 快速简单粗暴的用coredump调试

    http://www.cnblogs.com/hugetong/p/6898608.html 一个程序挂掉了, 怎么办?  启动coredump 写一个脚本: [root@T185 ~]# cat / ...

  2. Log4j使用注意点

    Porting log4j到指定项目的时候需要注意: 1. log4j选择字符集的时候通过CMake来更改配置,防止出错; 2.

  3. Oracle 锁的等级

    ORACLE里锁有以下几种模式: 0:none 1:null 空 2:Row-S 行共享(RS):共享表锁,sub share 3:Row-X 行独占(RX):用于行的修改,sub exclusive ...

  4. LeetCode 908 Smallest Range I 解题报告

    题目要求 Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K ...

  5. javascript判断两个对象属性以及值是否相等

    objIsEqual(obj1,obj2){//比较两个对象键值对是否相等 var o1 = obj1 instanceof Object; var o2 = obj2 instanceof Obje ...

  6. js 进制之间的转换

    //十进制转其他 var x=110; alert(x); alert(x.toString(8)); alert(x.toString(32)); alert(x.toString(16)); // ...

  7. js判断开始时间不能小于结束时间

    function validTime(startTime,endTime){ var arr1 = startTime.split("-");       var arr2 = e ...

  8. c语言指针应用

    指针变量指向数组元素: #import <stdio.h> int main() { int a[10]={1,2,3,4,5,6,7,8,9,0}; int *p; p=a; for ( ...

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

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

  10. centos6.8上yum安装zabbix3.2

    centos6.8上yum安装zabbix3.2 zabbix3.2安装文档:https://www.zabbix.com/documentation/3.2/manual/installation/ ...