Skip to content

Instantly share code, notes, and snippets.

@hamuhei1412
Last active March 21, 2018 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamuhei1412/b2b9ee4fd71b9cddb5909b76b7a0862c to your computer and use it in GitHub Desktop.
Save hamuhei1412/b2b9ee4fd71b9cddb5909b76b7a0862c to your computer and use it in GitHub Desktop.
ABC081B
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