| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 40887 | Abelyan | Star triangles (IZhO11_triangle) | C++14 | 419 ms | 38988 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;
const int N=300000;
map<int,int> x,y;
int a[N],b[N];
int main() {
	ios_base::sync_with_stdio(false);
	long long ans=0;
	int n;
	cin>>n;
	for (int i=0;i<n;i++){
		cin>>a[i]>>b[i];
		x[a[i]]++;
		y[b[i]]++;
	}
	for (int i=0;i<n;i++){
		ans+=(long long)(x[a[i]]-1)*(long long)(y[b[i]]-1);
	}
	cout<<ans<<endl;
	return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
