# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112562 | Tsagana | Star triangles (IZhO11_triangle) | C++14 | 412 ms | 15432 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>
using namespace std;
#define L long long
int main(){
L n,i,a[300001],b[300001],s=0;
map<L,L>x,y;
cin>>n;
for(i=1;i<=n;i++){
cin>>a[i]>>b[i];
x[a[i]]++;
y[b[i]]++;
}
for(i=1;i<=n;i++){
s+=(x[a[i]]-1)*(y[b[i]]-1);
}
cout<<s;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |