Submit solution

Points:
5 (partial)

Time limit:
2.0s

Memory limit:
64M

Author:

Problem types

Allowed languages

Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, ~~CommonLisp~~, D, Dart, F#, Forth, Fortran, Go, ~~Groovy~~, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, ~~Nim~~, ~~ObjC~~, OCaml, ~~Octave~~, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Molly's teacher assigned her very tedious homework:

Given an integer , find out if it's a power of two or not.

Molly asks Andrew, but he would much rather play Geometry Dash, so he decides to ~~enslave~~ ask you to do it instead!

#### Input Specification

The first line will contain a single integer, .

Lines will each contain an integer, .

#### Output Specification

For each of the integers, output `T`

if it is a power of , otherwise output `F`

.

#### Constraints

#### Sample Input

```
2
1
3
```

#### Sample Output

```
T
F
```

## Comments

tfw when your brute force solution passes

It's not really brute force/brute force is intended, as your code runs in , which would pass with the constraints.

why am i getting WA for case 11?

This comment is hidden due to too much negative feedback. Click here to view it.

how can you be so contraversial but so true

PASSA EM nlogn ?

pls why i get WA in the case 3

This comment is hidden due to too much negative feedback. Click here to view it.

First, you didn't use the boolean in your loop. Second, use scanf instead of cin. Finally, use long instead of int.

I submitted the exact same code twice and i got TLE (case 24) on one and AC on the other. What's up with that?

Please read this comment. In a nutshell, the judges don't produce the exact same result each time. As your program is really close to the timelimit, this kind of thing can happen.

I implemented an algorithm using Python, but it did not pass. I implemented the same algorithm using C++, and it worked.

This problem has a lot of input, and

`input()`

is too slow; your code passes with`sys.stdin.readline()`

.