#include <iostream>
constexpr size_t to_bin(const char* str, size_t i) //i is last index of string
{
return i == 0 ? str[i] - '0' : str[i] - '0' + to_bin(str, i - 1) * 2;
}
constexpr size_t operator "" _bin(const char* str, size_t len)
{
return to_bin(str, len - 1);
}
int main()
{
std::cout << "101"_bin << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgogCmNvbnN0ZXhwciBzaXplX3QgdG9fYmluKGNvbnN0IGNoYXIqIHN0ciwgc2l6ZV90IGkpIC8vaSBpcyBsYXN0IGluZGV4IG9mIHN0cmluZwp7CiAgICByZXR1cm4gaSA9PSAwID8gc3RyW2ldIC0gJzAnIDogc3RyW2ldIC0gJzAnICsgdG9fYmluKHN0ciwgaSAtIDEpICogMjsgIAp9CiAKY29uc3RleHByIHNpemVfdCBvcGVyYXRvciAiIiBfYmluKGNvbnN0IGNoYXIqIHN0ciwgc2l6ZV90IGxlbikKewogICAgcmV0dXJuIHRvX2JpbihzdHIsIGxlbiAtIDEpOwp9CiAKaW50IG1haW4oKQp7CiAgICBzdGQ6OmNvdXQgPDwgIjEwMSJfYmluIDw8IHN0ZDo6ZW5kbDsKfQ==