请求加强数据
查看原帖
请求加强数据
1122193
FarmerDrone楼主2024/5/12 19:21

骗分码,直接A了:

HACK:

99999
1 2 2 2 2 2 ··· 4 6

#include <bits/stdc++.h> 
using namespace std;

int main() 
{
	int t;
	cin >> t;
	int n;
	while (t--)
	{
		scanf("%d", &n);
		int a[n];
		for (int i = 0; i < n; i++)
			scanf("%d", &a[i]);
		sort(a, a + n);
		for (int i = n - 3; i >= 0; i--)
		{
			for (int j = n - 1; j > i + 1; j--)
				for (int k = j - 1; k > i; k--)
					if (__gcd(a[j], a[k]) == a[i])
						goto f1;
			cout << "No\n";
			goto f2;
			f1:;
		}
		cout << "Yes\n";
		f2:;
	}
	return 0;
}

虽然n3n^3跑不满,但n2n^2还是可以卡出来的

2024/5/12 19:21
加载中...