2016武汉科技大学邀请赛现场赛 G题
来源:互联网 发布:火车票选铺位软件 编辑:程序博客网 时间:2024/04/30 15:50
Plane
Time Limit: 1 Sec Memory Limit: 128 MB 64bit IO Format: %lldSubmitted: 43 Accepted: 7
[Submit][Status][Web Board]
Description
Cheng is an engineer. Now, Cheng is working on a two dimensional plane.
He knows that every line on a plane can be clearly defined by three coefficients A,B and C: any point (x,y) lies on the line if and only if
Ax+By+C=0
Let's call a set of lines to be perfect if there does not exist a point that belongs to two or more distinct lines of the set.
He has a set of lines on a plane and he wants to find out the size of the largest perfect subset of this set.
Input
The first line of input contains the number of test caseT(T<=20) . The descriptions of the test cases follow:
Each test case consists of one integer N, denoting number of lines.
Next N(N<=1e5) lines contain 3 space-separated integers each denoting coefficients A,B and C respectively (|A|,|B|,|C|<=1e9).
Output
For each test case output the size of the largest perfect subset in a single line.
Sample Input
151 1 12 2 21 1 210 20 300 5 2
Sample Output
2题意:n条个点最多能确定几条直线。还没想通怎么解决的,先给出官方的题解题解:通过斜率进行排序,然后除掉gcd,注意坑点。
- 2016武汉科技大学邀请赛现场赛 G题
- 2016武汉科技大学邀请赛现场赛 L
- 2016武汉科技大学邀请赛现场赛 A题
- 2016武汉科技大学邀请赛现场赛 B题
- 2016武汉科技大学邀请赛现场赛 C题
- 2016武汉科技大学邀请赛现场赛 D题
- 2016武汉科技大学邀请赛现场赛 E题
- 2016武汉科技大学邀请赛现场赛 F题
- 2016年武汉科技大学邀请赛网络赛 G题
- 2016年武汉科技大学邀请赛网络赛 A题
- 2016年武汉科技大学邀请赛网络赛 B题
- 2016年武汉科技大学邀请赛网络赛 J题
- 2016年武汉科技大学邀请赛网络赛 D题
- 2016年武汉科技大学邀请赛网络赛 C题
- 2016年武汉科技大学邀请赛网络赛 E题
- 2016年武汉科技大学邀请赛网络赛 F题
- 2016年武汉科技大学邀请赛网络赛 H题
- 2016年武汉科技大学邀请赛网络赛 I题
- 双目立体视觉SAD匹配算法
- 搭建Hive On Spark
- c++数据类型相互转
- 单片机Base64 C语言加密
- 绿盟面试
- 2016武汉科技大学邀请赛现场赛 G题
- DDOS攻击检测和防护
- HDU-1233-畅通工程(并查集)
- 三日NJU
- jquery的onclick(this)方法
- Intent Resolution(intent处理)
- js对象与jquery之间的转换
- ProgressBar-进度条案例
- Android中的文本框,图片以及点击事件的设置