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 "messy.h"
#include <vector>
using namespace std;
// <|°_°|>
// JeanBombeur & M. Broccoli
// The hardest choices require the strongest wills
// What is better - to be born good, or to overcome your evil nature with great effort ?
vector <int> restore_permutation(int nbBits, int nbWrites, int nbReads) {
vector <int> Ans(nbBits, 0);
string word(nbBits, '0');
for (int bit = 1; bit < nbBits; bit <<= 1)
{
for (int i = 0; i < nbBits; i ++)
{
if (i & bit)
{
word[i] ^= '0' ^ '1';
add_element(word);
word[i] ^= '0' ^ '1';
}
}
for (int i = 0; i < nbBits; i ++)
{
if (i & bit)
word[i] ^= '0' ^ '1';
}
}
compile_set();
word = string(nbBits, '0');
for (int bit = 1; bit < nbBits; bit <<= 1)
{
for (int i = 0; i < nbBits; i ++)
{
word[i] ^= '0' ^ '1';
if (check_element(word))
Ans[i] ^= bit;
word[i] ^= '0' ^ '1';
}
for (int i = 0; i < nbBits; i ++)
{
if (Ans[i] & bit)
word[i] ^= '0' ^ '1';
}
}
return Ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |