6276 | 2023-11-11 18:43:51 | horka | Csodálatos Csillagképek | cpp17 | Accepted 100/100 | 185ms | 72972 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int n; cin>>n;
vector<int> x(n),y(n),sor(2*1e6+4),oszlop(2*1e6+3);
for(int i=0; i<n; i++)
{
cin>>x[i]>>y[i];
sor[x[i]]++;
oszlop[y[i]]++;
}
long long ans=0;
for(int i=0; i<n; i++)
ans+=(sor[x[i]]-1)*(oszlop[y[i]]-1);
cout<<ans<<endl;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 24ms | 64384 KiB | ||||
subtask2 | 25/25 | ||||||
2 | Accepted | 28ms | 64656 KiB | ||||
3 | Accepted | 25ms | 64932 KiB | ||||
4 | Accepted | 28ms | 65148 KiB | ||||
5 | Accepted | 25ms | 65272 KiB | ||||
subtask3 | 40/40 | ||||||
6 | Accepted | 28ms | 65224 KiB | ||||
7 | Accepted | 29ms | 65480 KiB | ||||
8 | Accepted | 26ms | 65752 KiB | ||||
9 | Accepted | 25ms | 65848 KiB | ||||
10 | Accepted | 24ms | 65804 KiB | ||||
11 | Accepted | 25ms | 66056 KiB | ||||
subtask4 | 35/35 | ||||||
12 | Accepted | 50ms | 67748 KiB | ||||
13 | Accepted | 180ms | 72360 KiB | ||||
14 | Accepted | 93ms | 69204 KiB | ||||
15 | Accepted | 64ms | 69280 KiB | ||||
16 | Accepted | 82ms | 70440 KiB | ||||
17 | Accepted | 136ms | 71096 KiB | ||||
18 | Accepted | 74ms | 68196 KiB | ||||
19 | Accepted | 108ms | 71792 KiB | ||||
20 | Accepted | 165ms | 72816 KiB | ||||
21 | Accepted | 185ms | 72972 KiB |