# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1084783 | 2024-09-07T02:05:23 Z | Math4Life2020 | Magic Show (APIO24_show) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include "Alice.h" using namespace std; using ll = long long; using pii = pair<ll,ll>; const ll SEED = 82014384209183; const ll N = 5000; ll l2(ll x) { return (31-__builtin_clz(x)); } vector<pii> Alice() { ll X = setN((int)N); //X<=10^18<2^60 mt19937 gen(SEED); vector<pii> ans; for (ll x=1;x<N;x++) { ll y=0; ll lx = l2(x); for (ll i=0;i<lx;i++) { ll bv = gen()%60; y += (1LL<<i)*((X>>bv)&1); } ans.push_back({y+1,x+1}); } return ans; }