HDU6300(2018多校第一场)
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多校第一场)的更多相关文章
- Time Zone 【模拟时区转换】(HDU暑假2018多校第一场)
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6308 Time Zone Time Limit: 2000/1000 MS (Java/Others) ...
- 【2018多校第一场】hdu6308-Time Zone(日期)
Problem Description Chiaki often participates in international competitive programming contests. The ...
- HDU6301(2018多校第一场)
Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6301 队友AC的,没怎么看 #include<iostream> #incl ...
- HDU6308(2018多校第一场)
Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6308 将时间化简为分钟计算,同时不要用浮点数计算,精度会出现问题: 如果采用精度,最好加 ...
- HDU6299(2018多校第一场)
Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6299 两个字符串的排序可以分成四种情况: (1)str1左少右多 vs str2 左多右 ...
- HDU6298(2018多校第一场)
Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6298 打表找规律: #include<bits/stdc++.h> usin ...
- 2019牛客多校第一场 I Points Division(动态规划+线段树)
2019牛客多校第一场 I Points Division(动态规划+线段树) 传送门:https://ac.nowcoder.com/acm/contest/881/I 题意: 给你n个点,每个点有 ...
- 牛客多校第一场 B Inergratiion
牛客多校第一场 B Inergratiion 传送门:https://ac.nowcoder.com/acm/contest/881/B 题意: 给你一个 [求值为多少 题解: 根据线代的知识 我们可 ...
- HDU6581 Vacation (HDU2019多校第一场1004)
HDU6581 Vacation (HDU2019多校第一场1004) 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6581 题意: 给你n+1辆汽车, ...
随机推荐
- vue项目刷新当前页面
场景: 有时候我们在vue项目页面做了一些操作,需要刷新一下页面. 解决的办法及遇到的问题: this.$router.go(0).这种方法虽然代码很少,只有一行,但是体验很差.页面会一瞬间的白屏,体 ...
- win8.1 保护眼睛的颜色设置
reg add "HKEY_CURRENT_USER\Control Panel\Appearance\New Schemes\Current Settings SaveAll\Sizes\ ...
- [CROATIAN2009] OTOCI
[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=1180 [算法] 动态树维护森林连通性 时间复杂度 : O(NlogN ^ 2) [代 ...
- C/C++的const区别
1.const基础知识(用法.含义.好处) int main() { const int a; //a为const,常数型数 int const b; //b为const,常数型数 const int ...
- HTML5.与JQUERY与AJAX常见面试题
1. HTML5 1.1.简要描述 HTML5中的本地存储 参考答案: 很多时候我们会存储用户本地信息到电脑上,例如:比方说用户有一个填充了一半的长表格,然后突然网络连接断开了,这样用户希望你能存储这 ...
- Bayesian 网络分类算法
1:贝叶斯网络的定义和性质 一个贝叶斯网络定义包括一个有向无环图(DAG)和一个条件概率表集合.DAG中每一个节点表示一个随机变量,可以是可直接观测变量或隐藏变量,而有向边表示随机变量间的条件依赖:条 ...
- mina框架之---服务端NioSocketAcceptor的学习
接上一讲对mina的简单应用和对mina服务端和客户端中几个重要的技术知识点的理解后,今天着重对mina服务端的NioSocketAcceptor 进行学习. 说这个玩意之前,先整体上看一下在mina ...
- $.ajax数据传输成功却执行失败的回调函数
这个问题迷惑了我好几天,都快要放弃了,功夫不负有心人,最终成功解决,下面写一下我的解决方法. 我传的数据是json类型的,执行失败的回调函数是因为从后台传过来的数据不是严格的json类型,所以才会不执 ...
- 2.1-2.2 HBase数据存储
一.HBase数据检索流程 一篇介绍HBase数据读写流程的解析的博文:http://hbasefly.com/2016/12/21/hbase-getorscan/?wsfatm=uqvhl3 1. ...
- Ubuntu16.04 安装Python3.6 报错
问题: 在安装Python 3.6,执行make install 时出现以下错误: zipimport.ZipImportError: can't decompress data; zlib not ...