XDUOJ 1125 Judgement of Orz Pandas
题意:判断一个点是否在三角形内。
思路:参考了博客http://blog.csdn.net/shunan/article/details/1434788
判断点O是否在三角形ABC中,只需要判断是否满足 OA*OB,OA,OC异号并且OB*OC,OB*OA异号。
#include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <map> #include <queue> using namespace std; typedef long long ll; const double eps=1e-11; struct Point{double x,y; };Point operator-(Point a,Point b) {Point c;c.x=a.x-b.x;c.y=a.y-b.y;return c; } double operator *(Point a,Point b) {return a.x*b.y-a.y*b.x; }int main() {Point a,b,c,d;while(cin>>a.x>>a.y){cin>>b.x>>b.y>>c.x>>c.y>>d.x>>d.y;if(((a-d)*(b-d))*((a-d)*(c-d))<=0&&((b-d)*(c-d))*((b-d)*(a-d))<=0)printf("Orz\n");elseprintf("stO\n");}return 0; }
View Code
转载于:https://www.cnblogs.com/onlyAzha/p/4765118.html
XDUOJ 1125 Judgement of Orz Pandas相关推荐
- XidianOJ 1123 K=1 Problem of Orz Pandas
题目描述 One panda named orz is playing a interesting game, he gets a big integer Num and an integer K. ...
- XidianOJ 1195 Industry of Orz Pandas
--正文 贪心 排序好慢慢找就好 #include <iostream> #include <cstring> #include <cstdio> #include ...
- Gym102870 2020-2021 “Orz Panda” Cup Programming Contest 补题记录
D. Data Structure Master and Orz Pandas 树上期望dp 列个式子跑一遍树形dp就做完了 场上剩半小时才开这题 没写出来亏死 #include<bits/st ...
- Orz_panda cup I题 (xdoj1117) 状压dp
Orz_panda cup I题 (xdoj1117) 状压dp 1117: Insert Orz Pandas 时间限制: 2 Sec 内存限制: 128 MB 提交: 15 解决: 5 [提 ...
- 2020双周训练训练日志
第 3 次双周训练 VP A - 6789 签到题,按照题意模拟就行了,由于 lincong 将题目中的"中心对称"看成了"轴对称",导致 WA 了三发还不知道 ...
- pandas用read_csv时编码问题解决
在pandas用read_csv时,遇到编码错误的, 可带 encoding : str, default None Encoding to use for UTF when reading/writ ...
- python项目ImportError: Plotly express requires pandas to be installed.解决方案
文章目录 遇到的问题 解决方法 参考 遇到的问题 运行 pip install pandas 之后遇到问题如下: PS D:\user\文档\python\python_work\data_visua ...
- 【.csv数据预处理实战】pandas 驾驶参数选取
项目:驾驶风格聚类 数据太多,首先将需要的数据筛选出来 路线:读取原始数据-->删除重复行-->提取需要数据-->去除帧数小于120的数据-->另存为新的.csv文件 方便浏览 ...
- 初识pandas及基本的增删改查
pandas pandas 1.表格数据操作:[增删改查] 2.实现多个表格的处理: 3.数据清洗操作: 缺失值,重复值,异常值,数据标准化,数据转换的操作: 4.实现excel的特殊操作:生成透视表 ...
- 【日常点滴012】python中pandas入门操作方法整理
配套数据文件 链接:https://pan.baidu.com/s/1ngzaZygHOIQuNPHtYjpFfA 提取码:lang pandas 入门 1 series 1.1 series 创 ...
最新文章
- OpenERP的优化---使用Nginx反向代理
- Exchanger的使用
- Exchange 2013学习(六),脱机通讯簿
- 驳AXAJ的七宗罪 (转)
- 数据结构与算法分析(六)——C++实现二叉查找树
- mysql批量插入数据
- hashmap containsvalue时间复杂度_恕我直言,你真的了解HashMap吗?
- GE HYDRAN M2 IS200VCRCH1B IS200VRTDH1D IS200VTCCH1CBB IS200VTURH2BAC IS215VPROH1BD IS220PAICH2A
- 笔记MySQLJavaweb
- Go-Redis使用手册
- 网站服务器要有固定IP地址吗,你知道动态IP和静态IP服务器有何区别吗?
- 产品读书《社群经济:移动互联网时代未来商业驱动力》
- HTML如何返回上一页
- Vue2:组件及组件通信
- android环信删除会话列表,关于环信删除会话之后,从好友列表进入无法显示聊天消息...
- RT-Thread 入门学习笔记 - 熟悉全局中断的操作
- linux系统定时器中断优先级,请教定时器中断与串口中断优先级配置问题
- ValueError: With n_samples=1, test_size=0.2 and train_size=None, the resulting train set will be
- 绿萝算法的打击内容是什么
- 前端面试题---HTML基础