Live DEMO on Codejam
Live DEMO
console.log(1 << 1) // <- gives `2`
console.log(1 << 2) // <- gives `4`
console.log(1 << 2, Math.pow(2, 2)) // <- gives `true`
console.log(1 << 10, Math.pow(2, 10)) // <- gives `true`
console.log(1 << 50, Math.pow(2, 50)) // <- gives ...?
console.log(1 << 1) // <- gives `2`
console.log(1 << 2) // <- gives `4`
console.log(1 << 2, Math.pow(2, 2)) // <- gives `true`
console.log(1 << 10, Math.pow(2, 10)) // <- gives `true`
console.log(1 << 50, Math.pow(2, 50)) // <- gives `false`
package main
func main() {
n := 0
fmt.Scan(&n) // n is big
a := make([]int, n) // make a slice that contains n elements
for i := 0; i < n; i++ {
fmt.Scan(&a[i])
}
// You awesome algorithm,
// that have good time complexity,
// super fast, must get passed.
// Then...
}
But how do to know these kind of tips?
or
And more(DEMO)...
And, Of course, joining this meetup often.
Questions?