cswork / OA打开练习工作台

RubrikOA #4

Two's Power (Regex)

估计简单可在线判题

考点(AI 标注)字符串

Determine whether the positive integer represented by a binary string is a power of 2. Leading zeros are allowed; zero itself is not a power of 2. The original problem asks for a regex match; this problem turns the locked match result into the standard output True/False.

输入格式

One line containing a non-empty binary string s (length 1..200000; a bound added by this site).

输出格式

Output True or False.

样例 1

输入:

1

输出:

True

样例 2

输入:

0001000

输出:

True

样例 3

输入:

101

输出:

False