1554 | 2022-11-24 12:03:16 | 1478 | Csodálatos Csillagképek | cpp11 | Accepted 100/100 | 268ms | 43128 KiB |
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
vector<vector<long long int>> x(200001);
vector<vector<long long int>> y(200001);
int main()
{
int n;
cin>>n;
int a, b;
vector<int> xek(n+1);
vector<int> yok(n+1);
for(int i=1; i<=n; i++)
{
cin>>a>>b;
x[a].push_back(i);
y[b].push_back(i);
xek[i] = a;
yok[i] = b;
}
long long int db=0;
for(int i=1; i<=n; i++)
{
if(x[xek[i]].size() && y[yok[i]].size())
{
db+=(x[xek[i]].size()-1)*(y[yok[i]].size()-1);
}
}
cout<<db;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 9ms | 20412 KiB | ||||
subtask2 | 25/25 | ||||||
2 | Accepted | 9ms | 20724 KiB | ||||
3 | Accepted | 9ms | 20928 KiB | ||||
4 | Accepted | 8ms | 21228 KiB | ||||
5 | Accepted | 8ms | 21060 KiB | ||||
subtask3 | 40/40 | ||||||
6 | Accepted | 10ms | 21272 KiB | ||||
7 | Accepted | 9ms | 21420 KiB | ||||
8 | Accepted | 8ms | 21500 KiB | ||||
9 | Accepted | 10ms | 21624 KiB | ||||
10 | Accepted | 10ms | 21868 KiB | ||||
11 | Accepted | 10ms | 21944 KiB | ||||
subtask4 | 35/35 | ||||||
12 | Accepted | 37ms | 24692 KiB | ||||
13 | Accepted | 236ms | 41668 KiB | ||||
14 | Accepted | 101ms | 32696 KiB | ||||
15 | Accepted | 52ms | 28276 KiB | ||||
16 | Accepted | 71ms | 29956 KiB | ||||
17 | Accepted | 165ms | 38576 KiB | ||||
18 | Accepted | 63ms | 28696 KiB | ||||
19 | Accepted | 90ms | 31796 KiB | ||||
20 | Accepted | 210ms | 41984 KiB | ||||
21 | Accepted | 268ms | 43128 KiB |