当前位置:网站首页>Daily question -leetcode1037- effective boomerang
Daily question -leetcode1037- effective boomerang
2022-06-09 11:41:00 【Li Fan, hurry up】
Note:
The result of cross product is 0, Description collinear , Otherwise, it means that they are not collinear
The cross product of three vectors is too much trouble , Change to two calculations
The code is as follows :
class Solution {
public:
bool isBoomerang(vector<vector<int>>& points) {
int x1 = points[0][0], y1 = points[0][1];
int x2 = points[1][0], y2 = points[1][1];
int x3 = points[2][0], y3 = points[2][1];
int a = x2 - x1, b = y2 - y1;
int c = x3 - x1, d = y3 - y1;
if(a * d - b * c == 0) return false;
return true;
}
};
边栏推荐
- Kaggle Titanic survivor forecast
- Introduction and simple use of protobuf
- [basic knowledge] ~ zener diode, triode, amplification circuit, number of logic gate transistors, FPGA device junction temperature range, FPGA loading mode, Schmitt trigger, C language structured prog
- 【基础知识】~ 硬核/软核/固核、PWM/SPWM、斐波那契数列、大端模式存储、傅里叶变换、奈奎斯特采样定律、芯片选型、基尔霍夫定律、FIR/IIR 滤波器
- Network wide detailed interface test apipost detailed tutorial (actual combat), hematemesis sorting
- AudioTrack播放wav文件的一次问题记录
- 移动端拉起键盘后遮挡问题
- P5482 [jloi2011] inequality system, cckk
- 本科毕设CTF平台-MarsCTF
- Execution engine - (compiler, JIT)
猜你喜欢

最全知识总结,初学者必看

Master tape editing tool Wavelab 11 Pro

企评家用杜邦分析法剖析:华东建筑集团股份有限公司企业财务状况

集丰照明|没有副光斑的射灯简直了,小山丘完美
![[SystemVerilog data type] ~ data type, logic type, array](/img/2b/513b50a18ff5d8e1ddb4962ccea09c.png)
[SystemVerilog data type] ~ data type, logic type, array

使用 KubeKey 搭建 Kubernetes/KubeSphere 环境的“心路(累)历程“

浅谈Event-Loop

CTF platform marsctf after graduation

Record of a memory leak
![[buuctf.reverse] 109_ [FlareOn6]FlareBear,110_ [INSHack2018]Tricky-Part1](/img/94/324c1bf9e0bd27cdf391d700ec51ec.png)
[buuctf.reverse] 109_ [FlareOn6]FlareBear,110_ [INSHack2018]Tricky-Part1
随机推荐
Lecture 4: data warehouse construction (II)
wsl2环境搭建
This article takes you to understand gaussdb (DWS) [Gauss is not a mathematician this time]
集丰照明|没有副光斑的射灯简直了,小山丘完美
Quartz multiple schedulers + thread pool mode to schedule tasks separately
MySQL learning notes - Chapter 5 - data backup and recovery, MySQL logs
[advanced MySQL] optimize SQL by using the execution plan explain (2)
TiDB Cloud 上线 Google Cloud Marketplace,以全新一栈式实时 HTAP 数据库赋能全球开发者
10 useful flutter widgets
[buuctf.reverse] 111_ [b01lers2020]chugga_ chugga
第四讲:数据仓库搭建(二)
No provider available for the service
(critical) chassis-frontend. c:122: Failed to get log directory, please set by --log-path
一文详解光场深度估计
TemplateDoesNotExist at /users/register/
The most complete knowledge summary, which must be read by beginners
GaussDB(DWS) 分区自动管理介绍
MySQL 学习笔记-第三篇-索引、存储过程和函数、视图、触发器
首家BMW i品牌专属体验店开业,全面展示宝马电动产品的魅力
Computer selection 1
