ホームページ  >  記事  >  データベース  >  Codeforces div.2 B. The Child and Set

Codeforces div.2 B. The Child and Set

WBOY
WBOYオリジナル
2016-06-07 15:18:221371ブラウズ

At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of important things were lost, in particular the favorite set of Picks. Fortunately, Picks remembers something about his set S :

At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of important things were lost, in particular the favorite set of Picks.

Fortunately, Picks remembers something about his set S:

  • its elements were distinct integers from 1 to limit;
  • the value of Codeforces div.2 B. The Child and Set was equal to sum; here lowbit(x) equals 2k where k is the position of the first one in the binary representation of x. For example, lowbit(100102)?=?102,?lowbit(100012)?=?12,?lowbit(100002)?=?100002 (binary representation).

Can you help Picks and find any set S, that satisfies all the above conditions?

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。