Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools
input = sys.stdin.readline

def func(x, nn):
    value = 0
    for i, j in itertools.combinations(range(nn), 2):
        value += x[i] ^ x[j]
    ans = value % (10 ** 9 + 7)
    return ans

def main():
    n = int(input())
    li = tuple(map(int, input().split()))
    print(func(li, n))

if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np
n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    t = arr & 1
    c1 = np.count_nonzero((arr & 1))
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1

print(s % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

def func(x, nn):
    value = 0
    for i in range(nn - 1):
        for j in range(i + 1, nn):
            value += x[i] ^ x[j]
    ans = value % (10 ** 9 + 7)
    return ans

def main():
    n = int(input())
    li = tuple(map(int, input().split()))
    print(func(li, n))

if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np
n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    t = arr & 1
    c1 = np.count_nonzero((arr & 1))
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1

print(s % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

def func(x, nn):
    value = 0
    for i in range(nn - 1):
        for j in range(i + 1, nn):
            value += x[i] ^ x[j]
    ans = value % (10 ** 9 + 7)
    return ans

def main():
    n = int(input())
    li = tuple(map(int, input().split()))
    print(func(li, n))

if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np
n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    t = arr & 1
    c1 = np.count_nonzero((arr & 1))
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1

print(s % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

def func(x, nn):
    value = 0
    for i in range(nn - 1):
        for j in range(i + 1, nn):
            value += x[i] ^ x[j]
    ans = value % (10 ** 9 + 7)
    return ans

def main():
    n = int(input())
    li = list(map(int, input().split()))
    print(func(li, n))

if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np
n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    t = arr & 1
    c1 = np.count_nonzero((arr & 1))
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1

print(s % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

def func(x, nn):
    value = 0
    for i in range(nn - 1):
        for j in range(i + 1, nn):
            value += x[i] ^ x[j]
    ans = value % (10 ** 9 + 7)
    return ans

n = int(input())
li = list(map(int, input().split()))
print(func(li, n))


Fixed submission:
import numpy as np
n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    t = arr & 1
    c1 = np.count_nonzero((arr & 1))
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1

print(s % mod)

Buggy python submission (verdict: Time Limit Exceeded):
def func(x, nn):
    value = 0
    for id, i in zip(range(nn-1), x[:-1]):
        for j in x[id+1:]:
            value += i ^ j
    ans = value % (10 ** 9 + 7)
    return ans

n = int(input())
li = list(map(int, input().split()))
print(func(li, n))


Fixed submission:
import numpy as np
n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    t = arr & 1
    c1 = np.count_nonzero((arr & 1))
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1

print(s % mod)

Buggy python submission (verdict: Time Limit Exceeded):
def func(x, nn):
    value = 0
    for i in range(nn - 1):
        for j in range(i + 1, nn):
            value += x[i] ^ x[j]
    ans = value % (10 ** 9 + 7)
    return ans

n = int(input())
li = list(map(int, input().split()))
print(func(li, n))


Fixed submission:
import numpy as np
n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    t = arr & 1
    c1 = np.count_nonzero((arr & 1))
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1

print(s % mod)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))
value = 0
for i in range(n - 1):
    for j in range(i+1, n):
        value += li[i] ^ li[j]
ans = value % (10 ** 9 + 7)
print(ans)

Fixed submission:
import numpy as np
n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    t = arr & 1
    c1 = np.count_nonzero((arr & 1))
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1

print(s % mod)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))
value = 0
for i in range(n - 1):
    for j in range(i+1, n):
        value += li[i] ^ li[j]
ans = value % (10 ** 9 + 7)
print(ans)

Fixed submission:
import numpy as np
n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    t = arr & 1
    c1 = np.count_nonzero((arr & 1))
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1

print(s % mod)