QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#477963#1176. BinomialkangkunmaWA 13ms18520kbPython3447b2024-07-14 14:18:412024-07-14 14:18:42

Judging History

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

  • [2024-07-14 14:18:42]
  • 评测
  • 测评结果:WA
  • 用时:13ms
  • 内存:18520kb
  • [2024-07-14 14:18:41]
  • 提交

answer

def s(l):
    B=[[]for _ in range(20)];A=0;N=[0]*1000001;p=set(l[::])
    for i in l:
        x=i;N[i]+=1
        for j in range(20):B[j]+=[i]*(x%2<1);x//=2
    for i in range(20): B[i]=set(B[i])
    for i in l:
        x=i;t=p
        for j in range(20):
            if x%2<1:t&=B[j]
            x//=2
        A+=sum([N[k] for k in t])
    return A
for _ 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: 13ms
memory: 18520kb

input:

2
3
1 5 6
3
1 1 1

output:

2
9

result:

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