递推MOD次看一下是不是有 重复项就好
PE了好多次,= =
#include <bits/stdc++.h>
using namespace std;
int n,MOD;
void Gao()
{
int tem=0;
bool good =true;
bool a[110000]={0};
a[0]=true;
for (int i=1;i<MOD;i++)
{
tem=(tem+n)%MOD;
if (a[tem])
good=false;
}
printf("%10d%10d ",n,MOD);
printf(good?"Good Choice\n":"Bad Choice\n");
cout<<endl;
}
int main()
{
// freopen("a.in","r",stdin);
// freopen("a.out","w",stdout);
bool fst=false;
while (cin>>n>>MOD)
Gao();
return 0;
}