Algorithm - GCD and LCM problems
问题 Input for this problem is an array A of positive integers and single positive integer k. The output of the program is True if k is in the set S defined below, False otherwise. Define the set S as follows: if x is in A then x is in S if x and y are in S, then GCD(x,y) is in S if x and y are in S, then LCD(x,y) is in S Additional constraints: The size of the array A is ≤ 50000, k ≤ 10 12 , and x ≤ 10 12 for each x in A. The program must return an answer in 1 second or less. I don't have any