# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
491566 | osmanallazov | Star triangles (IZhO11_triangle) | C++14 | 514 ms | 13168 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 ll long long
using namespace std;
int main(){
ll n,x,y;
ll res=0;
map<ll,ll>m,p;
cin>>n;
int a[n],b[n];
for(int i=0;i<n;i++){
cin>>a[i]>>b[i];
m[a[i]]++;
p[b[i]]++;
}
for(int i=0;i<n;i++){
res+=((m[a[i]]-1)*(p[b[i]]-1));
}
cout<<res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |