QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#752426#858. GCD vs. XORkangkunmaWA 1108ms142792kbPython3519b2024-11-16 02:44:352024-11-16 02:44:37

Judging History

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

  • [2024-11-16 02:44:37]
  • 评测
  • 测评结果:WA
  • 用时:1108ms
  • 内存:142792kb
  • [2024-11-16 02:44:35]
  • 提交

answer

D=[[] for _ in range(1000001)];x=0
for i in range(1000):
    if not i%2:continue
    for j in range(i+1,1000000//(1+i)):D[(i+1)*j]+=[i+1]
def s(l):
    C=[0]*1000001;A=0
    for i in l:C[i]+=1
    for i in set(l):
        if i%2:continue
        for j in D[i]:
            if i+j>1000000:break
            A+=C[i]*C[j+i]*((i+j)==j|i)
            if i//j+i<=1000000:A+=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))

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1108ms
memory: 142792kb

input:

1
4
2 3 4 3

output:

0

result:

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