Last active
January 5, 2020 07:54
-
-
Save GoBigorGoHome/2c0ceee6da2792b8280b394fc6fdf73c to your computer and use it in GitHub Desktop.
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