#abc238g. G - Cubic?
G - Cubic?
Score : points
问题描述
给定一个包含 个数的序列 ,回答以下 个问题。
- 在第 个问题中,给出整数 和 。判断 $A_{L_i} \times A_{L_i+1} \times \dots \times A_{R_i}$ 是否为立方数?
这里,正整数 被称为立方数,当且仅当存在一个正整数 使得 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Given a sequence of numbers, answer the following questions.
- In the -th question, you are given integers and . Is $A_{L_i} \times A_{L_i+1} \times \dots \times A_{R_i}$ a cubic number?
Here, a positive integer is said to be a cubic number when there is a positive integer such that .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print lines.
The -th line should contain Yes
if, in the -th question, $A_{L_i} \times A_{L_i+1} \times \dots \times A_{R_i}$ is a cubic number, and No
otherwise.
The checker is case-insensitive; output can be either uppercase or lowercase.
Sample Input 1
8 5
7 49 30 1 15 8 6 10
1 2
2 3
4 4
5 8
3 8
Sample Output 1
Yes
No
Yes
No
Yes
- For the first question, is a cubic number.
- For the second question, is not a cubic number.
- For the third question, is a cubic number.
- For the fourth question, is not a cubic number.
- For the fifth question, $30 \times 1 \times 15 \times 8 \times 6 \times 10 = 216000$ is a cubic number.
update @ 2024/3/10 10:18:11