Bryce1010模板

http://acm.hdu.edu.cn/showproblem.php?pid=6300

排个序就好了

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<cmath>
using namespace std;
const int maxn=1e3+5;
struct node
{
int id;
int x,y;
double deg;
}point[maxn*3];
bool cmp(node a,node b)
{
if(a.deg!=b.deg)
return a.deg<b.deg;
else
return a.x<b.x;
}
int main()
{
int t,n;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
for(int i=1;i<=n*3;i++)
{
scanf("%d%d",&point[i].x,&point[i].y);
point[i].id=i;
point[i].deg=atan2(point[i].y,point[i].x);
}
sort(point+1,point+n*3+1,cmp);
for(int i=1;i<=n*3;i+=3)
{
printf("%d %d %d\n",point[i].id,point[i+1].id,point[i+2].id);
}
}
return 0;
}

HDU6300(2018多校第一场)的更多相关文章

  1. Time Zone 【模拟时区转换】(HDU暑假2018多校第一场)

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6308 Time Zone Time Limit: 2000/1000 MS (Java/Others)  ...

  2. 【2018多校第一场】hdu6308-Time Zone(日期)

    Problem Description Chiaki often participates in international competitive programming contests. The ...

  3. HDU6301(2018多校第一场)

    Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6301 队友AC的,没怎么看 #include<iostream> #incl ...

  4. HDU6308(2018多校第一场)

    Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6308 将时间化简为分钟计算,同时不要用浮点数计算,精度会出现问题: 如果采用精度,最好加 ...

  5. HDU6299(2018多校第一场)

    Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6299 两个字符串的排序可以分成四种情况: (1)str1左少右多 vs str2 左多右 ...

  6. HDU6298(2018多校第一场)

    Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6298 打表找规律: #include<bits/stdc++.h> usin ...

  7. 2019牛客多校第一场 I Points Division(动态规划+线段树)

    2019牛客多校第一场 I Points Division(动态规划+线段树) 传送门:https://ac.nowcoder.com/acm/contest/881/I 题意: 给你n个点,每个点有 ...

  8. 牛客多校第一场 B Inergratiion

    牛客多校第一场 B Inergratiion 传送门:https://ac.nowcoder.com/acm/contest/881/B 题意: 给你一个 [求值为多少 题解: 根据线代的知识 我们可 ...

  9. HDU6581 Vacation (HDU2019多校第一场1004)

    HDU6581 Vacation (HDU2019多校第一场1004) 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6581 题意: 给你n+1辆汽车, ...

随机推荐

  1. shared SDK 微信开放平台遇到的问题

    shared sdk是用于集成到app中,方便快速社交化分享的组件,其使用方法比较简单,参考官网的快速集成步骤就能搞定.稍微麻烦一点的就是需要到各个开放平台去注册你的APP. 在各个开放平台注册好之后 ...

  2. jmeter使用笔记——流程及常用组件配置

    添加线程组 线程数 :对应用户数, Ramp-Up: 多少秒启动这些线程,1秒代表1秒内启动设置的线程数,10秒代表10秒内启动线程数 循环次数: 每个线程执行线程组内的请求循环次数 调度器:可以对线 ...

  3. sql 逻辑运算符 优先级

    SELECT * FROM tl_documentation WHERE storehouse_id =2 OR customer_id =2 AND product_id =20 ORDER BY  ...

  4. 重学DSP:对于卷积的理解

    最近,我发现自己对于一个事情,如果不给自己一个说服自己的理由,就会出现不能理解,不能记住,以至于不会使用或者“盲目”应用的情况. 但是,我学的这个学科就是应当建立在对信号作用过程的理解上面的. 下面, ...

  5. haproxy参数解析

    HAProxy工作于隧道模式,其仅检查每一个连接的第一个请求, 1. option abortonclose #当服务器负载过高时,将自动关闭队列中处理时间较长的连接请求 2. option http ...

  6. 基于Jquery的XML解析器,返回定制的HTML

    依据HTML模板返回解析的XML 依赖jQuery 1.4​1. [代码]基于Jquery的xml解析器并返回定制的HTML     /** *  jQuery插件 *  Author: pureco ...

  7. tensorflow 线性回归解决 iris 2分类

    # Combining Everything Together #---------------------------------- # This file will perform binary ...

  8. [LeetCode] Longest Valid Parentheses -- 挂动态规划羊头卖stack的狗肉

    (Version 1.3) 这题在LeetCode上的标签比较有欺骗性,虽然标签写着有DP,但是实际上根本不需要使用动态规划,相反的,使用动态规划反而会在LeetCode OJ上面超时.这题正确的做法 ...

  9. AQS与重入锁ReetrantLock原理

    一.AQS原理 AQS(AbstractQueuedSynchronizer)队列同步器是用来构建锁.同步组件的基础框架. AQS内部通过一个volatile int类型的成员变量state控制同步状 ...

  10. 第一行代码笔记的思维导图(http://images2015.cnblogs.com/blog/1089110/201704/1089110-20170413160323298-819915364.png)