#include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<algorithm> using namespace std; int jdg[10000001],n,m; int main() { cin>>n>>m; jdg[1]=1; for(int i=2;i<=n;i++) for(int j=i;j<=n/i;j++) jdg[i*j]=1; for(int i=1;i<=m;i++) { int a; cin>>a; if(jdg[a]==0) cout<<"Yes"<<endl; else cout<<"No"<<endl; } return 0; }
原文地址:https://www.cnblogs.com/water-radish/p/9280645.html
时间: 2024-10-13 21:17:26