Buggy python submission (verdict: Runtime Error):
import numpy as np
mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))
A = np.array(A, dtype = np.int64)
tmp = 0
for i in range(61):
    tmp_1 = np.count_nonzero
    tmp += ((tmp_1)*(N - tmp_1)*(2**i)) % mod
    A = A >> 1
print(tmp % mod)

Fixed submission:
import numpy as np
mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))
A = np.array(A, dtype = np.int64)
tmp = 0
for i in range(61):
    tmp_1 = np.count_nonzero(A & 1)
    tmp += ((tmp_1)*(N - tmp_1)*(2**i)) % mod
    A = A >> 1
print(tmp % mod)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))
A = np.array(A, dtype = np.int64)
tmp = 0
for i in range(61):
    tmp_0 = 0
    for j in range(N):
        if ((A[j] >> i) & 1) == 0:
            tmp_0 += 1
    tmp += ((tmp_0)*(N - tmp_0)*(2**i)) % mod
print(tmp % mod)

Fixed submission:
import numpy as np
mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))
A = np.array(A, dtype = np.int64)
tmp = 0
for i in range(61):
    tmp_1 = np.count_nonzero(A & 1)
    tmp += ((tmp_1)*(N - tmp_1)*(2**i)) % mod
    A = A >> 1
print(tmp % mod)

Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))
tmp = 0
for i in range(61):
    tmp_0 = 0
    for j in range(N):
        if ((A[j] >> i) & 1) == 0:
            tmp_0 += 1
    tmp += ((tmp_0)*(N - tmp_0)*(2**i)) % mod
print(tmp % mod)

Fixed submission:
import numpy as np
mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))
A = np.array(A, dtype = np.int64)
tmp = 0
for i in range(61):
    tmp_1 = np.count_nonzero(A & 1)
    tmp += ((tmp_1)*(N - tmp_1)*(2**i)) % mod
    A = A >> 1
print(tmp % mod)

Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9 + 7

def pow_k(x, n):
    """
    O(log n)
    """
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K = (K * x) % mod 
            x = (x ** 2) % mod
            n = (n - 1) // 2
        else:
            x = (x ** 2) % mod
            n = n // 2

    return (K * x) % mod # 指数を割り続け n が 1 に至ったら終了

N = int(input())
A = list(map(int,input().split()))
cnt_1 = [0]*61
for i in range(N):
    A_tmp = A[i]
    for j in range(61):
        if (A_tmp >> j & 1):
            cnt_1[j] += 1
ans = 0
for i in range(61):
    ans += (cnt_1[i]*(N - cnt_1[i]) * pow_k(2,i)) % mod
print(ans % mod)

Fixed submission:
import numpy as np
mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))
A = np.array(A, dtype = np.int64)
tmp = 0
for i in range(61):
    tmp_1 = np.count_nonzero(A & 1)
    tmp += ((tmp_1)*(N - tmp_1)*(2**i)) % mod
    A = A >> 1
print(tmp % mod)

Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9 + 7
N = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(61):
    cnt_0 = 0
    cnt_1 = 0
    for j in range(N):
        if (A[j] >> i & 1):
            cnt_1 += 1
        else:
            cnt_0 += 1
    ans += (cnt_1 * cnt_0 * (2**i)) % mod
print(ans % mod)

Fixed submission:
import numpy as np
mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))
A = np.array(A, dtype = np.int64)
tmp = 0
for i in range(61):
    tmp_1 = np.count_nonzero(A & 1)
    tmp += ((tmp_1)*(N - tmp_1)*(2**i)) % mod
    A = A >> 1
print(tmp % mod)