[ZOJ 1010] Area (计算几何)】的更多相关文章

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1010 题目大意:给你n个点,问你顺次连线能否连成多边形?如果能,就输出多边形面积. 面积用向量的叉积去算.然后能否连成多边形就是看这条线跟之前的线有没有交点. 这些在大白书上都有板子.. 代码: #include <cstdio> #include <cstdlib> #include <string> #include <ios…
链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1010 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=29328#problem/B Area Time Limit: 2 Seconds       Memory Limit: 65536 KB       Special Judge Jerry, a middle school student, ad…
ZOJ Problem Set - 1010 Area Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge Jerry, a middle school student, addicts himself to mathematical research. Maybe the problems he has thought are really too easy to an expert. But as an a…
#include<stdio.h> #include<string.h> #include<iostream> #include<math.h> using namespace std; ]={,,,,,,,-,-,-}; ]={,-,,,-,,,-,,}; ]; __int64 area,x,y,px,py; int main() { int sum,t,tmp,i; cin>>tmp; while(tmp--) { scanf("%…
题意:给一些直线,问这些直线在直线x=L,x=R之间有多少个交点. 讲解见此文:http://blog.sina.com.cn/s/blog_778e7c6e0100q64a.html 首先将直线分别跟x=L+eps,x=R-eps(防止出现相同纵坐标,故+-eps)求他们的交点,求的纵坐标为low,high,首先按low从大到小排序,一次赋予一个ind值,再按high从大到小排序,此时ind的逆序对数即为(L,R)内的交点个数.成功将计算几何问题向树状数组转化.求逆序对数可用归并排序或者树状数…
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=10 Area Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge Jerry, a middle school student, addicts himself to mathematical research. Maybe the problems he has thought are…
题目要求面积和判断非相邻边不相交.和数学和几何有关系. #include <stdio.h> #include <math.h> #define MISS 0.0000001 int det(double x1,double y1,double x2,double y2,double x3,double y3){ double w1,w2; w1=x1*y2+x2*y3+x3*y1; w2=x2*y1+x3*y2+x1*y3; if(fabs(w1-w2)<MISS) ; e…
                                                                            Circular Area                                                        Time Limit: 1000MS  Memory Limit: 65536K   Description Your task is to write a program, which, given two…
题意:给定一个矩阵,里面有一个多边形,求多边形的面积. 析:因为是在格子里,并且这个多边形是很规则的,所以所有格子不是全属于多边形就是全不属于,或者一半,并且我们可以根据"/"和“\”的数目来知道,如果是奇数,那么就是属于, 偶数就是不属于. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #in…
题面 题意:有一个凸多边形岛屿,然后告诉你从高空(x,y,h)投下炸弹,爆炸半径r,飞机水平速度和重力加速度,问岛屿被炸了多少 题解:算出来岛屿落地位置,再利用圆与凸多边形面积交 #include<bits/stdc++.h> #define inf 1000000000000 #define M 100009 #define eps 1e-12 #define PI acos(-1.0) using namespace std; struct Point { double x,y; Poin…