#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
const int N = 1e5 + ;
ll x[N], y[N];
int n; bool gx(int a, int b, int c, int d)
{
return (x[b] - x[a])*(y[d] - y[c]) == (x[d] - x[c])*(y[b] - y[a]);
} int check(int d, int f)
{
vector<int>q;
for (int i = ; i <= n; i++)
if (!gx(d, f, f, i))
q.push_back(i);
if (q.size()<) return ;
for (int i = ; i<q.size(); i++)
if (!gx(q[],q[], q[], q[i]))
return ;
return ;
} int main()
{
cin >> n;
for (int i = ; i <= n; i++)
cin >> x[i] >> y[i];
if (n< || check(, ) || check(, ) || check(, ))
cout << "YES" << endl;
else cout << "NO" <<endl;
//system("pause");
return ;
}

D. Pair Of Lines( Educational Codeforces Round 41 (Rated for Div. 2))的更多相关文章

  1. C. Chessboard( Educational Codeforces Round 41 (Rated for Div. 2))

    //暴力 #include <iostream> #include <algorithm> #include <string> using namespace st ...

  2. B. Lecture Sleep( Educational Codeforces Round 41 (Rated for Div. 2))

    前缀后缀和搞一搞,然后枚举一下区间,找出最大值 #include <iostream> #include <algorithm> using namespace std; ; ...

  3. (模拟)关于进制的瞎搞---You Are Given a Decimal String...(Educational Codeforces Round 70 (Rated for Div. 2))

    题目链接:https://codeforc.es/contest/1202/problem/B 题意: 给你一串数,问你插入最少多少数可以使x-y型机器(每次+x或+y的机器,机器每次只取最低位--% ...

  4. Educational Codeforces Round 41 (Rated for Div. 2) D. Pair Of Lines (几何,随机)

    D. Pair Of Lines time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...

  5. Educational Codeforces Round 41 (Rated for Div. 2)(A~D)

    由于之前打过了这场比赛的E题,而后面两道题太难,所以就手速半个多小时A了前4题. 就当练手速吧,不过今天除了C题数组开小了以外都是1A A Tetris 题意的抽象解释可以在Luogu里看一下(话说现 ...

  6. Educational Codeforces Round 41 (Rated for Div. 2) ABCDEF

    最近打的比较少...就只有这么点题解了. A. Tetris time limit per test 1 second memory limit per test 256 megabytes inpu ...

  7. Educational Codeforces Round 41 (Rated for Div. 2)

    这场没打又亏疯了!!! A - Tetris : 类似俄罗斯方块,模拟一下就好啦. #include<bits/stdc++.h> #define fi first #define se ...

  8. 【Educational Codeforces Round 41 (Rated for Div. 2) D】Pair Of Lines

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 如果点的个数<=3 那么直接输出有解. 否则. 假设1,2最后会在一条直线上,则把这条直线上的点都删掉. 看看剩余的点是否在同 ...

  9. Multidimensional Queries(二进制枚举+线段树+Educational Codeforces Round 56 (Rated for Div. 2))

    题目链接: https://codeforces.com/contest/1093/problem/G 题目: 题意: 在k维空间中有n个点,每次给你两种操作,一种是将某一个点的坐标改为另一个坐标,一 ...

随机推荐

  1. tornado安全应用之用户认证

    在这个例子中,我们将只通过存储在安全cookie里的用户名标识一个人.当某人首次在某个浏览器(或cookie过期后)访问我们的页面时,我们展示一个登录表单页面.表单作为到LoginHandler路由的 ...

  2. sap人员编制

    [转]中小SAP项目中的人员编制 转自http://w39.itpub.net/post/24/398817   对于SAP项目来说,常有人把项目所需的人员说的很多--每个模块一个内部顾问和一个开发的 ...

  3. android实现文字渐变效果和歌词进度的效果

    要用TextView使用渐变色,那我们就必须要了解LinearGradient(线性渐变)的用法. LinearGradient的参数解释 LinearGradient也称作线性渲染,LinearGr ...

  4. 并不对劲的loj3048:p5283:[十二省联考]异或粽子

    题目大意 有\(n\)(\(n\leq5\times10^5\))个数\(a_1,a_2,...a_n\)(\(a_i\leq 2^{32}-1\)) 求区间异或和前\(k(k\leq2\times1 ...

  5. HihoCoder 1638 : 小Hi的天平 (2-sat+并查集)

    描述 小Hi给小Ho邮寄了一个天平.收到天平后,小Ho想知道天平在运输过程中是否损坏,为此它准备了A类物品和B类物品共n个(可能只有A类物品,也可能只有B类物品),但无法确定一个物品是哪一类.A类物品 ...

  6. 操作 AutoIT:界面与自动化操作结合来简化日常劳动: .Net Reactor验证License,设置License,创建License,截图AutoIt自动化实现。(六)

    自动化操作的稳定性,便利性虽然已经满足了要求,但是页面上呈现的按钮太多了,可以做的更加简单一些. 1. 简化页面的按钮,把5个按钮减少至3个,把Display HID按钮功能整合到create lic ...

  7. Ubuntu16.04 + cuda9.0 + cudnn7.1.4 + tensorflow安装

    安装前的准备 UEFI 启动GPT分区 Win10和Ubuntu16.04双系统安装 ubuntu16.04 NVIDIA 驱动安装 ubuntu16.04 NVIDIA CUDA8.0 以及cuDN ...

  8. Nagios监控Windows的网卡流量

    Nagios监控Windows的网卡流量 使用/usr/local/nagios/libexec/中的check_traffic.sh,不但可以监控Linux的网卡流量,也可以监控Windows服务器 ...

  9. ORM学习 一 : JPA JDBC

    JDBC jdbc是一组规范,是接口,由不同的数据库厂商各自提供相应的实现类,打包成jar包,也就是所谓的数据库驱动.而我们的java应用程序,只需要调用jdbc的接口就可以了. 什么是JPA Jav ...

  10. easy_install 和 pip

    原文章:http://blog.csdn.net/xsj_blog/article/details/52037609 easy_install 和 pip的介绍: easy_install和pip都是 ...