你是怎么了你 好几篇帖子了
看到题解按钮了吗 点一下
神金,害我笑了一下。wyy建议紫衫
by yhx8888 @ 2024-07-26 19:07:33
您这个是 $n^2$ 吧,过不了哦。
by WY_L @ 2024-07-26 19:12:14
@[Cyq15655281024](/user/1274346) 一个双重循环就能解决的事,你还整这么麻烦干啥子?
by jntmhh @ 2024-07-26 19:13:41
谢谢
by Cyq15655281024 @ 2024-07-26 19:16:02
@[jntmhh](/user/1276299) 您的代码好像发错了
by Cyq15655281024 @ 2024-07-26 19:19:53
```
#include<bits/stdc++.h>
using namespace std;
int t,n;
int a[100010];
int main(){
cin>>t;
while(t--){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}
sort(a+1,a+n+1);
for(int i=1;i<n;i++){
if(a[n]%a[i]!=0){
a[n]=0;
break;
}
}
if(a[n]==0) cout<<"No"<<endl;
else cout<<"Yes"<<endl;
}
return 0;
}
```
对不起
怎么办我发成上一题的代码了
by jntmhh @ 2024-07-26 19:22:13
@[Cyq15655281024](/user/1274346) 对不起 对不起对不起
by jntmhh @ 2024-07-26 19:25:49
真的很对不起啊@[Cyq15655281024](/user/1274346)
by jntmhh @ 2024-07-26 19:26:31
@[jntmhh](/user/1276299) ??????????????双重循环不是 $n^2t$ 算法?
by WY_L @ 2024-07-26 19:31:38
@[jntmhh](/user/1276299) 对不起,没看到下面的回复。
by WY_L @ 2024-07-26 19:32:20