forked from kothariji/competitive-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathB_Football_Kit.cpp
36 lines (34 loc) · 1.01 KB
/
B_Football_Kit.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
#include <bits/stdc++.h>
#define mod 1000000007
#define lli long long int
#define endl '\n'
#define deb(x) cout << #x << '=' << x << '\n'
#define deb2(x, y) cout << #x << '=' << x << ',' << #y << '=' << y << '\n'
#define deb3(x, y, z) cout << #x << '=' << x << ',' << #y << '=' << y << ',' << #z << '=' << z << '\n'
#define deb4(x, y, z, w) cout << #x << '=' << x << ',' << #y << '=' << y << ',' << #z << '=' << z << ',' << #w << '=' << w << '\n'
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<pair<int, int>> v1(n);
unordered_map<int, int> home, away;
for (int i = 0; i < n; i++)
{
int d1, d2;
cin >> d1 >> d2;
v1[i] = make_pair(d1, d2);
home[d1]++;
away[d2]++;
}
for (int i = 0; i < n; i++)
{
int homeans(n - 1), awayans(0);
awayans = n - 1 - home[v1[i].second];
homeans += home[v1[i].second];
cout << homeans << " " << awayans << endl;
}
return 0;
}