File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include < algorithm>
2
+ #include < cmath>
3
+ #include < iostream>
4
+ #include < vector>
5
+ using namespace std ;
6
+
7
+ inline int calc (const vector<double > &v, double x) {
8
+ int ret = 0 ;
9
+ for (int i=0 ; i<v.size (); i++) {
10
+ if (v[i] < x) ret++;
11
+ }
12
+ return ret;
13
+ }
14
+
15
+ void solve (void ) {
16
+ int n; cin >> n;
17
+
18
+ int a = 0 , b = 0 ;
19
+ while (n--) {
20
+ int m, k; cin >> m >> k;
21
+ vector<double > p, q;
22
+ while (m--) {
23
+ int x, y; cin >> x >> y;
24
+ p.push_back (hypot (x, y));
25
+ }
26
+ while (k--) {
27
+ int x, y; cin >> x >> y;
28
+ q.push_back (hypot (x, y));
29
+ }
30
+ sort (p.begin (), p.end ());
31
+ sort (q.begin (), q.end ());
32
+ if (p[0 ] < q[0 ]) a += calc (p, q[0 ]);
33
+ if (p[0 ] > q[0 ]) b += calc (q, p[0 ]);
34
+ }
35
+ cout << a << " :" << b;
36
+ }
37
+
38
+ int main (void ) {
39
+ ios::sync_with_stdio (false );
40
+ cin.tie (nullptr );
41
+
42
+ solve ();
43
+ return 0 ;
44
+ }
You can’t perform that action at this time.
0 commit comments