F. 2025夏-A-1 Walnut Numbers

    传统题 400ms 64MiB

2025夏-A-1 Walnut Numbers

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

题目描述

A positive integer nn is called a "walnut number", if there exists 3 identical consecutive bits in its binary representation. However, it does not count if there are more than 3 identical consecutive bits. For example, 111000 and 1110111 are both walnut numbers, while 1111 and 10000 are not. Your job is to write a program to check if a given positive number is a walnut number.

输入格式

Each input file contains several test cases. The first line gives a positive integer nn (20\le 20), which is the number of cases. Then nn lines follow, each gives a positive number which is no more than 2302^{30}.

输出格式

For each case, print in a line yes if the input number is a walnut number, or no if not.

样例

5
56
119
15
16
3870
yes
yes
no
no
yes

限制

对于所有的测试用例,限制为400ms, 64MB

PAT2025夏季重现赛

未参加
状态
已结束
规则
IOI
题目
9
开始于
2025-7-13 14:00
结束于
2025-7-13 17:30
持续时间
3.5 小时
主持人
参赛人数
45