Submit | All submissions | Best solutions | Back to list |
EC_CONB - Even Numbers |
Marina is a college girl who likes to play with all kinds of numbers. One day she was very bored and decided to play around with even numbers.
She notes N numbers on the board(odd and even numbers) and then, she modifies only even numbers (for some reason she likes the odd numbers) and inverts its binary representation and replaces each even number. But soon she gets bored and ask you help in order to automate the conversion process.
Marina is a college girl who likes to play with all kinds of numbers. One day she was very bored and decided to play around with even numbers.
She writes N numbers on the board (odd and even numbers) and then, she modifies only even numbers (for some reason she likes the odd numbers) and reversed its binary representation (from the left to the right ) and replaces each even number. But soon she gets bored and ask you help in order to automate the conversion process.
Input
In the first line contains the value of N. This integer is followed by N lines, every one with a positive integer ai (1 <= ai <= 10^7).
Output
The output will contain N lines, the numbers that are on the blackboard after the conversion process.
Example
Input: 5 10 8 3 5 2 Output: 5 1 3 5 1
Added by: | Eddy Cael |
Date: | 2013-10-12 |
Time limit: | 1s |
Source limit: | 2000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | C CSHARP C++ 4.3.2 CPP C99 HASK JAVA PYTHON RUBY |
hide comments
|
||||||||
2015-08-20 20:29:00
Easy one.... :) |
||||||||
2015-08-15 08:50:14 RADHE SHYAM LODHI
50th ! :) |
||||||||
2015-08-14 19:23:54 7Bubble
The statement is quit.. confusing..!! For clarification please see vedang's comment ... |
||||||||
2015-08-01 14:23:45 vedang
Technically, it's not inverted binary. It's reversing the binary representation of a number. |
||||||||
2015-07-21 08:54:30 Indian Cyber Army (IndiShell)
For all those who got confused like me, in this problem inverting the bits does NOT mean changing each bit from 0 to 1 and from 1 to 0. It simply means, rotating the bits around like 0111 to 1110 etc.. Last edit: 2015-07-21 09:11:52 |
||||||||
2015-07-17 08:12:29 :?ToRpiDo
cake piece.:-) |
||||||||
2015-07-10 16:37:47
playing with bits............. |
||||||||
2015-07-02 21:55:46 Meek
Tried vector 1st time -> green ;) |
||||||||
2015-06-26 09:11:16 Ankush
8 lines with python ;) |
||||||||
2015-06-02 19:14:42 akar sheth
very easy ;) AC at first try. |