标签:io os sp bs amp nbsp c ios algorithm
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<set>
using namespace std;
int a,m;
bool flag[100010]={0};
int main()
{
while(scanf("%d%d",&a,&m)!=EOF)
{
int f=1;
flag[a]=1;
while(f==1)
{
a=(a+a%m)%m;
if(a==0) break;
else
{
if(flag[a]==0)
flag[a]=1;
else
f=0;
}
}
if(f)
printf("Yes");
else
printf("No");
}
return 0;
}
标签:io os sp bs amp nbsp c ios algorithm
原文地址:http://www.cnblogs.com/a972290869/p/4101134.html