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):
N = int(input())
d = list(map(int(input().sprit())))
sum = 0
for i in range(N):
  for j in range(i+1,N):
    sum += d[i] * d[j]
    
print(sum)

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

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

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())
tako=list(map(int,input().split()))
umami=0
for i in range(n):
  for j in range(i+1,n):
    umami+==tako[i]*tako[j]
print(umami)

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

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

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 = input().split(' ')
sq_list = []
for i in list:
  sq_list.append(i ** 2)
print((sum(list) ** 2 - sum(sq_list))//2)

N = int(input())
no_list = list(map(int, input().split()))
sq_list = []
for i in no_list:
  sq_list.append(i ** 2)
print((sum(no_list) ** 2 - sum(sq_list))//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())
L = list(map(int, input().split()))

res = 0
for i in range(N):
  for j in range(N):
    if i != j:
    	res += L[i] * L[j]
        
print(res)

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

res = 0
for i in range(N):
  for j in range(i, N):
    if i != j:
    	res += L[i] * L[j]
        
print(res)

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()]
ans = 0
for i in range(N):
    for j in range(i+1,N):
        ans += d[i]*d[j]
print(ans

N = int(input())
d = [int(i) for i in input().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())
d = list(map,input().split())
sum = 0
 
for i in range(n):
  for j in range(i+1,n):
    sum += (d[i]*d[j])
print(sum)

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

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

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

for i in range(n):
  for j in range(n):
    ans += d[i]*d[j]-d[i]**2
    print(ans/2)

s = int(input())
d = list(map,input().split())
sum = 0

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

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):
a = int(input())
b = [int(i) for i in input().split()]
ans = 0
for i in range(a):
  ans += b[i]*(sum(b)-b[i])
print(ans)

a = int(input())
b = [int(i) for i in input().split()]
print(sum(b)*(len(b)-1))

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

a = int(input())
b = [int(i) for i in input().split()]
ans = 0
for i in range(a):
  ans += b[i]*(sum(b)-b[i])
print(ans//2)

Verdicts: Wrong Answer

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())
l = list(map,int().split())
s = 0
for i in range(n):
  j = i + 1
  while j <= n - 1:
    s += l[i] * l[j]
  	j += 1
print(s)

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

n = int(input())
l = list(map(int, input().split()))
import numpy as np
ll = np.empty(int(n * (n - 1) / 2))

for i in range(N):
  for j in range(i + 1, N):
    ll[k] = l[i] * l[j]
    k += 1
print(np.sum(ll))

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


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())
listed = list(map(int,input().split()))
sum_ = 0
for x in listed:
    for y in listed:
        sum_ += x*y
        sum_ -= x*x
print(sum_ / 2)

N = int(input())
listed = list(map(int,input().split()))
sum_ = 0
for x in listed:
    sum_ -= x*x
    for y in listed:
        sum_ += x*y
print(sum_ // 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())
s=list(map(int,input().split()))
sum=0
for i in range(n):
  for j in range(n):
    sum=sum+s[i]*s[j]
print(sum)

n=int(input())
s=list(map(int,input().split()))
sum=0
for i in range(n-1):
  for j in range(i+1,n):
    sum=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 = int(input())
list_d = list(map(int, input().split()))
print(n)
print(list_d)

total = 0

for first in range(len(list_d)):
  for second in range(len(list_d)):
    if first < second:
      total += list_d[first] * list_d[second]

print(total)

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

total = 0

for first in range(len(list_d)):
  for second in range(len(list_d)):
    if first < second:
      total += list_d[first] * list_d[second]

print(total)

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()]
s = n * (n-1)//2

ans = 0
for i in range(n):
  for j in range(s):
      if j < n:
        ans += d[i] * d[j]

print(ans)

n = int(input())
d = [int(i) for i in input().split()]
s = n * (n-1)//2

ans = 0
for i in range(n):
  for j in range(s):
      if j < i:
        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):
N = int(input())
d = list(map(int, input().split()))
import itertools
lis = list(itertools.combinations(d,2))
for i in range(len(lis)):
    lis[i] = sum(lis[i])
print(sum(lis))

N = int(input())
d = list(map(int, input().split()))
import itertools
import numpy as np
lis = list(itertools.combinations(d,2))
for i in range(len(lis)):
    lis[i] = np.prod(lis[i])
print(sum(lis))

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=[]
for i in range(n-1):
    for j in range(i+1,n):
        s.append(i*j)
print(sum(s))
        

n=int(input())
d=list(map(int,input().split()))
s=[]
for i in range(n-1):
    for j in range(i+1,n):
        s.append(d[i]*d[j])
print(sum(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())
A=list(map(int,input().split()))
ans=0
for i in range(N):
  for j in range(i,N):
    ans+=A[i]*A[j]
print(ans)

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

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

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())
h = list(map(int, input().split()))
print(h)
def takoyaki(n,h):
    x = 0
    for i in range(0,n-1):
        for j in range(i + 1, n):
            x = x + h[i]*h[j]
    return x
print(takoyaki(n, h)) 

n = int(input())
h = list(map(int, input().split()))
def takoyaki(n,h):
    x = 0
    for i in range(0,n-1):
        for j in range(i + 1, n):
            x = x + h[i]*h[j]
    return x
print(takoyaki(n, h)) 

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()))

for x in range(N):
  for y in range(x+1,N):
    ans += D[x] * D[y]

print(ans)



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

ans = 0
for x in range(N):
  for y in range(x+1,N):
    ans += D[x] * D[y]

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=int(0)
i=int(0)
while i<n:
	a=a+d[i]
	i=i+1
a=a*a
i=int(0)
while i<n:
	a=a-d[i]*d[i]
	i = i+1
a=a/2
print(a)

n=int(input())
d=list(map(int,input().split()))
a=int(0)
i=int(0)
while i<n:
	a=a+d[i]
	i=i+1
a=a*a
i=int(0)
while i<n:
	a=a-d[i]*d[i]
	i = i+1
a=a/2
a=int(a)
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())
tako = []
ans = 0
for i in N:
  tako.append(int(input()))
for j in range(len(tako)-1):
  ans += tako[j]*tako[j+1]
ans += tako[1] * tako[-1]
print(ans)
  

N = int(input())
ans = 0
tako = list(map(int, input().split()))
for j in range(len(tako)-1):
  for k in range(j+1, len(tako)):
      ans += tako[j] * tako[k]
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):
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
l=list(mi())
s=0
t=0
for i in l:
  s+=i
  t+=i**2
print(s**2-t)

import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
l=list(mi())
s=0
t=0
for i in l:
  s+=i
  t+=i**2
print((s**2-t)/2)

import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
l=list(mi())
s=0
t=0
for i in l:
  s+=i
  t+=i**2
print(int((s**2-t)/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() )
takoyaki_list = list( map( int, input().split() ) )
answer = 0
for i in takoyaki_list:
  for j in takoyaki_list:
    answer += int(i*j)
print( int( answer/2) )

N = int( input() )
tako_list = list( map( int, input().split() ) )
answer = 0
a = 0
for i in tako_list:
  a += 1
  for j in tako_list[a:]:
    answer += i*j

print(answer)

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())
li = list(map(int,input().split()))
count = 0

for i in range(n-1):
    for j in range(n-i-1):
        count += li[i]*li[i+j]

print(count)


n = int(input())
li = list(map(int,input().split()))
count = 0

for i in range(n-1):
    for j in range(n-i-1):
        count += li[i]*li[i+j+1]

print(count)


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):
gomi=input()
tako= [i for i in input().split()]
print((sum(tako)**2-sum([i**2 for i in tako]))/2)

gomi=input()
tako=[int(i) for i in input().split()]
print((sum(tako)**2-sum([i**2 for i in tako]))/2)  

gomi=input()
tako=[int(i) for i in input().split()]
print(int((sum(tako)**2-sum([i**2 for i in tako]))/2))

Verdicts: 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())
d1 = input().split()
sum= 0

for i in range(N-1):
    for j in range(i+1,N,1): 
            sum += int(d1[i])*int(d1[j])

N = int(input())
d1 = input().split()
sum= 0

for i in range(len(d1)):
    for j in range(i+1): 
            sum += int(d1[i])*int(d1[j])

print(sum)


N = int(input())
d1 = input().split()
sum= 0

for i in range(len(d1)):
    for j in range(len(d1)): 
        if(i != j and j > i):
            sum += int(d1[i])*int(d1[j])
        print('合計は%a' % sum)

print(sum)

for i in range(len(d1)):
    for j in range(len(d1)): 
        if(i != j and j > i):
            sum += int(d1[i])*int(d1[j])

print(sum)



N = int(input())
d1 = input().split()
sum= 0

for i in range(N):
    for j in range(i+1,N,1): 
            sum += int(d1[i])*int(d1[j])

N = int(input())
d1 = input().split()
sum= 0

for i in range(N):
    for j in range(i+1,N): 
            sum += int(d1[i])*int(d1[j])

print(sum)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

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()))
ans=0
for i in range(n):
    for j in range(i,n):
        ans+=d[i]*d[j]

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

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

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):
import itertools

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

import itertools

n=int(input())
d=list(map(int,input().split()))
ans=0
for v in itertools.combinations(d, 2):
    ans=ans+v[0]*v[1]
   
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 = map(int,input().split())
recovery_amount = 0 
for i in range(N):
  for j in range(N):
    if i == j:
      continue
    recovery_amount += d[i]*d[j]
print(recovery_amount)

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

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 itertools
n = int(input())
d = list(map(int, input().split()))

a = list(itertools.combinations(d,2))
v = 0
for c in a:
  v += c[0]*c[1]
  print(c)
print(v)

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

a = list(itertools.combinations(d,2))
v = 0
for c in a:
  v += c[0]*c[1]
  
print(v)

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()))

def sum_(N, D):
    total = 0
    for i in range(N):
        for j in range(i+1, N):
            total = total + (D[i] * D[j])
    return total

sum_(N, D)

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

def sum_(N, D):
    total = 0
    for i in range(N):
        for j in range(i+1, N):
            total = total + (D[i] * D[j])
    print(total)

sum_(N, D)

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(" ")))
count = []
for i in range(n):
  for j in range(n):
    if i!= j:
      cure = d[i]*d[j]
      count.append(cure)
print(len(count))


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


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


n = int(input())
d = list(map(int,input().split(" ")))
count = []
for i in range(n):
  for j in range(n):
    if i!= j:
      cure = d[i]*d[j]
      if count.count(cure) !=0:
        count.append(cure)
print(len(count))

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


Verdicts: Wrong Answer

Wrong Answer

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):
import itertools

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

list_ = itertools.combinations(range(n),2))
count = 0;

for i in range(len(list_)):
  count += D[list_[i][0]] + D[list_[i][1]];
  
print(count)


import itertools

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

list_ = list(itertools.combinations(range(n),2))
count = 0;

for i in range(len(list_)):
  count += D[list_[i][0]] * D[list_[i][1]];
  
print(count)


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):
X=int(input())
Y=[int(i) for i in input().split()]

print(Y)

X=int(input())
Y=[int(i) for i in input().split()]

result=0
for i in range(1, X):
  for j in range(X):
    if i+j<=X-1:
      result+=Y[j]*Y[j+i]
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(sys.stdin.readline())
d = list(map(int, input().split()))

recover = []

c = 0
for i in d:
    c += 1
    recover.append(i * sum(d[c:N]))

print(sum(recover))


import sys
N = int(sys.stdin.readline())
d = list(map(int, input().split()))

recover = []

c = 0
for i in d:
    c += 1
    recover.append(i * sum(d[c:N]))

print(sum(recover))

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 = []
for i in range(N):
  for j in range(1,N):
    A.append(N[i]*(j-i)
print(sum(A))

N = int(input())
D = list(map(int,input().split()))
A = []
for i in range(N-1):
  for j in range(i+1,N):
    A.append(D[i]*D[j])
print(sum(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,=map(int,input().split())
ans=0
for i in range(n-1):
  for j in range(i+1,n):
    ans+=l[i]+l[j]
print(ans)


n=int(input())
*l,=map(int,input().split())
ans=0
for i in range(n-1):
  for j in range(i+1,n):
    ans+=l[i]*l[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=list(map(int,input().split()))
s=0
for i in range(len(d)-1):
    for j in range(i,len(d)):
        s+=d[i]*d[j]
print(s)
    


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)
print(s)


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

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())
a=list(map(int,input().split()))
ans=0
for i in range(n):
    for j in range(n):
        if i!=j:
            ans+=a[i]*a[j]
print(ans)

n=int(input())
d=list(map(int,input().split()))
tot=sum(d)**2
for i in range(n):
  tot-=d[i]**2
print(tot//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())
lis = list(map(int,input().split()))
print(sum(lis)*2)

N = int(input())
lis = list(map(int,input().split()))
ans = 0
for i in range(1,N):
    for j in range(i+1,N+1):
        ans += lis[i-1]*lis[j-1]
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
import numpy as np

N = int(input())
lst = np.array(list(map(int,input().split())))

lst2 = np.array(list(itertools.combinations(lst,2)))
lst3 =[]
for i in range(len(lst2):
               dot = np.dot(lst2[i][0],lst2[i][1])
               lst3.append(dot)

print(sum(lst3))

import itertools
import numpy as np

N = int(input())
lst = np.array(list(map(int,input().split())))
lst2 = np.array(list(itertools.combinations(lst,2)))
lst3 =[]

for i in range(len(lst2)):
               dot = np.dot(lst2[i][0],lst2[i][1])
               lst3.append(dot)

print(sum(lst3))

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-1):
    for j in range(i+1,N):
        ans+=d[i]*d[j]
print(result)

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=(sum(d))**2

def square(list):
    return [i ** 2 for i in list]

b=sum(square(d))
result=a-b
print(result)

N=int(input())
d=list(map(int, input().split()))
a=(sum(d))**2

def square(list):
    return [i ** 2 for i in list]

b=sum(square(d))
result=(a-b)/2
print(result)

N=int(input())
d=list(map(int, input().split()))
a=(sum(d))**2

def square(list):
    return [i ** 2 for i in list]

b=sum(square(d))
result=(a-b)/2
print(int(result))

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=list(map(int,input().split()))
s=0
for i in range(n-1):
  for j in range(i+1,n):
    s+=i*j
print(s)

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())
d = list(map(int,input().split()))
sum = 0
for i in range(N):
  for j in range(N):
    if i != j:
      sum+= i*j
    else:
      continue
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+= i*j
    else:
      continue
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]
    else:
      continue
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]
    else:
      continue
print(sum)

Verdicts: Wrong Answer

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):
# -*- coding: utf-8 -*-
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]
print(sum/2)

# -*- coding: utf-8 -*-
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]
print(int(sum/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()))
energy = 0
for x in range(N):
    for y in range(x + 1, N):
        energy = energy + x * y
print(energy)

N = int(input())
d = list(map(int, input().split()))
energy = 0
for x in range(N):
    for y in range(x + 1, N):
        energy = energy + d[x] * d[y]
print(energy)


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):
    for j in range[i+1:]:
        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(i+1:):
        s += i*j
print(s)

n=int(input())
d=list(map(int,input().split()))
s=0
for i in range(n):
    for j in range(i+1,):
        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(i+1,n):
        s += d[i]*d[j]
print(s)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted