#51 Codeforces-E. Very simple problem (计算几何)(点被多少个三角形包含)

网友投稿 558 2022-10-02

#51 Codeforces-E. Very simple problem (计算几何)(点被多少个三角形包含)

#51 Codeforces-E. Very simple problem (计算几何)(点被多少个三角形包含)

​​- 不包含该点的三角形个数.

AC代码

#includeusing namespace std;typedef long long ll;struct Point{ ll x,y; Point(){}; Point(ll x,ll y):x(x),y(y){}};Point operator-(const Point& lhs,const Point& rhs){ return Point(lhs.x-rhs.x,lhs.y-rhs.y);}ll operator*(const Point& lhs,const Point& rhs){ return lhs.x*rhs.y - lhs.y*rhs.x; }ll s[1<<20];Point p[1<<20];Point q;int main(){ int n,m; ll l,r,ans; for(int i=2;i<(1<<20);i++){ s[i]+=s[i-1]+i-1; } cin>>n; for(int i=0;i>p[i].x>>p[i].y; p[n+i]=p[i]; } cin>>m; for(int i=0;i>q.x>>q.y; for(int j=0;j= 0) { printf("0\n"); goto NEXT ; } } ans = 0; for(int j=0,k=0;j

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:spring.datasource.schema配置详解
下一篇:Proxy封装小程序的异步调用
相关文章

 发表评论

暂时没有评论,来抢沙发吧~