3AC 7WA help
查看原帖
3AC 7WA help
923445
amcplayer楼主2025/1/1 11:05
#include <bits/stdc++.h>
#define int long long
#define N 200000+10
#define mod 1000000007
//#pragma GCC optimize(3,"Ofast","inline")
using namespace std;
struct Hole
{
	int x,y;
}h[N];
signed main()
{
//    freopen("god.in", "r", stdin);
//    freopen("god.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>h[i].x>>h[i].y;
	}
	int z=0;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			if(i==j)
			{
				continue;
			}
			if(h[i].y==h[j].y)
			{
				z++;
			}
		}
	}
	cout<<z/2;
	return 0;
	
}
/*
 OB->O
*/
2025/1/1 11:05
加载中...