Zoj 2554 brownie points

Source: Internet
Author: User
// At the beginning, I have been reading questions for a long time, and I do not quite understand what the requirements are! After reading it again, I can understand it! // The requirement of the question is: in the given coordinates, take the coordinates in the center as the origin, and then calculate the first and third quadrants respectively, // The number of coordinate points in the second and fourth quadrants! # Include "iostream" using namespace STD; struct info {int X; int y ;}; info [200010]; int main () {int N, I, j, ans1, ans2; Info centerpoint; while (CIN> N & N) {for (I = 0; I <n; I ++) CIN> info [I]. x> info [I]. y; j = (n-1)/2; ans1 = ans2 = 0; centerpoint. X = info [J]. x, centerpoint. y = info [J]. y; for (I = 0; I <n; I ++) {If (info [I]. x> centerpoint. X & info [I]. y> centerpoint. y) | (info [I]. x <centerpoint. X & info [I]. Y <centerpoint. y) ans1 ++; else if (info [I]. x> centerpoint. X & info [I]. Y <centerpoint. y) | (info [I]. x <centerpoint. X & info [I]. y> centerpoint. y) ans2 ++;} cout <ans1 <"" <ans2 <Endl ;}}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.