Problem:


Score : 200 points

Problem Statement

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.

Constraints

All values in input are integers.

2 \leq N \leq 50

0 \leq d_i \leq 100

Input

Input is given from Standard Input in the following format:

N
d_1 d_2 ... d_N

Output

Print the sum of the health points restored from eating two takoyaki over all possible choices of two takoyaki from the N takoyaki served.

Sample Input 1

3
3 1 2

Sample Output 1

11

There are three possible choices:

Eat the first and second takoyaki. You will restore 3 health points.

Eat the second and third takoyaki. You will restore 2 health points.

Eat the first and third takoyaki. You will restore 6 health points.

The sum of these values is 11.

Sample Input 2

7
5 0 7 8 3 3 2

Sample Output 2

312



Sample input:
3
3 1 2


Sample output:
11

Submission status: Wrong Answer

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

ans = 0

for i in range(N):
  for j in range(N):
    if i != j:
      ans += d[i]*d[j]
      
print(ans/2)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
import itertools
N = int(input())
d = list(map(int, input().split()))

p = list(itertools.permutations(d,2))


n = 0

for i in range(len(p)):
    n = n + (p[i][0] * p[i][1])
    
print(n/2)

Submission status: Wrong Answer

Solution code:
n = int(input())
di = list(map(int, input(). split()))
s = 0
for i in range(n):
	for j in range(n):
		if i < j:
			print(di[i], di[j])
			s += (di[i] * di[j])
print(s)

Submission status: Wrong Answer

Solution code:
n=int(input())
d=list(map(int,input().split()))
sam=0

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

print(sam)

Submission status: Wrong Answer

Solution code:
n=int(input())
d=list(map(int,input().split()))
sam=0

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

print(sam)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=0
c=list(map(int,input().split()))
for i in range(a):
  for k in range(a):
    b=b+c[i]*c[k]
for u in range(a):
  b=b-c[u]*c[u]
print(b/2)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=0
c=list(map(int,input().split()))
for i in range(a):
  for k in range(a):
    b=b+c[i]*c[k]
for u in range(a):
  b=b-c[u]*c[u]
print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())
d = list(map(int,input().split()))
ans = 0
for i in d:
    for j in d:
        if i == j:
            continue
        ans += (i*j)
print(int(ans/2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
print((sum(a) * (n-1)) // 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
List = list(map(int, input().split()))
wa = 0
for i in range(N):
  if i + 1 == N:
    wa += List[0]*List[N-1]
  else:
    wa += List[i]*List[i+1]
print(wa)

Submission status: Wrong Answer

Solution code:
ans=0
n=int(input())
li=list(map(int,input().split()))
for i in li:
  for j in li:
    if i==j:
      break
    ans+=i*j
print(ans)

Submission status: Wrong Answer

Solution code:
ans=0
n=int(input())
li=list(map(int,input().split()))
for i in li:
  for j in li:
    if i==j:
      continue
    ans+=i*j
print(ans//2)

Submission status: Wrong Answer

Solution code:
ans=0
n=int(input())
li=list(map(int,input().split()))
for i in li:
  for j in li:
    ans+=i*j
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
D = sorted(list(map(int, input().split())))
print(D[-1]*D[-2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(n):
  ans += i * (sum(d) - i)
print(ans // 2)

Submission status: Wrong Answer

Solution code:
n = int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(n):
  ans += i * (sum(d) - i)
print(ans // 1)

Submission status: Wrong Answer

Solution code:
n = int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(n):
  ans += i * (sum(d) - 1)
print(ans // 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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//2)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools


def actual(n, D):
    """
    combinations でゴリ押し
    """
    comb = itertools.combinations(D, 2)

    # return sum([x * y for x, y in comb])

    """
    「順番を考慮しない2要素の選び方」を全探索する際のポイント
        内側のループ変数の始点を外側のループ変数 +1 から始めるとよい。
        これにより、内側のループで選ぶインデックスが必ず外側のループで選ぶインデックスより大きくなり、
        同じ選び方を 2 回見てしまうことを回避できます。
    """
    # s = 0
    # for i in range(len(D)):
    #     for j in range(i + 1, len(D)):
    #         s += D[i] * D[j]
    #
    # return s

    """
    O(N)で解くパターン
    
    ex: a, b, c, d
        a*b + a*c + a*d = a * (b + c +d)
              b*c + b*d = b * (    c +d)
                    c*d = c * (       d)
    """
    s = 0
    for i in range(len(D) - 1):
        s += D[i] * sum(D[i + 1:])


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

print(actual(n, D))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
arr = list(map(int, input().split()))

ans = 0
for i in range(N):
    for j in range(i+1,N):
        ans += i*j
print(ans)

Submission status: Wrong Answer

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

ans = 0
for i in d:
    for j in d:
        if i!=j:
            ans += i * j
print(ans//2)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 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)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = list(map(int,input().split()))


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

Submission status: Wrong Answer

Solution code:
N = int(input())
l = list(map(int,input().split()))


ans = 0
for i in range(N):
  for j in range(i,N):
    ans += l[i]*l[j]
    
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = list(map(int,input().split()))


ans = 0
for i in range(N):
  for j in range(i,N):
    ans += l[i]*l[j]
    
print("ans")

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
N = int(input())
lis = list(map(int,input().split()))
print(sum(lis)*2)

Submission status: Wrong Answer

Solution code:
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))

Submission status: Wrong Answer

Solution code:
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))

Submission status: Wrong Answer

Solution code:
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))

Submission status: Wrong Answer

Solution code:
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))

Submission status: Wrong Answer

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

ans=0
for n in range(N):
    X=D[n]
    for i in range(N):
        Y=D[i]
        ans+=X*Y
for n in range(N):
    ans-=D[n]**2
ans/=2

print(ans)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
a = []
for i in l:
  for j in l:
    if i != j:
      a.append(i*j)
print(sum(a))

Submission status: Wrong Answer

Solution code:
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))

Submission status: Wrong Answer

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
D = iil()
ans = 0
for i in range(n):
    for j in range(i+1,n):
        print(i,j)
        ans += D[i]*D[j] 
print(ans)

Submission status: Wrong Answer

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
D = iil()
ans = 0
for i in range(n):
    for j in range(i,n):
       ans += D[i]*D[j] 
print(ans)

Submission status: Wrong Answer

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
D = iil()
ans = 0
for i in range(n):
    for j in range(i,n):
       ans += D[i]*D[j]

Submission status: Wrong Answer

Solution code:
n = int(input())
d = list(map(int,input().split()))
ans = 0

for i in d:
  for j in d[i+1:]:
    ans = ans + i * j

print(ans)

Submission status: Wrong Answer

Solution code:
import itertools
N = int(input())
D = list(map(int, input().split()))
print(sum(D)*(N-1))

Submission status: Wrong Answer

Solution code:
n=int(input())
dd=list(map(int,input().split()))

power=0

for i in range(n):
  for j in range(n):
    if i==j:
      continue
    power=dd[i]*dd[j]
print(power//2)

Submission status: Wrong Answer

Solution code:
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)]))

Submission status: Wrong Answer

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

l_a = [i * j for i in l for j in l[l.index(i) + 1:]]

print(sum(l_a))

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
N=int(input())
D=list(map(int,input().split()))
from itertools import combinations
ans=0
comb=combinations(D,2)
for c in comb:
  ans+=c[0]+c[1]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
numbers = input().split(" ")
total = 0
d = 0
for i in numbers:
  total += int(i) * (2*N+1)
  d += int(i)*2
ans = total - d
print(ans/2)

Submission status: Wrong Answer

Solution code:
n=int(input())
d=list(map(int,input().split()))
d_sum=sum(d)
sq=0
for i in range(n):
    sq+=d[i]**2
print(d_sum**2-sq)

Submission status: Wrong Answer

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

ans = 0

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

Submission status: Wrong Answer

Solution code:
n = int(input())
d = list(map(int, input().split()))
sq = list(d[i]**2 for i in range(n))
ans = -sum(sq)
for i in range(1,len(d)+1):
    for j in range(1,len(d)+1):
        ans += i*j
print(int(ans/2))

Submission status: Wrong Answer

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

sum_all = 0
for i in range(N):
  for s in range(i, N):
    sum_all += D[i] * D[s]
    
print(sum_all)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
n = int(input())
result = 0
a = list(map(int, input().split()))

m = set()
for i, v in enumerate(a):
  for i2, v2 in enumerate(a):
    if i != i2 and v*v2 not in m:
      m.add(v*v2)

for v in m:
  result += v
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
result = 0
a = list(map(int, input().split()))

for i, v in enumerate(a):
  for i2, v2 in enumerate(a):
    if i != i2:
      result += v*v2
print(result)

Submission status: Wrong Answer

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

ans=0
s=sum(l)

for i in range(n):

    ans+=l[i]*(s-l[i])

print(ans/2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
c=0
b=list(map(int,input().split()))
for i in range(a):
  if a-1==i:
    c+=(b[i]*b[0])
  else:
    c+=(b[i]*b[i+1])
print(c)

Submission status: Wrong Answer

Solution code:
a=int(input())
c=0
b=list(map(int,input().split()))
for i in range(a):
  c+=b[i]
print(a+c)

Submission status: Wrong Answer

Solution code:
N = int(input())
list = list(map(int, input().split()))

ans = 0

for i in range(N):
    for j in range(N):
        ans += list[i]*list[j]

for i in range(N):
    ans += -list[i]**2
print(ans/2)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
N = int(input())
d_list = input().split(" ")

sum = 0

for i in range(len(d_list)):
    if i == len(d_list) - 1:
        sum += int(d_list[i]) * int(d_list[0])
    else:
        sum += int(d_list[i]) * int(d_list[i + 1])

print(sum)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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]

Submission status: Wrong Answer

Solution code:
N = int(input())
li = list(map(int, input().split()))
ans = 0
for i in range(len(li)):
	for j in range(len(li)):
		if i != j:
			ans += li[i]*li[j]
print(ans/2)

Submission status: Wrong Answer

Solution code:
n = int(input())
d = [int(x) for x in input().split()]
s = 0
for i in range(0, n):
  for j in range(i, n):
    s += d[i] * d[j]
print(s)

Submission status: Wrong Answer

Solution code:
#全探索のforが書けますか？という問題
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)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
A.sort()
print(A[-1]*A[-2])

Submission status: Wrong Answer

Solution code:
import sys

n = int(sys.stdin.readline())
xs = [int(s) for s in sys.stdin.readline().split(" ")]

result = 0

for i in range(0, n):
    x = xs[i]
    for j in range(i + 1, n):
        print(x, xs[j])
        result += x * xs[j]

print(result)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

ret = 0

for i in range(N):
    for j in range(N):
        if i == j:
            continue
        
        ret += D[i] * D[j]
        
print(ret)

Submission status: Wrong Answer

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n=int(input())

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input().strip())
d=list(map(int,input().strip().split()))
sum_=0
for i,x in enumerate(d):
  for y in d[i+1:]:
      print(x,y)
      sum_+=x*y
print(sum_)

Submission status: Wrong Answer

Solution code:
N = int(input())
d = map(int, input().split())
S = (sum(d)**2 - sum(map(lambda x: x**2, d))) // 2
print(S)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
s = 0
for x in a:
    for y in a:
        s = s + x * y
    s = s - x * x
print(s)

Submission status: Wrong Answer

Solution code:
N = int(input())
p = []
q = 0
p = list(map(int, input().strip().split()))
for i in range(N):
    for j in range(N):
        q += (p[i] * p[j])
    q -= p[i] * p[i]
q = q / 2
print(q)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
s=[]
for i in a:
  for i2 in a:
    if i!=i2:
      s.append(i*i2)
print(sum(s)//2)

Submission status: Wrong Answer

Solution code:
n = int(input())
d = list(map(int, input().split()))
 
result = 0
for x in range(n - 1):
  for y in range(x + 1, n):
    result = d[x] * d[y]
    
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
d = list(map(int, input().split()))
 
result = 0
 
for x in range(1, n + 1):
  for y in range(x + 1, n + 1):
    result = d[x-1] * d[y-1]
    
print(result)

Submission status: Wrong Answer

Solution code:
A = int(input())
d = list(map(int, input().split()))
sum = 0

for x in range(A):
    for y in range(1, A):
        sum += d[x]*d[y]

print(sum)

Submission status: Wrong Answer

Solution code:
s=str(input())
a=s.count("a")
b=s.count("b")
c=s.count("c")
if max(a,b,c)-min(a,b,c)<=1:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
N = int(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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
D = list(map(int,input().split()))
TotalList = 0

for A in range(N-1):
  for B in range(A+1):
    TotalList += D[A]*D[B]
    

print(TotalList)

Submission status: Wrong Answer

Solution code:
N = int(input())
D = list(map(int,input().split()))
total = 0
for A in range(N-1):
  for B in range(A+1,N):
    total = D[A]*D[B]
print(total)

Submission status: Wrong Answer

Solution code:
N=int(input())
d = list(map(int, input().split()))
total=0
for n in range(N-1):
    for j in range(n+1,N):
        total+=d[n]*d[j]
total

Submission status: Wrong Answer

Solution code:
N=int(input())
d=list(map(int, input().split()))
total=0
for n in range(N):
    for j in range(n+1,N):
        total+=d[n]*d[j]
total

Submission status: Wrong Answer

Solution code:
N=int(input())
d = list(map(int, input().split()))
total=0
for n in range(N):
    for j in range(n+1,N):
        total+=d[n]*d[j]
total

Submission status: Wrong Answer

Solution code:
import random
N=int(input("タコフェスの数："))
d=[]
total=0
for i in range(N):
    d.append(random.randint(0,100))
for n in range(N):
    for j in range(n+1,N):
        total+=d[n]*d[j]
total

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
#B
N = int(input())
A = list(map(int,input().split()))
s = sum(A)**2
for i in range(N):
    s -= A[i]**2
print(s/2)

Submission status: Wrong Answer

Solution code:
num=int(input())
data=input().split()
sum=0

for a in range(num):
  for b in range(num-1-a):
    sum+=int(data[a])*int(data[-b])
print(sum)

Submission status: Wrong Answer

Solution code:
d=list(map(int,input().split()))
list_A=[]
list_B=[]
for num3 in d:
    list_B.append(int(num3*num3))
k=sum(list_B)
for num in d:
    for num2 in d:
        list_A.append(int(num*num2))
print((sum(list_A)-k)//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print("Enter number of takoyaki")
N = int(input())
print("Enter deliciousness")
d = list(map(int,input().split()))
total = 0

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

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
N = int(input())
D = list(map(int, input().split()))
res = 0
for i in range(N-1):
    for j in range(1, N):
        res += D[i] * D[j]

print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())
L=list(map(int,input().split()))

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

Submission status: Wrong Answer

Solution code:
input()
foods=list(map(int,input().split()))
ans = 0
sum_ans = 0
for i in foods:
    for j in foods:
        if i<j:
            ans = i*j
            sum_ans += ans
print(sum_ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
d = map(int, input().split())
d_2 = map(lambda x: x*x, d)
print((sum(d)**2 - sum(d_2)) // 2)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
f=0
for i in A[0:n-1]:
	for j in A[i+1:n]:
		f=f+i*j
print(f)

Submission status: Wrong Answer

Solution code:
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 += i*j
print(ans)

Submission status: Wrong Answer

Solution code:
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))

Submission status: Wrong Answer

Solution code:
n = int(input())
d = list(map(int, input().split()))
ans = 0
for i in d:
  for j in d:
    if i != j:
      ans += i*j
print(int(ans/2))

Submission status: Wrong Answer

Solution code:
n = int(input())
d = list(map(int, input().split()))
ans = 0
for i in d:
  for j in d:
    if i != j:
      ans += i*j
print(ans/2)

Submission status: Wrong Answer

Solution code:
N = int(input())
num = list(map(int, input().split()))
a = 0
for i in range(N-1):
  for j in range(N-1):
    if num[i] != num[j+1]:
      a += num[i]*num[j+1]
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools
N = int(input())
D=[]*N
D=map(int,input().split(" "))
sum=0
for i,j in itertools.permutations(D,2):
    sum+=i*j

print(sum/2)

Submission status: Wrong Answer

Solution code:
N = int(input())
d = [int(i) for i in input().split()]
sum = 0

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

print(sum)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
words = lambda t : list(map(t, input().split()))
n = int(input())
d = words(int)

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

print(ttl)

Submission status: Wrong Answer

Solution code:
n = int(input())
d = list(map(int,input().split()))
li=[]
li2=[]
for i in range(n):
  for j in range(n):
    a = d[i]*d[j]
    li.append(a)
b = sum(li)
for k in range(n):
  c=d[k]**2
  li2.append(c)
d=sum(li2)
b=b-d
print(b/2)

Submission status: Wrong Answer

Solution code:
num=int(input())
a=list(map(int,input().split()))
out=0
for i in range(num):
  for j in range(i-1):
    out=out+(a[i]*a[j])
print(out)