PersonalCorpus 版 (精华区)
39078 2002-10-06 02:58:19 Accepted
1314 C++ 00:00.01 480K Big Guava
int main()
{
#ifndef ONLINE_JUDGE
freopen("c:\\uva\\input408.txt","r",stdin);
freopen("c:\\uva\\output408.txt","w",stdout);
#endif
char m[100000];
int i,j,k,s,n;
while (scanf("%d%d\n",&s,&n)==2) {
memset(m,0,sizeof(m));
i=0;
while (m[i]==0) {
m[i]=1;
i=(i+s)%n;
}
for (i=0;i<n;i++) if (m[i]==0) break;
printf("%10d%10d ",s,n);
if (i==n) printf("Good Choice\n\n"); else printf("Bad
Choice\n\n");
}
}
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:1.824毫秒