我太菜了
%韩神
1 #include<iostream> 2 #include<cstdio> 3 #include<cmath> 4 #include<cstdlib> 5 #include<cstring> 6 #include<algorithm> 7 #include<vector> 8 #include<queue> 9 #define inf 2139062143 10 #define ll long long 11 #define MAXN 10001000 12 using namespace std; 13 inline int read() 14 { 15 int x=0,f=1;char ch=getchar(); 16 while(!isdigit(ch)) {if(ch==‘-‘) f=-1;ch=getchar();} 17 while(isdigit(ch)) {x=x*10+ch-‘0‘;ch=getchar();} 18 return x*f; 19 } 20 int n,T,ntp[MAXN],p[MAXN],cnt; 21 void mem() 22 { 23 for(int i=2;i<MAXN;i++) 24 { 25 if(!ntp[i]) p[++cnt]=i; 26 for(int j=1;p[j]*i<MAXN;j++) 27 { 28 ntp[p[j]*i]=1; 29 if(i%p[j]==0) break; 30 } 31 } 32 } 33 int main() 34 { 35 n=read(),T=read(),ntp[1]=1; 36 mem(); 37 while(T--) puts(ntp[read()]?"No":"Yes"); 38 }