Beauty Contest--計算幾何--Graham掃描法+旋轉卡殼

Beauty Contest 題目分析: 題目要找圖像上兩點最長的距離,那麼最長的邊的兩個頂點肯定在凸包上; 先用Graham掃描法求個凸包,在用旋轉卡殼求最長邊; 注意處理凸包只有一個點和一條線的情況 Code: #include <bits/stdc++.h> using namespace std; #define maxn 50010 #define ll long long int n
相關文章
相關標籤/搜索