Last active
March 21, 2018 14:45
-
-
Save hamuhei1412/b2b9ee4fd71b9cddb5909b76b7a0862c to your computer and use it in GitHub Desktop.
ABC081B
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N = gets.to_i #配列のサイズを取得(特にこのあと使わないけど) | |
ar = gets.split.map(&:to_i) #空白区切りの配列を取得 | |
ans = 1000000000 #答えの変数を大きい値で初期化 | |
for moke in ar do #配列の中の要素をmokeに入れてぶん回す | |
s = 0 #mokeが2で割れる回数を0で初期化 | |
while moke%2==0 do #このループ内でmokeが2で割れる回数を求める | |
moke /= 2 | |
s += 1 | |
end | |
ans = (ans<s ? ans : s) #sがansより小さければsをansに代入 | |
end | |
puts ans |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment