2132 | 2022-12-21 11:11:59 | Timi | Csodálatos Csillagképek | cpp11 | Accepted 100/100 | 143ms | 9696 KiB |
#include <iostream>
#include <vector>
using namespace std;
struct Csillag
{
int x, y;
};
int main()
{
int n, i;
long long db=0;
cin>>n;
vector<int> x(200001,0);
vector<int> y(200001,0);
Csillag a[n];
for (i=0; i<n; i++)
{
cin>>a[i].x>>a[i].y;
x[a[i].x]++;
y[a[i].y]++;
}
for (i=0; i<n; i++)
{
if (((x[a[i].x]-1)>0)&&((y[a[i].y]-1)>0))
db=db+(x[a[i].x]-1)*(y[a[i].y]-1);
}
cout<<db;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 4ms | 5000 KiB | ||||
subtask2 | 25/25 | ||||||
2 | Accepted | 3ms | 5140 KiB | ||||
3 | Accepted | 3ms | 5168 KiB | ||||
4 | Accepted | 4ms | 5356 KiB | ||||
5 | Accepted | 3ms | 5628 KiB | ||||
subtask3 | 40/40 | ||||||
6 | Accepted | 4ms | 5580 KiB | ||||
7 | Accepted | 4ms | 5892 KiB | ||||
8 | Accepted | 4ms | 5840 KiB | ||||
9 | Accepted | 4ms | 6032 KiB | ||||
10 | Accepted | 4ms | 6084 KiB | ||||
11 | Accepted | 4ms | 6024 KiB | ||||
subtask4 | 35/35 | ||||||
12 | Accepted | 28ms | 7136 KiB | ||||
13 | Accepted | 143ms | 9420 KiB | ||||
14 | Accepted | 68ms | 7816 KiB | ||||
15 | Accepted | 43ms | 7808 KiB | ||||
16 | Accepted | 59ms | 8328 KiB | ||||
17 | Accepted | 109ms | 8848 KiB | ||||
18 | Accepted | 37ms | 7332 KiB | ||||
19 | Accepted | 79ms | 8980 KiB | ||||
20 | Accepted | 140ms | 9624 KiB | ||||
21 | Accepted | 143ms | 9696 KiB |