TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
3
3 1 2

N=int(input())
d=list(map(int,input().split()))
HP=0
for i in range(N):
    for j in range(i+1,N):
        HP+=d[i]*d[j]
print(HP)

Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N = int(input())
d = list(map(int, input().split()))
s = 0
for i in range(N):
  for j in range(N):
    if i != j:
      s += d[i]*d[j]
print(s)

N = int(input())
d = list(map(int, input().split()))
s = 0
for i in range(N):
  for j in range(N):
    if i != j:
      s += d[i]*d[j]
print(s//2)

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = int(input())
d = list(map(int, input().split()))

sum = 0

for i in range(n):
    for j in range(n):
        if i != j:
            sum += d[i] * d[J]

sum = sum // 2

print(sum)

n = int(input())
d = list(map(int, input().split()))

sum = 0

for i in range(n):
    for j in range(n):
        if i != j:
            sum += d[i] * d[j]

sum = sum // 2

print(sum)

Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
import copy

count = int(input())
balls = list(map(int, input().split()))
mutable_balls = copy.deepcopy(balls)

ans = 0
for i, ball in enumerate(balls):
  for j, ball2 in enumerate(balls):
    if i != j:
      ans += ball * ball2

print(ans / 2)

import copy

count = int(input())
balls = list(map(int, input().split()))
mutable_balls = copy.deepcopy(balls)

ans = 0
for i, ball in enumerate(balls):
  for j, ball2 in enumerate(balls):
    if i != j:
      ans += ball * ball2

print(int(ans / 2))

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = int(input())
ds = [int(x) for x in input().split()]
ret = 0
for i in range(n):
  for j in range(n-1):
    ret += ds[i] * ds[j + 1]
print(ret)

#import numpy as np
n = int(input())
#ds = np.array([int(x) for x in input().split()])
ds = [int(x) for x in input().split()]
ds2 = [x*x for x in ds]
#dss = ds * sum(ds)
#print((sum(ds * sum(ds)) - sum(ds ** 2)) / 2 )
print((sum(ds * sum(ds)) - sum(ds2)) / 2 )

n = int(input())
ds = map(int, input.split())
ret = 0
for i in range(n):
  for j in range(n-1):
    ret += ds[i] * ds[j + 1]
print(ret)

n = int(input())
ds = [int(x) for x in input().split()]
ds2 = [x*x for x in ds]
s = 0
s2 = 0
for i in range(n):
  s += ds[i]
  s2 += ds2[i]
ss = 0
for i in range(n):
  ss += ds[i] * s

print((ss - s2) // 2)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N = input().split()
ns = input().split()

sum_ = 0
for i in range(N):
  	for j in range(N):
  		sum_ += ns[i]*ns[j]
print(sum_)

N = int(input())
ns = input().split()

sum_ = 0

for i in range(N):
    for j in range(N):
        if(i>j):
            sum_ += int(ns[i])*int(ns[j])
        
print(sum_)


Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n=int(input())
d=map(int,input().split(" "))
wa=[]
for i in range(1,n+1):
  for j in range(i,n+1):
    wa.append(i*j)
print(sum(wa))

n=int(input())
d=map(int,input().split(" "))
wa=[]
for i in range(1,n+1):
  for j in range(i,n+1):
    wa.append(i*j)
print(sum(wa))


n=int(input())
d=list(map(int,input().split(" ")))
wa=[]
for i in range(0,n):
  for j in range(i,n):
    wa.append(d[i]*d[j])
print(sum(wa))

n=int(input())
d=map(int,input().split(" "))
wa=[]
for i in range(1,n+1):
  for j in range(i,n+1):
    wa.append(d[i]*d[j])
print(sum(wa))

    n=int(input())
    d=map(int,input().split(" "))
    wa=[]
    for i in range(0,n):
      for j in range(i,n):
        wa.append(d[i]*d[j])
    print(sum(wa))

n=int(input())
d=list(map(int,input().split(" ")))
wa=[]
for i in range(0,n):
  for j in range(i,n):
    if j==n-1:
      break
    wa.append(d[i]*d[j])

print(sum(wa))

n=int(input())
d=list(map(int,input().split(" ")))
wa=[]
for i in range(0,n):
  for j in range(i+1,n):
    wa.append(d[i]*d[j])

print(sum(wa))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N=int(input())
d=list(map(int,input().split()))
S=sum(d)
S_2=S**2
d_2 = [i**2 for i in d]
S_3=sum(d_2)
print((S_2-S_3)/2)


N=int(input())
d=list(map(int,input().split()))
S=sum(d)
S_2=S**2
d_2 = [i**2 for i in d]
S_3=sum(d_2)
print(int((S_2-S_3)/2))


Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = int(input())
x = [int(i) for i in input().split()]
ans = 0
for i in range(n-1):
  for j in range(i,n): ans+=x[i]*x[j]
print(ans)

n = int(input())
x = [int(i) for i in input().split()]
ans = 0
for i in range(n-1):
  for j in range(i+1,n): ans+=x[i]*x[j]
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = int(input())
ls = map(int, input().split())

from itertools import combinations

combi = list(combinations(ls, 2))

s = 0
for a, b in combi:
    s += (a * b)

print(s

n = int(input())
ls = map(int, input().split())

from itertools import combinations

combi = list(combinations(ls, 2))

s = 0
for a, b in combi:
    s += (a * b)

print(s)

Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N = int(input())
D = map(int, input().split())

ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        ans += D[i] * D[j]

print(ans)

N = int(input())
D = list(map(int, input().split()))

ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        ans += D[i] * D[j]

print(ans)

Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N=int(input())
d = list(map(int, input().split())) 
a=0
for i in range(0,len(d)):
  t=0
  for j in range(0,len(d)):
    t+=d[i]*d[j]
  a+=t
print(a)

N=int(input())
d=[input() for i in range(N)]
s=0
for i in range(0,len(d)):
  t=0
  for j in range(0,len(d)):
    t+=d[i]*d[j]
  s+=t
print(s)

N=int(input().rstrip())
d = list(map(int, input().split())) 
a=0
t=0
for i in range(N-1):
  t+=1
  for j in range(t,N):
    a+=d[i]*d[j]
print(a)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N=input()
List=list(map(int,input().split()))
i =0 
j =0
for i in range(N):
    for j in range(N):
        t = List[i]*List[j]
print(t)

N= int(input())
d = list(map(int,input().split()))

r = 0
for i in range(N-1):
    for j in range(i+1,N):
        r +=d[i]*d[j]
print(r)


Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n=int(input())
d=[int(input()) for i in range(n)]

sum=0
for i in range(n):
    for l in range(1<=n):
        sum+=d[i]*d[l]
print(sum)


    

n=int(input())
d=[int(input()) for i in range(n)]

sum=0
for i in range(n-1):
    for l in range(i+1,n):
        sum+=d[i]*d[l]
print(sum)


    


n=int(input())
d=[int(input()) for i in range(n)]

sum=0
for i in range(n-1):
    for l in range(i+1,n):
        sum+=d[i]*d[l]
print(sum)


    

n=int(input())
d=li(map(int,input().split())
 
sum=0
for i in range(n-1):
    for l in range(i+1,n):
        sum+=d[i]*d[l]
print(sum)

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

count=0
for i in range(n-1):
    for j in range(i+1,n):
        count+=(d[i]*d[j])
        print(d[i],d[j])
print(count)

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

count=0
for i in range(n-1):
    for j in range(i+1,n):
        count+=(d[i]*d[j])
print(count)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = int(input())
d = [int(i) for input().split()]
s = []
for i in range(n):
	for j in range(i):
		s.append(d[i]*d[j])
l = s.size()
for i in range(l):
	print(s[i])


n = int(input())
d = [int(i) for i in input().split()]
s = []
for i in range(n):
	for j in range(i):
		s.append(d[i]*d[j])
print(sum(s))


Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n=int(input())
d=list(map(int,input().split()))

ans=0
for i in range(n):
    for k in range(n):
        if i != k:
            ans += d[i] * d[k]

print(ans/2)

n=int(input())
d=list(map(int,input().split()))

ans=0
for i in range(n):
    for k in range(n):
        if i != k:
            ans += d[i] * d[k]

print(ans//2)

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
import sys

a = list(map(int,input().split()))
b = len(a)

wa = 0
for i in range(b-1):
    for j in range(i+1,b):
        wa += a[i]*a[j]


print(wa)


import sys

N = int(input())
a = list(map(int,input().split()))
b = len(a)

wa = 0
for i in range(b-1):
    for j in range(i+1,b):
        wa += a[i]*a[j]


print(wa)


Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
import itertools
N = int(input())
b = list(map(int, input().split()))
c = list(itertools.combinations(b,2))
a = 0
for i,j in c:
    a += i*j
print(i,j)

import itertools
N = int(input())
b = list(map(int, input().split()))
c = list(itertools.combinations(b,2))
a = 0
for i,j in c:
    a += i*j
print(a)

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N = int(input())
dlist = list(map(int, input().split()))

all = 0
for i1, d1 in enumrate(dlist):
  for i2, d2 in enumrate(dlist):
    if i1 != i2:
      all += d1*d2

print(all)

N = int(input())
dlist = list(map(int, input().split()))

all = 0
for i1, d1 in enumerate(dlist):
  for d2 in dlist[i1:]:
    all += d1*d2

print(all)


N = int(input())
dlist = list(map(int, input().split()))

all = 0
for i1, d1 in enumerate(dlist):
  for i2, d2 in enumerate(dlist):
    if i1 != i2:
      all += d1*d2

print(all)


N = int(input())
dlist = list(map(int, input().split()))

all = 0
for i1, d1 in enumerate(dlist):
  for d2 in dlist[i1+1:]:
    all += d1*d2

print(all)


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n=int(input())
d=list(map(int,input().split()))
s=sum(d)
print(sum([x*(d-x) for x in d])//2)

n=int(input())
d=list(map(int,input().split()))
s=sum(d)
print(sum([x*(s-x) for x in d])//2)

Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n=int(input())
list=list(map(int,input().split()))
print(n,list)
s=0
for i in range(0,n-1):
  for j in range(1,n-i):
        s+=list[i]*list[i+j]
print(s)

n=int(input())
list=list(map(int,input().split()))

s=0
for i in range(0,n-1):
  for j in range(1,n-i):
        s+=list[i]*list[i+j]
print(s)

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
import copy
x = input()
y = list(map(int,input().split()))

result = 0
for i, j in enumerate(y):
    if i == (len(y) - 1):
        break
    array = copy.deepcopy(y)
    b = array.pop(i)
    a_sum = sum(array)
    result = result + b * len(y) + a_sum

print(result)


import copy
x = int(input())
y = list(map(int,input().split()))

result = 0
for (i, v) in enumerate(y):
  z = copy.deepcopy(y)
  c = copy.deepcopy(x) - 1 - i
  r = 0
  for j in range(c):
    r = r + z.pop()
  result = result + r * v

print(result)



Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N = int(input())
X = list(map(int, input().spit()))
for i in range(N):
  for j in range(i+1, N):
    ans += X[i] * X[j]
    
print(ans)

N = int(input())
X = list(map(int, input().split()))
for i in range(N):
  for j in range(i+1, N):
    ans += X[i] * X[j]
    
print(ans)


N = int(input())
X = list(map(int, input().split()))
ans = 0
for i in range(N):
  for j in range(i+1, N):
    ans += X[i] * X[j]
    
print(ans)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n=int(input())
List = [int(i) for i in input().split()]
ans=0
for i in range(n):
  for j in range(i):
    a+=List[i]*List[j]
print(ans)

n=int(input())
List = [int(i) for i in input().split()]
a=0
for i in range(n):
  for j in range(i):
    a+=List[i]*List[j]
print(a)


Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):

n = int(input())
l = list(map(int,input().split()))
print(n,l)
ans = 0
for i in range(n-1):
 for j in range(n-1-i):
  ans += l[i]*l[i+1+j]
print(ans)






n = int(input())
l = list(map(int,input().split()))

ans = 0
for i in range(n-1):
 for j in range(n-1-i):
  ans += l[i]*l[i+1+j]
print(ans)





Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n=int(input())
d=[int(i) for i in input().split()]
dsum=0
for i in range(n):
  for j in range(n):
    dsum+=d[i]*d[j]
  dsum-=d[i]*d[i]
print(dsum)
    


n=int(input())
d=[int(i) for i in input().split()]
dsum=0
for i in range(n):
  for j in range(n):
    dsum+=i*j
  dsum-=i*i
print(dsum)
    

n=int(input())
d=[int(i) for i in input().split()]
dsum=0
for i in range(n):
  for j in range(n):
    dsum+=d[i]*d[j]
  dsum-=d[i]*d[i]
print(dsum//2)
    


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = int(input())
D = [int(d) for d in input().split()]
DD = []
S = [0] * n
for u in range(n):
	S[u] = D[u] ** 2
for s in range(n):
	for t in range(n):
		DD.append(D[s] * D[t])
for v in range(n):
	DD.remove(S[v])
print(sum(DD) / 2)


n = int(input())
D = [int(d) for d in input().split()]
DD = []
S = [0] * n
for u in range(n):
	S[u] = D[u] ** 2
for s in range(n):
	for t in range(n):
		DD.append(D[s] * D[t])
for v in range(n):
	DD.remove(S[v])
print(int(sum(DD) / 2))


Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
import sys
n = int(sys.stdin.radline())
li = list(map(int, sys.stdin.readline().split()))
s = 0
i = 0
while i < n-1:
  s += li[i] * li[i+1]
  i += 1
print(s)

import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
s = 0
i = 0
while i < n-1:
  k = i+1
  while k < n:
    s += li[i] * li[k]
    k += 1
  i += 1
print(s)


Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = int(input())
lst = map(int,input().split())
ans = 0
for i in range(n):
    for j in range(1,n):
        ans = ans + lst[i]*lst[j]

print(ans)

n = int(input())
lst = map(int,input().split())
ans = 0
for i in range(n):
    for j in range(1,n):
        ans += lst[i]*lst[j]

print(ans)     

n = int(input())
lst = map(int,input().split())
ans = 0
for i in range(n):
    for j in range(1,n):
        ans += ans + lst[i]*lst[j]

print(ans)

n = int(input())
lst = list(map(int,input().split()))
ans = 0
for i in range(n):
    for j in range(i+1,n):
        ans = ans + lst[i]*lst[j]

print(ans)     

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N = int(input())
d = list(map(int, input().split()))
cnt = 0

for i in range(N-1)
	for j in range(i+1, N)
  		cnt += d[i] * d[j]

print(cnt)

N = int(input())
d = list(map(int, input().split()))
cnt = 0
 
for i in range(N-1):
	for j in range(i+1, N):
  		cnt += d[i] * d[j]
 
print(cnt)

Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
input()
d=[int(i) for i in input().split()]
i=0
while True:
  a=d[0]
  del d[0]
  for i in d:
    sum += a*i
print(sum)

input()
d=[int(i) for i in input().split()]
i=0
while True:
  a=d[0]
  del d[0]
  if d == []:
    break
  for i in d:
    sum += a*i
print(sum)

n=input()
d=[int(i) for i in input().split()]
while True:
  a=d[0]
  del d[0]
  if d == []:
    break
  for i in d:
    sum += a*i
print(sum)

n=input()
d=[int(i) for i in input().split()]
sum=0
while True:
  a=d[0]
  del d[0]
  if d == []:
    break
  for i in d:
    sum += a*i
print(sum)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = int(input())
arr = [int(x) for x in input().split()]
f = sum(arr)
s = 0
for i in arr:
  s += i * (f-i)

print(s)

n = int(input())
arr = [int(x) for x in input().split()]
f = sum(arr)
s = 0
for i in arr:
  s += i * (f-i)

print(s // 2)


Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n=int(input())
d=map(int,input().split())
d=list(d)
kotae=0
for i in range(n):
  for j in range(n-i-1):
    kotae=kotae+d[i]*d[i+j]
print(kotae)


n=int(input())
d=map(int,input().split())
d=list(d)
kotae=0
for i in range(n):
  for j in range(i+1,n-i-1):
    kotae=kotae+d[i]*d[j]
print(kotae)

n=int(input())
d=map(int,input().split())
d=list(d)
kotae=0
for i in range(n):
  for j in range(i+1,n):
    kotae=kotae+d[i]*d[i+j]
print(kotae)


n=int(input())
d=map(int,input().split())
kotae=0
for i in range(n):
  for j in range(n-i-1):
    kotae=kotae+d[i]*d[j]
print(kotae)

n=int(input())
d=map(int,input().split())
kotae=0
for i in range(n):
  for j in range(n-i-1):
    kotae=kotae+i*j
print(kotae)

n=int(input())
d=map(int,input().split())
d=list(d)
kotae=0
for i in range(n):
  for j in range(n-i-1):
    kotae=kotae+d[i]*d[j]
print(kotae)

n=int(input())
d=list(map(int,input().split()))

kotae=0
for i in range(n):
  for j in range(i+1,n):
    kotae=kotae+d[i]*d[j]
print(kotae)


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = int(input())
arrd = list(map(int,input().split()))
import itertools 
num = 0
for i in itertools.permutations(arrd,2):
    num += i[0] * i[1]
print(num/2)

n = int(input())
arrd = list(map(int,input().split()))
import itertools 
num = 0
for i in itertools.combinations(arrd,2):
    num += i[0] * i[1]
print(num)

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = int(input())
d = list(map(int, input().split()))
print(sum([d[i]*d[j] for i in range(n) for j in range(i-1)]))

n = int(input())
d = list(map(int, input().split()))
print(sum([d[i]*d[j] for i in range(n) for j in range(i)]))

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N = int(input())

D = list(map(int, input().split()))

S = 0

for i in range(N-1):
    for j in range(i+1, N):
        S += i*j
        

N = int(input())

D = list(map(int, input().split()))

S = 0

for i in range(N - 1):
    for j in range(i + 1, N):
        S += D[i] * D[j]

print(S)


Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N = int(input())
L = list(map(int,input().split()))

s = sum(L)
p = 0
for a in L:
 p += a*a

ans=(s*s-p)/2

print(ans)

N = int(input())
L = list(map(int,input().split()))

s = sum(L)
p = 0
for a in L:
 p += a*a

ans=(s*s-p)/2

print(int(ans))

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
N = int(input())
d = [int(x) for x in input().split()]
t = 0
for i in itertools.permutations(d, N):
    t += i[0]*i[1]
print(total)

N = int(input())
d = [int(x) for x in input().split()]
total = 0
for i in itertools.permutations(d, N):
    total = i[0]*i[1]
print(total)

N = int(input())
d = [int(x) for x in input().split()]
t = 0
for i in range(N-1):
    for j in range(i+1, N):
      t += d[i]*d[j]
print(t)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
a = int(input())
d = list(map(int,input().split()))
ans = 0

for i in range(a):
	for j in range(i+1,a):
		print(i,"*",j)
		ans += d[i]*d[j]

print("ans =",ans)

a = int(input())
d = list(map(int,input().split()))
ans = 0

for i in range(a):
	for j in range(i+1,a):
		ans += d[i]*d[j]

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
import itertools
n = int(input())
d = list(map(int,input().split()))
x = 0
for di in itertools.combinations(d, 2):
  x+=sum(di)
print(x)

import itertools
n = int(input())
d = list(map(int,input().split()))
x = 0
for di in itertools.combinations(d, 2):
  x+=di[0]*di[1]
print(x)

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(len(d)):
    for j in range(i,len(d)):
        ans += d[i]*d[j]
print(ans)

n = int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(len(d)):
    for j in range(i+1,len(d)):
        ans += d[i]*d[j]
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
3
3 1 2

# coding: utf-8
# Your code here!


import sys

readline = sys.stdin.readline 

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

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

print(ans)

Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n=int(input())
s=list(map(int,input().split()))
sum=0
for i in range(n):
  for j in range(n-1):
    sum+=s[i]*s[j]
    
print(sum)
    

n=int(input())
s=list(map(int,input().split()))
sum=0
for i in range(n):
  for j in range(i+1,n):
    sum+=s[i]*s[j]
    
print(sum)
    

Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = input();n = int(n)
a = input().split()
b = 0
for i in range(n-1):
  for j in range(1,n):
    b += eval(a[i]+'*'+a[j])
print(b)


n = input();n = int(n)
a = input().split()
b = 0
for i in range(n-1):
  for j in range(i+1,n):
    b += eval(a[i]+'*'+a[j])
print(b)


Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
a = input()
b = input()
bs = [int(i) for i in b.split()]
print(sum(i*j for i in bs for j in bs)-2*sum(i*i for i in bs))


a = input()
b = input()
bs = [int(i) for i in b.split()]
print((int)((sum(i*j for i in bs for j in bs)-sum(i*i for i in bs))/2))


Verdicts: Wrong Answer

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n=int(input())
l=list(map(int,input().split()))
c=itertools.combinations(l,2)
ans=sum(x*y for x,y in c)
print(ans)

import itertools
n=int(input())
l=list(map(int,input().split()))
c=itertools.combinations(l,2)
ans=sum(x*y for x,y in c)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: It's now the season of TAKOYAKI FESTIVAL!  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The _deliciousness_ of the i-th takoyaki is d_i.  As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \times y health points.  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki served in the festival. For each of these choices, find the health points restored from eating the two takoyaki, then compute the sum of these \frac{N \times (N - 1)}{2} values.

Submission attempts (in order):
n = input()
d = list(map(int, input().split()))
sum = 0
for i in range(n-1):
  for j in range(i+1, n):
    sum += d[i] * d[j]
print(sum)


n = input()
d = map(int, input().split())
sum = 0
for i in range(n-1):
  for j in range(i+1, n):
    sum += d[i] * d[j]
print(sum)


n = input()
d = map(int, input().split())
sum = 0
for i in range(n-1):
  for j in range(i+1, n):
    sum += ij
print(sum)

n = int(input())
d = list(map(int, input().split()))

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted