Created
January 16, 2020 08:07
-
-
Save shiopon01/81edcef5b9e8085f3be3e3b194fda5be to your computer and use it in GitHub Desktop.
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
package main | |
import "fmt" | |
func main() { | |
var n int | |
fmt.Scan(&n) | |
a := make([]int, n) | |
for i := 0; i < n; i++ { | |
fmt.Scan(&a[i]) | |
} | |
res := 0 | |
loop := true | |
for { | |
for i := 0; i < len(a); i++ { | |
if a[i] == 0 || a[i]%2 == 1 { | |
loop = false | |
break | |
} else { | |
a[i] = a[i] / 2 | |
} | |
} | |
if !loop { | |
break | |
} | |
res++ | |
} | |
fmt.Printf("%v", res) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment