Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
struct Median3Killer {
static std::vector<uint32_t> Gen(size_t size) {
size_t k = size / 2;
std::vector<uint32_t> v;
v.reserve(size);
for (size_t i = 1; i < k + 1; ++i) {
if (i & 1) {
v.push_back(i);
} else {
v.push_back(k + i - 1);
}
}
for (size_t i = 1; i < k + 1; ++i) {
v.push_back(2 * i);
}
return v;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.