-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgregcow.cpp
65 lines (55 loc) · 1.3 KB
/
gregcow.cpp
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<ll, ll>;
using vi = vector<ll>;
using vpi = vector<pi>;
using vb = vector<bool>;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
/*
for (ll a = 0; a < 2; a++) {
for (ll b = 0; b < 2; b++) {
for (ll c = 0; c < 2; c++) {
for (ll d = 0; d < 2; d++) {
if(((a | b) ^ (c | d) ^ ((a ^ c) | (b ^ d))) == 0) {
cout << a << " " << b << " " << c << " " << d << endl;
}
}
}
}
}
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
*/
ll n;
cin >> n;
vpi p(n);
for (ll i = 0; i < n; i++) {
cin >> p[i].first >> p[i].second;
}
ll ans = 0;
for (ll i = 0; i < n; i++) {
vi cnt(4);
for (ll j = i + 1; j < n; j++) {
ll bit = ((abs(p[j].first - p[i].first) / 2) % 2) * 2 + (((abs(p[j].second - p[i].second) / 2) % 2));
ans += cnt[0];
if (bit == 0)
ans += cnt[1] + cnt[2] + cnt[3];
else
ans += cnt[bit];
cnt[bit]++;
}
}
cout << ans << endl;
return 0;
}