关于P11031
  • 板块灌水区
  • 楼主_hxh
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/9/10 20:23
  • 上次更新2024/9/10 20:26:14
查看原帖
关于P11031
536163
_hxh楼主2024/9/10 20:23

就是这题,这是比赛时打的 70 分的代码。

#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2e2 + 5;
const int M = 2e4 + 5;
int t,n,m,a[N][M],cnt,x,y;
signed main()
{
	cin >> t;
	while (t--)
	{
		memset(a,0,sizeof(a));
		cnt = 0;
		cin >> n >> m;
		while (m--)
		{
			cin >> x >> y;
			if (!a[x][y])
			{
				a[x][y]++;
				cnt++;
			}
		}
		if (cnt < n * 2 - 3)
			cout << "No" << endl;
		else
			cout << "Yes" << endl;
	}
	return 0;
}

这有道理吗?

2024/9/10 20:23
加载中...