链接: http://acm.sgu.ru/problem.php?contest=0&problem=253 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=27464#problem/A 253. Theodore Roosevelt time limit per test: 0.5 sec. memory limit per test: 65536 KB input: standard output: standard Dange…
求点到直线的距离: double dis(point p1,point p2){   if(fabs(p1.x-p2.x)<exp)//相等的  {    return fabs(p2.x-pegx);    }  else     {   double k=(p2.y-p1.y)/(p2.x-p1.x);   double b=p2.y-k*p2.x;   return fabs(k*pegx-pegy+b)/sqrt(k*k+1);//返回的是距离的   }}判断多边形是否为凸多边形 if…
Shape of HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4972    Accepted Submission(s): 2250 Problem Description 话说上回讲到海东集团推选老总的事情,最终的结果是XHD以微弱优势当选,从此以后,“徐队”的称呼逐渐被“徐总”所取代,海东集团(HDU)也算是名副其实了.…
链接: http://acm.hdu.edu.cn/showproblem.php?pid=2108 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=27459#problem/A Shape of HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4320    Acc…
http://acm.sgu.ru/problem.php?contest=0&problem=253 题意简单易懂...给你n个点的凸包(经测试已经是极角序)...判断m个点是否在凸包内...数量>=k就输出YES 46ms过的...貌似数据很水...但暴力判断每个点复杂度O(n*m)肯定T了... 二分可以优化到O(mlogn)   -----该算法受到AC巨巨的启发:http://hi.baidu.com/aekdycoin/item/2d54f9c0fef55457ad00efd6…
题目大意:RT 分析:构造一条射线,如果穿越偶数条边,那么就在多边形外面,如果穿越奇数条边,那么就在多边形里面. 代码如下: =========================================================================================================================== #include<stdio.h> #include<algorithm> #include<string…
链接: http://poj.org/problem?id=1584 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22013#problem/D A Round Peg in a Ground Hole Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4475   Accepted: 1374 Description The DIY Furniture com…
链接: http://poj.org/problem?id=1584 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22013#problem/D A Round Peg in a Ground Hole Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4475   Accepted: 1374 Description The DIY Furniture com…
A Round Peg in a Ground Hole Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4438   Accepted: 1362 Description The DIY Furniture company specializes in assemble-it-yourself furniture kits. Typically, the pieces of wood are attached to on…
Saint John Festival 题目链接: http://acm.hust.edu.cn/vjudge/contest/127406#problem/J Description Porto's Festa de São João is one of Europe's liveliest street festivals. Its peak is the night of 23rd to 24th of June, with dancing parties from Ribeira to…