D. Pair Of Lines( Educational Codeforces Round 41 (Rated for Div. 2))
2024-08-25 09:24:34
#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 ;
}
最新文章
- NSMutableString 常用操作
- centos虚拟机复制移动后网络配置无效
- create a inatll package
- android ListView嵌套GridView显示不全问题
- css实现微信信息背景qq聊天气泡
- [转]比较Jmeter、Grinder和JAVA多线程本身压力测试所带来的性能开销
- ExtJs计算两个DateField所间隔的月份(天数) new Date(str) IE游览器提示NaN 处理
- 获取某几个分类下的前N条数据 mssql语句
- java大全经典的书面采访
- Web.config 文件中的 system.webServer
- 翻译:MLAPP(2.1节)
- activiti 任务节点 处理人设置
- 【翻译】在Sencha应用程序中使用插件和混入
- IO学习二(节点流)
- python框架之Django(5)-O/RM
- js面向对象1
- 玩转X-CTR100 l STM32F4 l OLED显示-SSD1306无字库
- socket编程小问题:地址已经被使用——Address already in use
- 部署LVS-DR群集
- 微信小程序和微信H5测试中易出Bug的点和注意事项
热门文章
- R in Action(0) 开篇
- SQL 系统表应用
- 事件 MotionEvent
- object-c中的assign,retain,copy,atomic,nonatomic,readonly,readwrite以及strong,weak
- Hihocoder #1121 二分图一•二分图判定( bfs或者dfs搜索实现 搜索的过程中进行 节点标记 *【模板】)
- BZOJ 2023 [Usaco2005 Nov]Ant Counting 数蚂蚁:dp【前缀和优化】
- JavaScript Constructors
- Intellij IDEA 弹窗License activation 报 this license BIG3CLIK6F has been cancelled 错误的解决。
- .NETFramework:StaticValueInjecter
- jni中c代码调用java代码