Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. uint64_t MD = 100000000;
  6.  
  7. int main()
  8. {
  9. #ifdef AT_MY_PC
  10. freopen("input.txt", "r", stdin);
  11. #endif
  12. ios::sync_with_stdio(0);
  13. cin.tie(nullptr);
  14.  
  15. uint64_t m = 4294967296, n;
  16. cin >> n;
  17. uint64_t x, y;
  18. cin >> x >> y;
  19. vector<uint64_t> tst = {y};
  20. uint64_t t1 = ceil(1.0*x*m / MD), t2 = (x+1)*m / MD;
  21. for(uint64_t i = 0; i < n-1; ++i)
  22. {
  23. uint64_t tmp1, tmp2;
  24. cin >> tmp1 >> tmp2;
  25. tst.push_back(tmp1);
  26. tst.push_back(tmp2);
  27. }
  28. for(uint64_t i = t1; i <= t2; ++i)
  29. {
  30. bool flag = 1;
  31. uint64_t t = i;
  32. for(auto &j : tst)
  33. {
  34. t = (t*134775813 + 1)%m;
  35. uint64_t nts = MD*t / m;
  36. if(nts != j)
  37. flag = 0;
  38. }
  39. if(flag)
  40. {
  41. cout << "RAW";
  42. return 0;
  43. }
  44. }
  45. cout << "SHUFFLED";
  46.  
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement