CF961D.Pair Of Lines
普及/提高-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given n points on Cartesian plane. Every point is a lattice point (i. e. both of its coordinates are integers), and all points are distinct.
You may draw two straight lines (not necessarily distinct). Is it possible to do this in such a way that every point lies on at least one of these lines?
给你平面上的 $ n $ 个点。每个点均为格点(即其横纵坐标均为整数),且所有点互不相同。
你可以画两条直线(这两条直线可以重合)。是否可能以某种方式画出这两条直线,使得每个点都至少位于其中一条直线上?
输入格式
The first line contains one integer n (1 ≤ n ≤ 105) — the number of points you are given.
Then n lines follow, each line containing two integers x__i and y__i (|x__i|, |y__i| ≤ 109)— coordinates of i-th point. All n points are distinct.
第一行包含一个整数 n(1≤n≤105)—— 表示你所给定的点的数量。
接下来是 n 行,每行包含两个整数 xi 和 yi(∣xi∣,∣yi∣≤109),表示第 i 个点的坐标。所有 n 个点互不相同。
输出格式
If it is possible to draw two straight lines in such a way that each of given points belongs to at least one of these lines, print YES. Otherwise, print NO.
如果可以画出两条直线,使得给定的所有点都至少位于其中一条直线上,则输出 YES;否则输出 NO。
输入输出样例
输入#1
5 0 0 0 1 1 1 1 -1 2 2
输出#1
YES
输入#2
5 0 0 1 0 2 1 1 1 2 3
输出#2
NO
说明/提示
In the first example it is possible to draw two lines, the one containing the points 1, 3 and 5, and another one containing two remaining points.

在第一个例子中,可以画出两条直线:一条经过点 1、3 和 5,另一条经过剩余的两个点。

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