Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- uint64_t MD = 100000000;
- int main()
- {
- #ifdef AT_MY_PC
- freopen("input.txt", "r", stdin);
- #endif
- ios::sync_with_stdio(0);
- cin.tie(nullptr);
- uint64_t m = 4294967296, n;
- cin >> n;
- uint64_t x, y;
- cin >> x >> y;
- vector<uint64_t> tst = {y};
- uint64_t t1 = ceil(1.0*x*m / MD), t2 = (x+1)*m / MD;
- for(uint64_t i = 0; i < n-1; ++i)
- {
- uint64_t tmp1, tmp2;
- cin >> tmp1 >> tmp2;
- tst.push_back(tmp1);
- tst.push_back(tmp2);
- }
- for(uint64_t i = t1; i <= t2; ++i)
- {
- bool flag = 1;
- uint64_t t = i;
- for(auto &j : tst)
- {
- t = (t*134775813 + 1)%m;
- uint64_t nts = MD*t / m;
- if(nts != j)
- flag = 0;
- }
- if(flag)
- {
- cout << "RAW";
- return 0;
- }
- }
- cout << "SHUFFLED";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement