21322022-12-21 11:11:59TimiCsodálatos Csillagképekcpp11Accepted 100/100143ms9696 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted4ms5000 KiB
subtask225/25
2Accepted3ms5140 KiB
3Accepted3ms5168 KiB
4Accepted4ms5356 KiB
5Accepted3ms5628 KiB
subtask340/40
6Accepted4ms5580 KiB
7Accepted4ms5892 KiB
8Accepted4ms5840 KiB
9Accepted4ms6032 KiB
10Accepted4ms6084 KiB
11Accepted4ms6024 KiB
subtask435/35
12Accepted28ms7136 KiB
13Accepted143ms9420 KiB
14Accepted68ms7816 KiB
15Accepted43ms7808 KiB
16Accepted59ms8328 KiB
17Accepted109ms8848 KiB
18Accepted37ms7332 KiB
19Accepted79ms8980 KiB
20Accepted140ms9624 KiB
21Accepted143ms9696 KiB