Powers of 2
Statement
Goal
You are a security guard on a weird planet, whose role is to remove impostors from the crowd coming in. For unique identification, everyone in the crowd has a identification number. You are instructed to allow the permit based on their identification number.The rule of this weird planet is simple, If the identification number is a power of 2 then don't allow the person, otherwise allow the person.
Input
Line 1: n The number of persons.
Line 2: consisting of n space separated identification numbers x of the persons.
Line 2: consisting of n space separated identification numbers x of the persons.
Output
A line consisting of n space separated values v corresponding to n persons.
v will be0 for person which is disallowed and 1 for person which is allowed.
v will be
Constraints
1 <= n <= 20
1 <= x < 3^30
1 <= x < 3^30
Example
Input
1 2
Output
0
Game modes
Fastest, Shortest
Test cases
Single value Test
Input
1
2
Output
0
Single value Validator
Input
1
1
Output
0
Mix of both 1 Test
Input
7
1 2 16 8 1024 13214242 999
Output
0 0 0 0 0 1 1
Mix of both 1 Validator
Input
7
1 2 16 8 1024 13214242 999
Output
0 0 0 0 0 1 1
Large powers of 2 Test
Input
3
1024 536870912 1073741824
Output
0 0 0
Large powers of 2 Validator
Input
3
1024 268435456 536870912
Output
0 0 0
Mix of both 2 Test
Input
4
536870912 536870942 536880912 1073741824
Output
0 1 1 0
Mix of both 2 Validator
Input
6
268435456 268335453 268035453 536870912 1073741824 268335
Output
0 1 1 0 0 1
Long array Test
Input
10
2 4 10 16 64 128 256 512 1024 999
Output
0 0 1 0 0 0 0 0 0 1
Long array Validator
Input
11
2 4 10 16 64 68473489 128 256 512 1024 999
Output
0 0 1 0 0 1 0 0 0 0 1
Solution language
Solution
Stub generator input