标签:i++ vector arp pre namespace csharp amp ORC bit
#include <bits/stdc++.h> #define ll long long using namespace std; const int maxn=1e6+10; vector<int>ve; int n,p; int main() { scanf("%d %d",&n,&p); for(int i=2; i*i<=p; i++) { if(p%i==0) { ll res=i; while(p%(res*i)==0&&p>=(res*i)) res*=i; p/=res; ve.push_back(res); } } if(p!=1)ve.push_back(p); for(int i=1; i<=n; i++) { int x; scanf("%d",&x); for(int i=0; i<ve.size(); i++) { if(ve[i]==0)continue; if(x%ve[i]==0)ve[i]=0; } } for(int i=0; i<ve.size(); i++) if(ve[i]!=0) { cout<<"No"<<endl; return 0; } cout<<"Yes"<<endl; return 0; }
codeforces#687 B. Remainders Game
标签:i++ vector arp pre namespace csharp amp ORC bit
原文地址:https://www.cnblogs.com/carcar/p/10215968.html