# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
878475 | Kak008723 | Star triangles (IZhO11_triangle) | C++14 | 243 ms | 12408 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define x first
#define y second
using namespace std;
const int N = 3e5+5;
pair<int,int> p[N];
map<int,int> mp,mp1;
int main(){
ios::sync_with_stdio(0);cin.tie(0);
cout.tie(0);
int n,ans=0;
cin>>n;
for(int i=1;i<=n;i++) cin>>p[i].x>>p[i].y, mp[p[i].x]++,mp1[p[i].y]++;
for(int i=1;i<=n;i++){
ans += (long long )(mp[p[i].x]-1) * (long long )(mp1[p[i].y]-1);
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |