标签:des style blog io color os sp strong on
1 5 3 6
No Yes
#include <iostream>
#include <string>
#include <string.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
int main()
{
bool f[200006];
long long x;
int m;
while(scanf("%d %d", &x, &m)!=EOF)
{
memset(f, false, sizeof(f));
int flag;
while(f[x]==false && x!=0)
{
f[x]=true;
x=x*2;
x=x%m;
}
if(x==0)
{
cout<<"Yes\n";
}
if(f[x]==true)
{
cout<<"No\n";
}
}
return 0;
}
标签:des style blog io color os sp strong on
原文地址:http://www.cnblogs.com/yspworld/p/4140881.html