Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct pt {
- int x, y;
- double value;
- inline double val() const {
- return atan2(y, x);
- }
- inline bool operator < (const pt &p) const {
- return value < p.value;
- }
- };
- const int maxn = (int)1e6;
- pt ps[maxn];
- int main() {
- #ifdef DEBUG
- freopen(TASKNAME".in", "r", stdin);
- freopen(TASKNAME".out", "w", stdout);
- #endif
- int n;
- while (scanf("%d", &n) >= 1) {
- for (int i = 0; i < n; i++) {
- scanf("%d%d", &ps[i].x, &ps[i].y);
- if (!ps[i].x && !ps[i].y) {
- while (1) ;
- }
- ps[i].value = ps[i].val();
- }
- for (int i = 0; i < n; i++)
- assert(ps[i].value == ps[i].val());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement