Please enter your email address or userHandle.
Given a positive integer N. The task is to check if N is a power of 2. That is N is 2x for some x.
The first line contains T denoting the number of test cases. Each test case contains a single positive integer N.
Print "YES" if it is a power of 2 else "NO" (Without the double quotes).
1 <= T <= 100
0 <= N <= 1018
Testcase 1: 1 is equal to 2 raised to 0 (20 == 1).
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.