2 solutions
-
0
#include<bits/stdc++.h> using namespace std; int n; int main() { cin>>n; for(int d=1;d<=n;d++) { int x; int a[100005]; cin>>x; for(int i=1;i<=x;i++) { cin>>a[i]; } bool s=false; for(int i=1;i<=x;i++) { bool f=true; for(int j=1;j<=x;j++) { if(a[i]%a[j]!=0) { f=false; } } if(f) { s=true; break; } } if(s) { cout<<"Yes"<<endl; } else{ cout<<"No"<<endl; } } return 0; }
Information
- ID
- 2182
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- # Submissions
- 43
- Accepted
- 10
- Uploaded By