All submissions for this problem are available.
Given a binary number (of $N$ bits) $X$. Find the highest power of 2 that divides this number.Note: If the binary number is "100" then the highest power of 2 that divides it is 2 (as $2^2$ = 4)
- The first line contains N the number of bits in the number
- The next line contains a binary number of N bits
- The first and only line contains the max power of 2 that divides the given number
- $1 \leq N \leq10^5$
- $1\leq X$
|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, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.