QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#752402 | #858. GCD vs. XOR | kangkunma | Compile Error | / | / | Python3 | 324b | 2024-11-16 01:59:32 | 2024-11-16 01:59:32 |
Judging History
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