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

answer=0

for i in range(N):
  for t in range(N):
    if t>=i:
      answer+=d[i]*d[t]

print(answer)

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

answer=0

for i in range(N):
  for t in range(N):
    if t>i:
      answer+=d[i]*d[t]

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

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

S = sum(d)

ans = 0

for i in range(N):
    ans += (S-d[i])*d[i]
print(ans(

N = int(input())

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

S = sum(d)

ans = 0

for i in range(N):
    ans += (S-d[i])*d[i]
print(int(ans/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())
d_list = list(map(int, input().split()))

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

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

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

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

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)


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

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

N = int(input())
numbers = input().split(" ")
total = 0
d = 0
for i in numbers:
    d += int(i)**2
    s = 0
    for j in numbers:
        s += int(j)
    total += s*int(i)
ans = total - d
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())
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)


n = int(input())
a = [int(x) for x in input().split()]
s = 0
for x in range(n):
    for y in range(x + 1, n):
        s = s + a[x] * a[y]
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):
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<int> d(n);
  rep(i, n) cin >> d[i];
  int ans = 0;
  rep(i, n) for (int j = i+1; j<n; ++j) {
    ans += d[i]*d[j];
  }
  cout << ans << endl;
  return 0;
  }

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: 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())
t_list = list(map(int, input().split()))

u = 0

for val in range(n):
	u += t_list[n]*(sum(t_list) - t_list[n])

u /= 2
m = int(u)
print(m)

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

u = 0

for val in range(n):
	u += t_list[val]*(sum(t_list) - t_list[val])

u /= 2

print(u)

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

u = 0

for val in range(n):
	u += t_list[val]*(sum(t_list) - t_list[val])

u /= 2
m = int(u)
print(m)

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


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)

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

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)

a=int(input())
b=list(map(int,input().split()))
out=0
for i in range(a):
  for j in range(i,a):
    if i==j:
      continue
    else:
      out=out+b[i]*b[j]

print(out)

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

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)

n = int(input())
d = 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)

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)

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

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

Verdicts: Runtime Error

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


n=int(input())
d=[]

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

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

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

s = int(0)

s += d[0] * d[n]


for i in range(n):
    s += d[n] * d[n+1]

print(s)

n = int(input())

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

for i in range(n):
    for j in range(n):
        if i == j:
            break
        else:
            s += d[i] * d[j]

print(s)

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

s = int(0)
s += d[0] * d[n]

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

print(s)


n = int(input())

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

s = int(0)

for i in range(n):
    for j in range(i,n):
        if i == j:
            continue
        else:
            s += d[i] * d[j]

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(stdin.readline().rstrip())
d = stdin.readline().rstrip().split()
res = 0
count1 = 0
for el1 in d:
    count2 = 0
    for el2 in d:
        if (count2 > count1):
            res += int(el1) * int(el2)
        count2 += 1
    count1 += 1

print(res)

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import copy










'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''





n = int(stdin.readline().rstrip())
d = stdin.readline().rstrip().split()
res = 0
count1 = 0
for el1 in d:
    count2 = 0
    for el2 in d:
        if (count2 > count1):
            res += int(el1) * int(el2)
        count2 += 1
    count1 += 1

print(res)


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())
A = list(map(int, input().split()))
ans = 0
while len(d) > 1:
    current = d[0]
    for y in range(len(d)):
        ans += current * d[y]
#         print(ans)
    ans -= current ** 2
    d.pop(0)
print(ans)

N = int(input())
d = list(map(int, input().split()))
ans = 0
while len(d) > 1:
    current = d[0]
    for y in range(len(d)):
        ans += current * d[y]
#         print(ans)
    ans -= current ** 2
    d.pop(0)
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 sys
input = sys.stdin.readline


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


if __name__ == '__main__': main()

import sys
input = sys.stdin.readline


def main():
    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)


if __name__ == '__main__': main()

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


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

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


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

n=int(input())
k=list(map(int,input().split()))
ans=0
for i in range(n):
  for j in range(n):
    if i==j:
      break
    ans+=k[i]*k[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()))
p=0
q=0
for i in range(N):
  p= p+D[i]**2
  q= q+D[i]
print((q**2-p)/2)

N=int(input())
D=list(map(int,input().split()))
p=0
q=0
for i in range(N):
  p= p+D[i]**2
  q= q+D[i]
print((q**2-p)//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())
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)

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 += a[i]*a[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()))
answer = 0
for i in range(len(D)):
    for j in range(len(D)):
        if i != j:
            answer += D[i]*D[j]/2
print(answer)

N = int(input())
D = list(map(int, input().split()))
answer = 0
for i in range(len(D)):
    for j in range(i, len(D)):
        if i != j:
            answer += D[i]*D[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())
d=input().split()
di=[]
for i in range(N):
    di.append(int(d[i]))

result=0
for i in range(N):
    for j in range(N):
        if i!=j:
            tmp=di[i]*di[j]
            result+=tmp
print(result/2)

N=int(input())
d=input().split()
di=[]
for i in range(N):
    di.append(int(d[i]))

result=0
for i in range(N):
    for j in range(N):
        if i!=j:
            tmp=di[i]*di[j]
            result+=tmp
print(int(result/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())
List=list(map(int,input().split()))
c=0
for i in range(N-1):
  for j in range(i+1:N):
    c==c+(List[i]*List[j])
print(c)

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

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

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

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

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)


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

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


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


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)


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())
tako = list(map(int, input().split()))
num = 0
for n in range(N):
  for m in range(N):
    if not (n == m):
      num += tako[n] * tako[m]
      
print(num)
    
    



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


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

n = int(input())
lis = list(map(int,input().split()))
ans = 0
num = sum(lis)
for i in range(n):
  num -= lis[i]
  ans += lis[i] * num
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()))

ret = 0

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

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

ret = 0

for i in range(N):
    for j in range(i+1, N):
        if i == j:
            continue

        ret += D[i] * D[j]

print(ret)

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 numpy as np
n = int(input())
d = list(map(int,input().split()))
print(int((np.sum(np.array(d))**2 - np.sum(np.array(d)**2)) /

import numpy as np
n = int(input())
d = list(map(int,input().split()))
print(int((np.sum(np.array(d))**2 - np.sum(np.array(d)**2)) /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())
d = list(map(int, input().split()))

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

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

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

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

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

print(sum(TotalList))

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

for A in range(N-1):
  for B in range(A+1):
    D(A)*D(B) = K
    TotalList.append(K)

print(sum(TotalList))

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)

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

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

print(TotalList)

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

             

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

             

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

             

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= input().split(" ")

N=int(a[0])

#d=[int(input()) for _ in range(N)]
d=input().split(" ")
for i in range(N):
  d[i] = int(d[i])

sum=0
print(d)

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


a= input().split(" ")

N=int(a[0])

#d=[int(input()) for _ in range(N)]
d=input().split(" ")
for i in range(N):
  d[i] = int(d[i])

sum=0
#print(d)

for i in range(N-1):
  for j in range(N-1-i):
    sum = sum + d[i]*d[i+j+1]
  
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):
from itertools import combinations

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

c=combinations(d,2)
print(d)

from itertools import combinations

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

c=list(combinations(d,2))

ans=0

for i in range(len(c)):
    a=c[i][0]*c[i][1]
    ans+=a

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())) 
ans = int(0)
s = int(0)
for k in range(n):
    print(k)
    if k < n:
        for i in range(n-1):
            if k < i + 1:
                s=d[k]*d[i+1]
                ans += s
        k += 1
print(ans)

n = int(input())
d = list(map(int, input().split())) 
ans = int(0)
s = int(0)
for k in range(n):
    if k < n:
        for i in range(n-1):
            if k < i + 1:
                s=d[k]*d[i+1]
                ans += s
        k += 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):
from functools import reduce
import collections

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

ans = 0
for i in range(N):
    ans += reduce(mul, D)
    queue.popleft()
print(ans)

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

import itertools

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

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

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



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


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

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

power=0

for i in range(n):
  for j in range(n):
    if i!=j:
      power+=dd[i]*dd[j]
print(power//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()))

kaihuku = 0

for i in range(n-1):
    for j in range(i+1,n):
        kaihuku += d(i) * d(j)

print(kaihuku)

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

kaihuku = 0

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

print(kaihuku)

Verdicts: Runtime Error

Accepted