Submission #958359

# Submission time Handle Problem Language Result Execution time Memory
958359 2024-04-05T14:19:01 Z kilkuwu Xoractive (IZhO19_xoractive) C++17
0 / 100
1 ms 600 KB
#include "interactive.h"
#include <bits/stdc++.h>
using namespace std;

vector<int> guess(int n) {  // ask, getpairwisexor
  std::vector<int> ans(n);
  ans[0] = ask(1);

  std::map<int, int> mp;

  for (int b = 6; b >= 0; b--) {
    std::vector<int> ids;
    for (int i = 1; i < n; i++) {
      if (i >> b & 1) {
        ids.push_back(i + 1);
      }
    }

    auto a1 = get_pairwise_xor(ids);
    ids.push_back(1);
    auto a2 = get_pairwise_xor(ids);

    std::multiset<int> s(a1.begin(), a1.end());

    for (int i : a2) {
      s.erase(s.find(i));
    }

    for (int i : s) {
      mp[i ^ ans[0]] ^= 1 << b;
    }
  } 

  for (auto [f, s] : mp) {
    ans[s] = f;
  }

  return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -