Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define all(x) (x).begin(), (x).end()
- using namespace std;
- typedef unsigned long long ull;
- typedef long long ll;
- typedef long double ld;
- typedef pair<int, int> pii;
- /// TODO: hack gp_hash_table
- /// TODO: write string & long double hacks
- const int SEED = 10000;
- //const int DEG = 444487; // ++17
- //const int DEG = 520241; // all other
- //const int DEG = 256279; // C++11, 14, 17-x64, 17 (tr1::)
- const int DEG = 218971; // C++17
- //const int DEG = 202409; // for reserved 2e5
- //const int DEG = 410857; // for reserved 4e5
- //const int DEG = 262144; // for MSVC++17
- //const int DEG = 1142821; // special bonus
- int cur = 0;
- int nxt() {
- cur += DEG;
- if (cur >= int(1e9))
- cur = (cur % DEG) + 1;
- return cur;
- }
- int comp(int a, int b) {
- return a % DEG == b % DEG ? a / DEG > b / DEG : a % DEG > b % DEG;
- }
- int main() {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- constexpr int n = 199999;
- mt19937 gen(SEED);
- int skip = uniform_int_distribution<>(1, 1000000)(gen);
- while (skip--)
- nxt();
- vector<int> v;
- cout << 1 << "\n" << n << "\n";
- ll sum = 0;
- for (int i = 0; v.size() < n && i < n; ++i) {
- int cur;
- cur = nxt();
- //do cur = nxt() * 412705471LL; while (cur < 0 || cur > (int)1e9);
- if (i == n-1)
- cur = n - sum % n;
- sum += cur;
- v.push_back(cur);
- swap(v[i], v[uniform_int_distribution<>(0, i)(gen)]);
- }
- //sort(all(v));
- //reverse(all(v));
- for (int i = 0; i < n; ++i)
- cout << (i ? " " : "") << v[i];
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement