Submit | All submissions | Best solutions | Back to list |
POWEROF2 - Next power of 2 |
Wersja polska | English version |
For gven integer n print next power of 2 greater than n.
Input
The first line of the standard input contains one integer t (t<10001) which is the number of test cases.
In each of the next t lines there is an integer n (0<=n<=10^9).
Output
For each test, print the next power of 2 greater than n.
Example
Input: 5
5
4
10
16
100
Output: 8
8
16
32
128
Added by: | Piotr Kąkol |
Date: | 2010-03-21 |
Time limit: | 2.828s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: NODEJS OBJC SCM qobi VB.NET |
hide comments
|
||||||
2011-04-19 13:16:53 512_I
@Piotr: I dont know y i m getting NZEC :( |
||||||
2011-04-07 23:03:47 Piotr KÄ…kol
For n=0 1 and for n=1 2. |
||||||
2011-04-06 17:03:34 anonymous
What should be the output for n=0 and n=1? Thanks. |