永发信息网

杭电ACM,1152怎么做

答案:1  悬赏:70  手机版
解决时间 2021-05-06 07:10

Stan and Ollie play the game of Odd Brownie Points. Some brownie points are located in the plane, at integer coordinates. Stan plays first and places a vertical line in the plane. The line must go through a brownie point and may cross many (with the same x-coordinate). Then Ollie places a horizontal line that must cross a brownie point already crossed by the vertical line.

Those lines divide the plane into four quadrants. The quadrant containing points with arbitrarily large positive coordinates is the top-right quadrant.

The players score according to the number of brownie points in the quadrants. If a brownie point is crossed by a line, it doesn't count. Stan gets a point for each (uncrossed) brownie point in the top-right and bottom-left quadrants. Ollie gets a point for each (uncrossed) brownie point in the top-left and bottom-right quadrants.

Your task is to compute the scores of Stan and Ollie given the point through which they draw their lines.

InputInput contains a number of test cases. The data of each test case appear on a sequence of input lines. The first line of each test case contains a positive odd integer 1 < n < 200000 which is the number of brownie points. Each of the following n lines contains two integers, the horizontal (x) and vertical (y) coordinates of a brownie point. No two brownie points occupy the same place. The input ends with a line containing 0 (instead of the n of a test).
Output

For each test case of input, print a line with two numbers separated by a single space. The first number is Stan's score, the second is the score of Ollie when their lines cross the point whose coordinates are given at the center of the input sequence of points for this case.

Sample Input11
3 2
3 3
3 4
3 6
2 -2
1 -3
0 0
-3 -3
-3 -2
-3 -4
3 -7
0 Sample Output6 3
最佳答案
#include<iostream>#include<string>#include<algorithm>using namespace std;__int64  n;bool fit(int v,int w,int x,int y,int z)int main(); while(scanf("%I64d",&n))   sort(s.begin(),s.end());  sort(a,a+s.length()); for(i=0;i<s.length();i++)    }    }    }   }  } }     if(num[2]==' ')  else  num[0]='n'; num[1]='o'; num[2]=' '; num[3]='s'; num[4]='o'; num[5]='l'; num[6]='u'; num[7]='t'; num[8]='i'; num[9]='o'; num[10]='n'; s.erase(); } return 0;}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
南沙立交/G9411(路口)地址在哪,我要去那里办
电脑开不开机,显示器无信号
人为什么会游泳
半期考试或者期末考试完咯该咋办?
诺基亚的6120c 的[功放]和[天线开关]。在
给一个昵称找张合适的图片,急急急
DNF中蓝拳的破魔套装得多少钱可以买下来?
为什么有好多老人都愿意在上下班高峰时期挤公
爆笑水浒的攻略
卖什么吃的呢
夜深了思念恋人的诗句,求思念情人的句子
宜家日用品超市怎么去啊,有知道地址的么
成吉思汗50级之后的剑侠怎么炼
94年身份证能上网吧玩不,急急急!!!
早上不洗脸,能说不要脸么?
推荐资讯
半藏死了吗?
完美SF文件 解压到哪里才能玩
问道这个怎么回事啊··一直进不去
西伯利亚虎和东北虎谁是王?
人言可谓、什么意思?请举例说明。
计算机国二国三学校推荐的,上机保过,笔试给答
高一数学课程导报答案第3期....
为什么老被遗忘
蔡依林出版过什么英语书?把书名告诉我
长沙哪里有好的生鲜水产批发?
关于牵挂的题目
为什么我养的狗总会丢呢
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?