15532022-11-24 12:01:201478Csodálatos Csillagképekcpp11Wrong answer 65/100230ms41856 KiB
#include <iostream>
#include <fstream>
#include <vector>

using namespace std;

vector<vector<int>> x(200001);
vector<vector<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;
    }
    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
1Accepted9ms20672 KiB
subtask225/25
2Accepted8ms20808 KiB
3Accepted8ms20800 KiB
4Accepted8ms20808 KiB
5Accepted9ms21068 KiB
subtask340/40
6Accepted9ms21272 KiB
7Accepted10ms21528 KiB
8Accepted9ms21416 KiB
9Accepted8ms21668 KiB
10Accepted8ms21616 KiB
11Accepted10ms21888 KiB
subtask40/35
12Wrong answer35ms23824 KiB
13Accepted230ms41012 KiB
14Accepted108ms33160 KiB
15Wrong answer50ms26240 KiB
16Wrong answer68ms27280 KiB
17Accepted164ms37940 KiB
18Accepted61ms28560 KiB
19Wrong answer89ms28568 KiB
20Accepted206ms40948 KiB
21Accepted212ms41856 KiB