标签:
1 #include <iostream> 2 #include <stdio.h> 3 #include <cstring> 4 #include <queue> 5 #include <set> 6 #include <cmath> 7 #include <time.h> 8 #include <cstdlib> 9 #include <algorithm> 10 using namespace std; 11 12 const int N = 1000007; 13 const int INF = 0x7fffffff; 14 15 inline int ran(){ 16 static int seed = 703; //seed可以随便取 17 return seed = int(seed * 48271LL % INF); 18 } 19 20 set<int> s; 21 22 int main() 23 { 24 while (1) 25 { 26 s.clear(); 27 int flag = 1; 28 for (int i = 0; i < INF / 1000; i++) 29 { 30 int t = ran(); 31 if (s.find(t) == s.end()) 32 s.insert(t); 33 else 34 { 35 flag = 0; 36 break; 37 } 38 } 39 if (flag) 40 printf("YES\n"); 41 else 42 printf("NO\n"); 43 } 44 return 0; 45 }
标签:
原文地址:http://www.cnblogs.com/burning-flame/p/5865976.html