#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
// freopen ("triangles.in","r",stdin);
// freopen ("triangles.out","w",stdout);
ll n;
cin>>n;
map<ll,ll>x,y;
vector<pair<int,int>>v;
for(ll i = 0;i<n;i++){
ll a,b;
cin>>a>>b;
v.push_back({a,b});
x[a]++;
y[b]++;
}
ll ans = 0;
for(int i = 0;i<n;i++){
ans+=(x[v[i].first]-1)*(y[v[i].first]-1);
}
cout<<ans<<endl;
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
// ll t;cin>>t;while(t--)
solve();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |