D. Pair Of Lines( Educational Codeforces Round 41 (Rated for Div. 2))
#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))的更多相关文章
- C. Chessboard( Educational Codeforces Round 41 (Rated for Div. 2))
//暴力 #include <iostream> #include <algorithm> #include <string> using namespace st ...
- B. Lecture Sleep( Educational Codeforces Round 41 (Rated for Div. 2))
前缀后缀和搞一搞,然后枚举一下区间,找出最大值 #include <iostream> #include <algorithm> using namespace std; ; ...
- (模拟)关于进制的瞎搞---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的机器,机器每次只取最低位--% ...
- 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 ...
- Educational Codeforces Round 41 (Rated for Div. 2)(A~D)
由于之前打过了这场比赛的E题,而后面两道题太难,所以就手速半个多小时A了前4题. 就当练手速吧,不过今天除了C题数组开小了以外都是1A A Tetris 题意的抽象解释可以在Luogu里看一下(话说现 ...
- Educational Codeforces Round 41 (Rated for Div. 2) ABCDEF
最近打的比较少...就只有这么点题解了. A. Tetris time limit per test 1 second memory limit per test 256 megabytes inpu ...
- Educational Codeforces Round 41 (Rated for Div. 2)
这场没打又亏疯了!!! A - Tetris : 类似俄罗斯方块,模拟一下就好啦. #include<bits/stdc++.h> #define fi first #define se ...
- 【Educational Codeforces Round 41 (Rated for Div. 2) D】Pair Of Lines
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 如果点的个数<=3 那么直接输出有解. 否则. 假设1,2最后会在一条直线上,则把这条直线上的点都删掉. 看看剩余的点是否在同 ...
- Multidimensional Queries(二进制枚举+线段树+Educational Codeforces Round 56 (Rated for Div. 2))
题目链接: https://codeforces.com/contest/1093/problem/G 题目: 题意: 在k维空间中有n个点,每次给你两种操作,一种是将某一个点的坐标改为另一个坐标,一 ...
随机推荐
- python网络爬虫之使用scrapy下载文件
前面介绍了ImagesPipeline用于下载图片,Scrapy还提供了FilesPipeline用与文件下载.和之前的ImagesPipeline一样,FilesPipeline使用时只需要通过it ...
- uboot之logo显示【转】
本文转载自:http://blog.csdn.net/tuwenqi2013/article/details/60583735 版权声明:本文为博主原创文章,博主欢迎各位转载. 一.logo的调用流程 ...
- sqlserver锁表查看
sp_lock--查询哪个进程锁表了,spid:进程ID,ObjId:对象ID EXEC sp_executesql N'KILL [spid]'--杀进程 select object_name([O ...
- cookie(点心的意思)服务器给客户端的点心
他是用户访问web服务器时,服务器在用户硬盘上存放的信息,好像是服务器给客户端的“点心”.比如:是否记录用户名密码.其中,A服务器不允许访问B服务器存在客户端的cookie 一个cookie包含一对k ...
- 存储过程系列五:完整的存储过程备份使用函数REPLACE()substr()
CREATE OR REPLACE PROCEDURE "YLQXSCXKESL_GGXKZ_TO_QB" ( ...
- cassandra 存储二进制data
Blob type The Cassandra blob data type represents a constant hexadecimal number defined as 0[xX](hex ...
- Canvas HTML5
不支持的时候记得: <canvas id="stockGraph" width="150" height="150"> curr ...
- Understand JavaScript Callback Functions and Use Them
In JavaScript, functions are first-class objects; that is, functions are of the type Object and they ...
- MTK UART串口调试
一.UART初始化 1. kernel-3.18/drivers/misc/mediatek/uart/uart.c static int __init mtk_uart_init(void) { ; ...
- POJ2406(next原理理解)
Power Strings Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 40448 Accepted: 16828 D ...