标签:ice eve generate res where imu careful ini through
1 #include <iostream> 2 #include <cstring> 3 #include <set> 4 #include <cstdio> 5 6 using namespace std; 7 8 9 int main(){ 10 int step,mod,v=0,n; 11 set<int> s; 12 set<int>::iterator it; 13 while(cin>>step>>mod){ 14 printf("%10d%10d",step,mod); 15 n = mod-1; 16 s.insert(v); 17 while(n--){ 18 v = (v+step)%mod; 19 it = s.find(v); 20 if(it!=s.end()){ 21 break; 22 } 23 s.insert(v); 24 } 25 if(s.size()== mod)printf(" Good Choice\n\n"); 26 else printf(" Bad Choice\n\n"); 27 s.clear(); 28 } 29 }
标签:ice eve generate res where imu careful ini through
原文地址:http://www.cnblogs.com/lueagle/p/6413723.html