QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#752401#858. GCD vs. XORkangkunmaWA 15ms26048kbPython3322b2024-11-16 01:58:172024-11-16 01:58:18

Judging History

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

  • [2024-11-16 01:58:18]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:26048kb
  • [2024-11-16 01:58:17]
  • 提交

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

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 15ms
memory: 26048kb

input:

1
4
2 3 4 3

output:

0

result:

wrong answer 1st numbers differ - expected: '2', found: '0'