# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1220985 | boclobanchat | Star triangles (IZhO11_triangle) | C++20 | 381 ms | 22752 KiB |
#include<bits/stdc++.h>
using namespace std;
map<int,int> mpa,mpb;
map< pair<int,int>,int > mp;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
int x,y;
cin>>x>>y;
mpa[x]++,mpb[y]++,mp[{x,y}]++;
}
long long ans=0;
for(auto v:mp) ans+=1LL*v.second*(mpa[v.first.first]-v.second)*(mpb[v.first.second]-v.second);
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |