2019牛客多校(第一场)F-Random Point in Triangle
2024-10-19 01:41:47
#include <bits/stdc++.h>
using namespace std; typedef long long ll;
struct Point{
ll x, y;
Point( ll x=, ll y= ): x(x), y(y){}
};
typedef Point Vector;
Point p[];
Vector operator -(const Vector a, const Vector b ){
return Vector( a.x-b.x, a.y-b.y );
} ll Cross( Vector a, Vector b ){
return a.x*b.y - a.y*b.x;
} int main(){
ios::sync_with_stdio();
cin.tie();
cout.tie();
ll x1, y1, x2, y2, x3, y3;
while( cin >> x1 >> y1 ){
cin >> x2 >> y2 >> x3 >> y3;
p[] = Point(x1, y1);
p[] = Point(x2, y2);
p[] = Point(x3, y3);
ll ans = Cross( p[]-p[], p[]-p[] )*;
if( ans< ) ans = -ans;
cout << ans <<endl;
} return ;
}
最新文章
- sql字符串分组
- 《编写可维护的JavaScript》——JavaScript编码规范(一)
- FIS
- Hadoop 2.2.0 4结点集群安装 非HA
- PHP 运行方式(PHP SAPI介绍)
- nginx+apache+php+mysql服务器集群搭建
- 使用jdk操作 wsdl2java (wedservice)
- the field is sometimes used inside synchronized block and sometimes used without synchronization
- Uncaught TypeError: Cannot read property &#39;post&#39; of undefined
- MySQL数据库触发器(trigger)
- 模板不存在:./xx 错误位置 FILE: LINE:110 (thinkphp上传至服务器后模板无法解析原因)
- Spring学习(1)----入门学习(附spring-framework下载地址)
- 自己动手编写IOC框架(四)
- spring9——AOP之AspectJ对AOP的实现
- 开源的许可证GPL、LGPL、BSD、Apache 2.0
- 【python练习题】程序10
- python渗透
- POJ 1258 Agri-Net (Prim&;Kruskal)
- iOS-图像之CoreImage框架
- python实现梯度下降法