forked from mahmudahsan/203-ACM-Problems-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10865.cpp
More file actions
executable file
·40 lines (35 loc) · 762 Bytes
/
Copy path10865.cpp
File metadata and controls
executable file
·40 lines (35 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* Prob: Brownie Points UVA: 10865
Programmer: Md. Mahmud Ahsan
Desc: Using x,y coordinate
Visual C++
Online contest
*/
#include <iostream>
using namespace std;
struct k{
long x, y;
}A[ 200000];
int main(){
long i, n, mid;
long stan, ollie;
while (cin >> n){
stan = ollie = 0;
if (n == 0) break;
mid = n / 2;
for (i = 0; i < n; ++i){
cin >> A[i].x >> A[i].y;
}
for (i = 0; i < n; ++i){
if (A[i].x < A[mid].x && A[i].y > A[mid].y)
++stan;
else if (A[i].x > A[mid].x && A[i].y < A[mid].y)
++stan;
else if (A[i].x > A[mid].x && A[i].y > A[mid].y)
++ollie;
else if (A[i].x < A[mid].x && A[i].y < A[mid].y)
++ollie;
}
cout << ollie << " " << stan <<endl;
}
return 0;
}