CodeForces - 961D——(计算几何——叉积的运用)

我们个人赛的一个题目,简单的计算几何,在聊题目之前,我想先聊聊我的心路历程。。。写了150行斜率和截距判断的函数后,突然发现其实根本不需要。。。然后改叉积就50行就过了,emmmm。

目录

题目链接:

题目:

题意:

思路:

AC代码:


题目链接:

http://codeforces.com/problemset/problem/961/D

题目:

D. Pair Of Lines

time limit per test   2 seconds

memory limit per test    256 megabytes

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?

Input

The first line contains one integer n (1 ≤ n ≤ 105) — the number of points you are given.

T

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值