15542022-11-24 12:03:161478Csodálatos Csillagképekcpp11Accepted 100/100268ms43128 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted9ms20412 KiB
subtask225/25
2Accepted9ms20724 KiB
3Accepted9ms20928 KiB
4Accepted8ms21228 KiB
5Accepted8ms21060 KiB
subtask340/40
6Accepted10ms21272 KiB
7Accepted9ms21420 KiB
8Accepted8ms21500 KiB
9Accepted10ms21624 KiB
10Accepted10ms21868 KiB
11Accepted10ms21944 KiB
subtask435/35
12Accepted37ms24692 KiB
13Accepted236ms41668 KiB
14Accepted101ms32696 KiB
15Accepted52ms28276 KiB
16Accepted71ms29956 KiB
17Accepted165ms38576 KiB
18Accepted63ms28696 KiB
19Accepted90ms31796 KiB
20Accepted210ms41984 KiB
21Accepted268ms43128 KiB