# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
241760 | 2020-06-25T12:39:05 Z | valerikk | Xoractive (IZhO19_xoractive) | C++17 | 0 ms | 0 KB |
#include<bits/stdc++.h> using namespace std; /* mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count()); int inter_n; int inter_arr[10]; int ask(int i) { return inter_arr[i]; } int* get_pairwise_xor(int* pos) { int k = sizeof(pos) / 4; int* res = new int[k * k]; for (int i = 0; i < k; i++) { for (int j = 0; j < k; j++) res[i * k + j] = inter_arr[pos[i]] ^ inter_arr[pos[j]]; } sort(res, res + k * k); return res; } */ int[] guess(int n) { int res[n]; for (int i = 0; i < n; i++) res[i] = ask(i + 1); return res; } /* void gen() { inter_n = rnd() % 9 + 2; vector<bool> used(32, 0); for (int i = 0; i < inter_n; i++) { int num = rnd() % 32; while (used[num]) num = rnd() % 32; used[num] = 1; inter_arr[i] = num; } } bool check() { int* ans = guess(inter_n); for (int i = 0; i < inter_n; i++) { if (ans[i] != inter_arr[i]) return 0; } return 1; } */ /* int main() { //ios::sync_with_stdio(false); //cin.tie(0); int t; cin >> t; while (t--) { gen(); if (!check()) { cout << inter_n << '\n'; for (int i = 0; i < inter_n; i++) cout << inter_arr[i] << " "; cout << '\n'; return 0; } } return 0; } */