啥也不说了,直接看图吧…… 代码如下: #include<stdio.h> #include<iostream> #include<math.h> using namespace std; #define LL long long struct point { LL x,y,z; }; bool fun(point a,point b,point c,point d) { point p1, p2,p3; p1.x = a.x-d.x; p1.y = a.y-d.y;…
题意:给你四个点,判断能否先依次通过A,B两点,然后再在某个地方只进行一次直角转弯再一次经过C,D两点: #include <iostream> #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> using namespace std; typedef long long ll; const double eps=1e-12; struct Poi…
目录 Ural 1248 Sequence Sum 题解 题意 题解 程序 Ural 1248 Sequence Sum 题解 题意 给定\(n\)个用科学计数法表示的实数\((10^{-100}\sim10^{100})\),输出它们的和. Tip: 一个实数可以用科学计数法表示为\(x\times10^y\),其中\(1\le x<10\) \(x\)为实数,\(y\)是整数.输入时表示为\(xey\).保证输入的实数有\(19\)位有效数字.输出时用科学计数法,必须包括\(19\)位正确数…
目录 Ural 1250 Sea Burial 题解 题意 输入 题解 程序 Ural 1250 Sea Burial 题解 题意 给定一个\(n\times m\)的地图,\(.\)为水,\(\#\)为陆,地图的外部是水(地图被水包围).水为八连通,陆为四联通.联通的水称为海,联通的陆称为岛.海内可能有岛,岛内可能有海.给定\(x,y\)求在包含\((x,y)\)(保证\((x,y)\)为水)的海里面有多少岛. 输入 第一行包含\(m,n,y,x(1\le n,m\le 500,1\le x…
Space Ant Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 2876   Accepted: 1839 Description The most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in the planet Y19…
 Problem 2099 魔法阵 Accept: 120    Submit: 289 Time Limit: 1000 mSec    Memory Limit : 32768 KB  Problem Description 两个正三角形和一个圆组成一个魔法阵,如图,圆心和正三角形内心重合,三角形的重叠部分是一个正六边形.求魔法阵轮廓围成的面积.  Input 第一行一个整数T表示数据组数(T<=1000).接下来T行每行2个实数,正三角形边长L和圆的半径R(0<L,R<1000).…
http://poj.org/problem?id=2031 题意 给出三维坐标系下的n个球体,求把它们联通的最小代价. 分析 最小生成树加上一点计算几何.建图,若两球体原本有接触,则边权为0:否则边权为它们球心的距离-两者半径之和.这样来跑Prim就ok了.注意精度. #include<iostream> #include<cmath> #include<cstring> #include<queue> #include<vector> #in…
含极角序排序模板.   Space Ant Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5334   Accepted: 3312 Description The most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in th…
题目: Nowadays spaceships are never launched from the Earth's surface. There is a huge spaceport placed in the geostationary orbit and connected to the Earth with carbon nanotube cables. People and cargo are delivered to the orbit by elevators moving a…
题目概述 在平面直角坐标系的第$1$象限和第$4$象限有$n$个点,其中第$i$个点的坐标为$(x_i,y_i)$,有一个权值$p_i$ 从原点$O(0,0)$出发,不重复的经过一些点,最终走到原点,围成一个多边形.我们定义开心程度为$f$. 设经过节点总共走的路径长度是$s$,最终路径围成的多边形中所有点的权值和为$w$,则$f = \frac{w}{s}$. 试最大化开心程度$f$.保留$3$位小数后输出$f_{min}$. 对于$100\%$的数据满足$n\leq 2\times 10^3…