# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
288154 | errorgorn | Xoractive (IZhO19_xoractive) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//雪花飄飄北風嘯嘯
//天地一片蒼茫
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl
#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
//change less to less_equal for non distinct pbds, but erase will bug
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
const int n=8;
int arr[2*n];
multiset<int> s;
bool can(int i){
rep(x,0,n) if (!s.count(arr[x]^i)) return false;
return true;
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin.exceptions(ios::badbit | ios::failbit);
rep(x,0,2*n){
do{
arr[x]=rng()%1000;
} while (s.count(arr[x]));
s.insert(arr[x]);
}
s.clear();
rep(x,0,n) rep(y,n,2*n) s.insert(arr[x]^arr[y]);
rep(x,0,2*n) cout<<arr[x]<<" "; cout<<endl<<endl;
rep(x,0,32){
if (can(x)) cout<<x<<endl;
}
}