至GESP4级以下的人
2026-03-01 13:42:03
发布于:四川
21阅读
0回复
0点赞
#include <iostream>
using namespace std;
const int MAXN = 100010;
long long a[MAXN];
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
long long maxx = a[0];
for (int i = 1; i < n; i++) {
if (a[i] > maxx) maxx = a[i];
}
bool flag = true;
for (int i = 0; i < n; i++) {
if (maxx % a[i] != 0) {
flag = false;
break;
}
}
if (flag) cout << "Yes" << endl;
else cout << "No" << endl;
}
return 0;
}
[:ACGO_gif_崇拜]
全部评论 5
感谢
1周前 来自 上海
0讨厌
1周前 来自 安徽
0
1周前 来自 安徽
0

1周前 来自 安徽
0


1周前 来自 安徽
0














有帮助,赞一个