CF514B.Han Solo and Lazer Gun
普及/提高-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
There are n Imperial stormtroopers on the field. The battle field is a plane with Cartesian coordinate system. Each stormtrooper is associated with his coordinates (x, y) on this plane.
Han Solo has the newest duplex lazer gun to fight these stormtroopers. It is situated at the point (_x_0, _y_0). In one shot it can can destroy all the stormtroopers, situated on some line that crosses point (_x_0, _y_0).
Your task is to determine what minimum number of shots Han Solo needs to defeat all the stormtroopers.
The gun is the newest invention, it shoots very quickly and even after a very large number of shots the stormtroopers don't have enough time to realize what's happening and change their location.
战场上共有 n 名帝国冲锋队员。战场是一个带有笛卡尔坐标系的平面。每名冲锋队员在该平面上都有其对应的坐标 (x,y)。
韩·索罗拥有一把最新式的双管激光枪来对抗这些冲锋队员。该枪位于点 (x0,y0)。每次射击可以消灭所有位于某条经过点 (x0,y0) 的直线上的冲锋队员。
你的任务是确定韩·索罗击败所有冲锋队员所需的最少射击次数。
这把枪是最新的发明,射击速度极快;即使进行了大量射击,冲锋队员也来不及意识到发生了什么,更无法改变自身位置。
输入格式
The first line contains three integers n, _x_0 и _y_0 (1 ≤ n ≤ 1000, - 104 ≤ _x_0, _y_0 ≤ 104) — the number of stormtroopers on the battle field and the coordinates of your gun.
Next n lines contain two integers each x__i, y__i ( - 104 ≤ x__i, y__i ≤ 104) — the coordinates of the stormtroopers on the battlefield. It is guaranteed that no stormtrooper stands at the same point with the gun. Multiple stormtroopers can stand at the same point.
第一行包含三个整数 n、x0 和 y0(1≤n≤1000,−104≤x0,y0≤104)—— 分别表示战场上冲锋队员的数量以及你的枪所在位置的坐标。
接下来的 n 行,每行包含两个整数 xi、yi(−104≤xi,yi≤104)—— 表示每个冲锋队员在战场上的坐标。保证没有任何冲锋队员与枪位于同一点。多个冲锋队员可以位于同一点。
输出格式
Print a single integer — the minimum number of shots Han Solo needs to destroy all the stormtroopers.
输出一个整数——韩·索罗摧毁所有冲锋队员所需的最少射击次数。
输入输出样例
输入#1
4 0 0 1 1 2 2 2 0 -1 -1
输出#1
2
输入#2
2 1 2 1 1 1 0
输出#2
1
说明/提示
Explanation to the first and second samples from the statement, respectively:

题目陈述中第一个和第二个样例的解释,分别如下:

输入解题思路,AI测评打分。不知道怎么写?