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. Flink – process watermark

    WindowOperator.processElement 主要的工作,将当前的element的value加到对应的window中, windowState.setCurrentNamespace(w ...

  2. Copycat - command

    client.submit(new PutCommand("foo", "Hello world!")); ServerContext connection.h ...

  3. PHP 小知识

    -- 获取/设置响应的 HTTP 状态码 mixed http_response_code ([ int $response_code ] ) -- ... 操作符知道是什么么?看看 PHP 官方的 ...

  4. spring boot动态数据源方案

    动态数据源 1.背景 动态数据源在实际的业务场景下需求很多,而且想要沟通多数据库确实需要封装这种工具,针对于bi工具可能涉及到从不同的业务库或者数据仓库中获取数据,动态数据源就更加有意义. 2.依赖 ...

  5. Python开发【笔记】:抓包(实时分隔)

    抓包 进行linux系统抓包,并且定时分隔防止文件太大 #!/usr/bin/env python # -*- coding:utf-8 -*- import os import sys import ...

  6. PyChram快捷键

  7. div总在页面最顶端

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx. ...

  8. 【JMeter】【性能测试】服务器性能监控

    下载插件 1.访问网址http://jmeter-plugins.org/downloads/all/,下载三个文件.其中JMeterPlugins-Standard和JMeterPlugins-Ex ...

  9. 20170728 Celery项目 后台处理SQL SERVER的一个异常

    -- 1. 感觉是访问DB 失败了,失败原因不明确 -- 2. 考虑解决问题的解决办法,后台记录异常,并重新发送任务. 具体如何来实现

  10. MYSQL PROCEDURE 测试用例

    /** * 查询俱协信息 */ DROP PROCEDURE IF EXISTS `get_club_list`; DELIMITER $$ CREATE PROCEDURE `get_club_li ...