poj2187 凸包直徑模板

2021-06-23 00:54:35 字數 566 閱讀 4409

#include #include #include #include using namespace std;

#define inf 50005

struct node

;node point[inf];

int n, s[inf], top;

double cross(node a, node b, node c)

double dis(node a, node b)

int cmp(node a, node b)

}int main()

{ int i, j;

while (scanf("%d", &n)!=eof)

{for (i=0; i再一次遇到這一題時,相同的**wrong到死

在老師的幫助下找到原因

如果輸出的是小數,在g++用"%f"輸出就能ac,而用"%lf"輸出就會wa,而c++就沒這個問題。

iso c只允許用%f輸出小數,%lf屬於非標準用法。(

poj2187 凸包問題

pseudo code graham scan algorithm input a set of pointss select the rightmost lowest point p0 ins.sortsangularly about p0 as a center.for ties,discard...

Poj2187 凸包求最大距離

凸包 暴力求解,注意n 0,和n 1的情況 include include include include include include include define maxn 50000 10 using namespace std typedef struct point point int ...

poj 2187 凸包 最大點對距

題目大意就是最大點對距,最大點對距的兩端點一定是凸包頂點,所以找出形成凸包所需要的最少頂點,然後遍歷找出最大點對距。對凸包演算法的詳細講解 include include using namespace std struct point point vertex 500000 res 500000 ...