Submission #89794

# Submission time Handle Problem Language Result Execution time Memory
89794 2018-12-18T12:21:31 Z Atashka01 Star triangles (IZhO11_triangle) C++11
0 / 100
2 ms 580 KB
//Euzibillahiminesseytanirracim Bismillahirrahmanirrahim

/*
ID:
TASK:
LANG: C++
*/

#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define PII pair<int,int>
#define inf 1000000001
using namespace std;

map<int,int> m , p;

int n, x[303001], y[303001], ans;

int main()
{
	
	cin>>n;
	
	for(int i=1;i<=n;i++){
		
		cin>>x[i]>>y[i];
		
		m[x[i]]++;
		p[y[i]]++;
		
	}
	
	
	for(int i=1;i<=n;i++){
		
		ans += (m[x[i]] - 1)*(m[y[i]] - 1);
		
	}
	
	cout<<ans<<"\n";
	
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 380 KB Output is correct
2 Correct 2 ms 412 KB Output is correct
3 Correct 2 ms 580 KB Output is correct
4 Incorrect 2 ms 580 KB Output isn't correct
5 Halted 0 ms 0 KB -