Skip to content

Instantly share code, notes, and snippets.

@GoBigorGoHome
Last active March 20, 2025 14:15
using Point = pair<int,int>;
ll cross(const Point& a, const Point& b) {
return 1ll * a.first * b.second - 1ll * a.second * b.first;
}
// 逆时针
// 参考 mnbvmar 的写法:https://codeforces.com/contest/1284/submission/68178688
bool cmp_polar(const Point& a, const Point& b) {
bool aorig = a.second > 0;
bool borig = b.second > 0;
if (aorig != borig) {
return aorig > borig;
}
return cross(a, b) > 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment