QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#752426 | #858. GCD vs. XOR | kangkunma | WA | 1108ms | 142792kb | Python3 | 519b | 2024-11-16 02:44:35 | 2024-11-16 02:44:37 |
Judging History
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'