骗分码,直接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;
}
虽然n3跑不满,但n2还是可以卡出来的