Submission #8872475


Source Code Expand

Copy
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

MOD = 10 ** 9 + 7

N = int(readline())
A = np.array(read().split(),np.int64)

answer = 0
for n in range(63):
    B = (A >> n) & 1
    x = np.count_nonzero(B)
    y = N - x
    x *= y
    for _ in range(n):
        x *= 2
        x %= MOD
    answer += x
answer %= MOD
print(answer)

Submission Info

Submission Time
Task D - Xor Sum 4
User maspy
Language Python (3.4.3)
Score 400
Code Size 441 Byte
Status AC
Exec Time 301 ms
Memory 38584 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 21
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All corner_01, corner_02, corner_03, random_11, random_12, random_13, random_14, random_15, random_21, random_22, random_23, random_24, random_25, random_31, random_32, random_33, random_34, random_35, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
corner_01 AC 192 ms 15764 KB
corner_02 AC 245 ms 20024 KB
corner_03 AC 194 ms 19328 KB
random_11 AC 151 ms 12428 KB
random_12 AC 150 ms 12392 KB
random_13 AC 149 ms 12428 KB
random_14 AC 149 ms 12392 KB
random_15 AC 152 ms 12392 KB
random_21 AC 165 ms 14416 KB
random_22 AC 163 ms 14380 KB
random_23 AC 165 ms 14380 KB
random_24 AC 164 ms 14416 KB
random_25 AC 164 ms 14416 KB
random_31 AC 293 ms 36536 KB
random_32 AC 296 ms 36532 KB
random_33 AC 297 ms 38584 KB
random_34 AC 297 ms 36532 KB
random_35 AC 301 ms 36532 KB
sample_01 AC 149 ms 12428 KB
sample_02 AC 149 ms 12428 KB
sample_03 AC 148 ms 12428 KB