QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#752402#858. GCD vs. XORkangkunmaCompile Error//Python3324b2024-11-16 01:59:322024-11-16 01:59:32

Judging History

你现在查看的是最新测评结果

  • [2024-11-16 01:59:32]
  • 评测
  • [2024-11-16 01:59:32]
  • 提交

answer

def s(l):
    C=[0]*2000001;A=0
    for i in l:C[i]+=1
    for i in set(l):
        for j in range(1,min(2000000-i,int(i**.5))+1):
            if i%j<1:A+=C[i]*C[j+i]*((i+j)==j||i)+C[i]*C[i//j+i]*(i+i//j==(i//j)||i)*(j**2!=i)
    return A
for i in range(int(input())):input();l=[*map(int,input().split())];print(s(l))

Details

  File "answer.code", line 6
    if i%j<1:A+=C[i]*C[j+i]*((i+j)==j||i)+C[i]*C[i//j+i]*(i+i//j==(i//j)||i)*(j**2!=i)
                                      ^
SyntaxError: invalid syntax