Buggy python submission (verdict: Runtime Error):
from C import ans


n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
n_list = [int(i) for i in input().split()]
mod = 10 ** 9 + 7
num_list = [n % mod for n in n_list]
a_list = []
ans = 0

while len(num_list) > 1:
    x = num_list[0]
    num_list.remove(x)
    a_list.append((x * (sum(num_list) % mod)) % mod)

ans_list = [n % mod for n in a_list]
for i in range(len(ans_list)):
    ans += ans_list[i]
    ans = ans % mod
ans = sum(ans_list) % mod

print (ans)

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
n_list = [int(i) for i in input().split()]
mod = 10 ** 9 + 7
num_list = [n % mod for n in n_list]
a_list = []
ans = 0

for i in range(n-1):
    for j in range(i+1,n):
        a_list.append((num_list[i] * num_list[j]) % mod)

ans_list = [n % mod for n in a_list]

for i in range(len(ans_list)):
    ans += ans_list[i]
    ans = ans%mod

print (ans)

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
n_list = [int(i) for i in input().split()]
mod = 10 ** 9 + 7
num_list = [n % mod for n in n_list]
a_list = []

for i in range(n-1):
    for j in range(i+1,n):
        a_list.append((num_list[i] * num_list[j]) % mod)
ans_list = [n % mod for n in a_list]
ans = sum(a_list) % mod

print (ans)

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
n_list = [int(i) for i in input().split()]
mod = 10 ** 9 + 7
num_list = [n % mod for n in n_list]
a_list = []

for i in range(n-1):
    for j in range(i+1,n):
        a_list.append((num_list[i] * num_list[j]) % mod)

ans = sum(a_list) % mod

print (ans)

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
n_list = [int(i) for i in input().split()]
ans = 0
mod = 10 ** 9 + 7
num_list = [n % mod for n in n_list]
a_list = []

while len(num_list) > 1:
    x = num_list[0]
    num_list.remove(x)
    a_list.append((x * (sum(num_list) % mod)) % mod)

ans = sum(a_list) % mod

print (ans)

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
n_list = [int(i) for i in input().split()]
ans = 0
mod = 10 ** 9 + 7
num_list = [n % mod for n in n_list]

while len(num_list) > 1:
    x = num_list[0]
    num_list.remove(x)
    ans += (x * (sum(num_list) % mod)) % mod
    ans = ans % mod

# for i in range(n-1):
#     for j in range(i+1,n):
#         ans += (num_list[i] * num_list[j]) % mod
#         ans = ans % mod

print (ans)

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
n_list = [int(i) for i in input().split()]
ans = 0
mod = 10 ** 9 + 7
num_list = [n % mod for n in n_list]

# while len(num_list) > 1:
#     x = num_list[0]
#     num_list.remove(x)
#     ans += (x * (sum(num_list) % mod)) % mod

for i in range(n-1):
    for j in range(i+1,n):
        ans += (num_list[i] * num_list[j]) % mod
        ans = ans % mod

print (ans)

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num_list = [int(i) for i in input().split()]
ans = 0
mod = 10 ** 9 + 7

while len(num_list) > 1:
    x = num_list[0] % mod
    num_list.remove(x)
    ans += (x * (sum(num_list) % mod)) % mod

print (ans % mod)

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num_list = [int(i) for i in input().split()]
ans = 0
mod = 10 ** 9 + 7

while len(num_list) > 1:
    x = num_list[0]
    num_list.remove(x)
    ans += (x * sum(num_list)) % mod

print (ans % mod)

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num_list = [int(i) for i in input().split()]
ans = 0

for i in range(n-1):
    for j in range(i+1,n):
        ans += num_list[i] * num_list[j]
        ans = ans % (10 ** 9 + 7)

print (ans % (10 ** 9 + 7))

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num_list = [int(i) for i in input().split()]
ans = 0

for i in range(n-1):
    for j in range(i+1,n):
        ans += num_list[i] * num_list[j]
        ans = ans % (10 ** 9 + 7)

print (ans % (10 ** 9 + 7))

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num_list = [int(i) for i in input().split()]
ans = 0

for i in range(n-1):
    for j in range(i+1,n):
        ans += num_list[i] * num_list[j]

print (ans % (10 ** 9 + 7))

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))