Submission #881269

#TimeUsernameProblemLanguageResultExecution timeMemory
881269Chal1shkanXoractive (IZhO19_xoractive)C++14
Compilation error
0 ms0 KiB
# include "interactive.h" # include <bits/stdc++.h> # define pb push_back # define ff first # define ss second # define nl "\n" # define sz(x) ((int)(x).size()) # define all(x) (x).begin(), (x).end() # define deb(x) cerr << #x << " = " << x << endl; # define pll pair <ll, ll> # define pii pair <int, int> typedef long long ll; typedef unsigned long long ull; typedef long double ld; const ll maxn = (ll)2e5 + 7; const ll inf = (ll)2e18 + 0; const ll mod = (ll)1e9 + 7; const ll dx[] = {-1, 1, 0, 0}; const ll dy[] = {0, 0, -1, 1}; using namespace std; mt19937 rng(239017); vector <int> guess (int n) { vector <int> ans(n, 0); ans[0] = ask(1); map <int, int> mp[7]; set <int> st; for (int bit = 0; bit < 7; ++bit) { vector <ll> q[2]; for (int i = 2; i <= n; ++i) { if (i & (1LL << bit)) { q[0].pb(i); q[1].pb(i); } } q[1].pb(1); map <int, int> cnt; q[0] = get_pairwise_xor(q[0]); q[1] = get_pairwise_xor(q[1]); for (int x : q[1]) cnt[x]++; for (int x : q[0]) cnt[x]--; for (auto [x, y] : cnt) { if (y == 2) { int num = ans[0] ^ x; mp[bit][num]++; st.insert(num); } } } for (int x : st) { int id = 0; for (int bit = 0; bit < 7; ++bit) { if (mp[bit][x]) { id += (1LL << bit); } } ans[id - 1] = x; } return ans; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:42:30: error: could not convert 'q[0]' from 'vector<long long int>' to 'vector<int>'
   42 |   q[0] = get_pairwise_xor(q[0]);
      |                           ~~~^
      |                              |
      |                              vector<long long int>
Xoractive.cpp:43:30: error: could not convert 'q[1]' from 'vector<long long int>' to 'vector<int>'
   43 |   q[1] = get_pairwise_xor(q[1]);
      |                           ~~~^
      |                              |
      |                              vector<long long int>
Xoractive.cpp:46:13: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   46 |   for (auto [x, y] : cnt) {
      |             ^