超时数次。。终于900ms过了。。。 import sys import math def GCD(x,y): if y==0: return x else: return GCD(y,x%y) for line in sys.stdin: line=line.split() count=0 n1=int(line[0]) n2=int(line[1]) if n1==n2: count=1 else: n3=n1*n2 n4=int(math.sqrt(n3)+1) for i in range(n1,n4): if n3%i==0 and GCD(i,n3/i)==n1: count+=1 count*=2 print count