Last active
March 20, 2025 14:15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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