Submission #976474

# Submission time Handle Problem Language Result Execution time Memory
976474 2024-05-06T15:16:29 Z vjudge1 Star triangles (IZhO11_triangle) C++17
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pb push_back
#define pll pair<ll,ll>

const ll MOD=1e9+7;

//#define ll int
//KALAU TAKUT RTE

bool cmp (pair<ll,ll> x, pair<ll,ll>y){
	return x.second < y.second;
}

signed main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	ll n; cin>>n;
	ll x[n+1], y[n+1], cntx[n+1], cnty[n+1];
	for (int i=1; i<=n;i++){
		cin>>x[i]>>y[i];
		cntx[x[i]]++; cnty[y[i]]++;
	}
	
	ll ans=0;
	for (int i=1; i<=n;i++){
		ans+= (cntx[x[i]]-1) * (cnty[y[i]]-1);
	}
	cout<<ans<<endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -