All submissions for this problem are available.
Chef has studied 2- bit Binary Adder in his Digital Logic Design class. He is amazed by the XOR operator and he believes that a + b = a xor b, where a and b are whole numbers and xor is Bitwise XOR operator.
Chef's teacher's favorite number is n. Chef's teacher is in angry mood and he gives Chef a whole number x (x < n) and asks Chef to compute n + x to test his Binary Addition understanding. Chef answers n xor x.
If Chef gives the right answer, he gets a chocolate otherwise he will have to face the anger of his teacher. What is the no of values of x for which Chef will get a chocolate.
A single integer n.
Output the no of values of x for which Chef gets a chocoloate.
0 <= n <= 1015
Input: 0 Output: 1
Input: 5 Output: 2
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS|
Fetching successful submissions