# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1219541 | checker1234 | 별들과 삼각형 (IZhO11_triangle) | C++20 | 369 ms | 9216 KiB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int n;
cin>>n;
vector<pair<int,int>>a(n);
map<int,int>freqx,freqy;
for(int i=0;i<n;i++)
{
cin>>a[i].first>>a[i].second;
freqx[a[i].first]++;
freqy[a[i].second]++;
}
int cnt=0;
for(int i=0;i<n;i++)
{
int cx=freqx[a[i].first]-1;
int cy=freqy[a[i].second]-1;
cnt+=cx*cy;
}
cout<<cnt<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |