Submit solution
Points:
10 (partial)
Time limit:
0.75s
Java
2.0s
Python
2.0s
Memory limit:
256M
Authors:
Problem types
Today, Tony the Alpaca needs some help with an array he found in the grass!
Tony gives you an array
Given these parameters, Tony wants to know if there are
Also, since Tony hates numbers that are the same,
Constraints
Subtask 1 [10%]
Subtask 2 [90%]
No additional constraints.
Input Specification
The first line of input contains two integers
The second line of input contains
The final
Output Specification
For each query, output YES
if there are two distinct indices that multiply to NO
otherwise.
Sample Input 1
Copy
5 3
1 5 5 2 3
1 3 25
1 4 6
1 5 10
Sample Output 1
Copy
NO
NO
YES
Sample Input 2
Copy
6 4
2 4 2 4 2 4
1 3 8
1 6 5
1 2 1
1 5 16
Sample Output 2
Copy
YES
NO
NO
NO
Comments