题意:给定一个n*m的方阵,第i行第j列的高度为a[i][j],问除了下底面之外其余五面的总表面积 n<=50,0<=a[i][j]<=1000 思路:队友写的,抱大腿 考虑当前方格比周围四格高多少即可 #include<cstdio> #include<cstring> using namespace std; #define LL long long ; int a[maxn][maxn]; ]={,,-,}; ]={,,,-}; int main() { i…
题目: Description You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task. The space station is made up with a number…
http://poj.org/problem?id=2031 题意 给出三维坐标系下的n个球体,求把它们联通的最小代价. 分析 最小生成树加上一点计算几何.建图,若两球体原本有接触,则边权为0:否则边权为它们球心的距离-两者半径之和.这样来跑Prim就ok了.注意精度. #include<iostream> #include<cmath> #include<cstring> #include<queue> #include<vector> #in…
正解:单调栈 解题报告: 哇生气辽QAQ本来打了半天feel good都快调出来了然后说换题了QAQ(所以可能那题的代码会过一阵子再放上来了QAQ 不过还是大爆手速打了一通拿到首杀了嘻嘻 美滋滋辽 然后放个传送门先qwq 有一点点解题思想和oil是有点儿像的,就是先把询问和修改放一个结构体里排序,这样当到达某个询问的时候就可以直接解决不用进行其他修改了qwq 然后就是做两次单调栈一次算出往左能看到的角度一次算出往右能看到的角度 然后就欧克辽? ummm好像是没什么好说的了只要推出了角度计算公式然…
Building Fence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 171    Accepted Submission(s): 25Special Judge Problem Description Long long ago, there is a famous farmer named John. He owns a bi…
You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task. The space station is made up with a number of units, called…
大致题意: 给出n个圆和m个三角形,求最小的的,能将所有图形覆盖的图形的周长. 正解为求所有三角形顶点与圆的切点以及圆和圆的切点构造凸包,再求路径. 因为要求结果误差<=1e-3 所以 我们可以在每个圆上,将圆分为1000(或更多)等分,得到每个圆上有1000个点,把这些点和三角形的顶点构造凸包,为减小误差,圆上两点的距离依然为圆弧的长度.这样累加边即可得答案. #include<cstdio> #include<iostream> #include<cstring&g…
#include<cstdio> #include<cmath> #include<algorithm> using namespace std; #define N 5001 struct Point{int x,y;}p[N],bao[N]; bool operator < (Point a,Point b){return a.x!=b.x?a.x<b.x:a.y<b.y;} typedef long long ll; typedef Point…
1.三角形的所有端点 2.过所有三角形的端点对所有圆做切线,得到所有切点. 3.做任意两圆的外公切线,得到所有切点. 对上述所有点求凸包,标记每个点是三角形上的点还是某个圆上的点. 求完凸包后,因为所有点都是按逆时针(或顺时针)排好序的,如果相邻两点在同一圆上,那么求这段圆弧的距离,否则求这段直线的距离.最后得到所有周长. #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath…
//大白p263 #include <cmath> #include <cstdio> #include <cstring> #include <string> #include <queue> #include <functional> #include <set> #include <iostream> #include <vector> #include <algorithm> u…