QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#752394#858. GCD vs. XORkangkunmaML 0ms0kbPython3343b2024-11-16 01:47:212024-11-16 01:47:22

Judging History

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

  • [2024-11-16 01:47:22]
  • 评测
  • 测评结果:ML
  • 用时:0ms
  • 内存:0kb
  • [2024-11-16 01:47:21]
  • 提交

answer

D=[[] for _ in range(2000001)];x=0
for i in range(2000000):
    for j in range(2000000//(1+i)):
        D[i*j]+=[i]
def s(l):
    C=[0]*4000001;A=0
    for i in l:C[i]+=1
    for i in set(l):
        for j in D[i]:A+=C[i]*C[j+i]*(i^(i+j)==j)
    return A
for i in range(int(input())):input();l=[*map(int,input().split())];print(s(l))

詳細信息

Test #1:

score: 0
Memory Limit Exceeded

input:

1
4
2 3 4 3

output:

2

result: