ZhenlongDai/ACPR huggingface dataset:
Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = list(map(int, input().split()))
all_rain = sum(l)
ans = []

for i in range(n):
    now = (i+2)%n
    others = 0
    while now%n != (i+1)%n:
        others += l[(now-1)%n]
        now = (now+2)%n
    ans.append(all_rain-others*2)

print(ans)

Failing test case input:
3
0010001000 1110100010 0

Expected output:
-1100099010 1120101010 1100099010


Actual output:
[-1100099010, 1120101010, 1100099010]


Fixed submission (verdict: Accepted):
n = int(input())
l = list(map(int, input().split()))
ans = []

cnt =1
rain_others = 0
while cnt != n:
    rain_others += l[cnt] * 2
    cnt += 2
ans.append(sum(l)-rain_others)

for i in range(1, n):
    ans.append(l[i-1]*2-ans[i-1])

print(" ".join(list(map(str, ans))))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math

N = int(input())
A = list(map(int, input().split()))
A_sum = sum(A)

res = [0 for i in range(N)]

for i in range(N):
    res[i] = A_sum - 2 * sum([A[(i+(2*j+1)) % N] for j in range(int((N-1)/2))])

print(res)

Failing test case input:
3
1000000001 1001100000 1

Expected output:
-1099998 2001100000 1100000


Actual output:
[-1099998, 2001100000, 1100000]


Fixed submission (verdict: Accepted):

import math

N = int(input())
A = list(map(int, input().split()))
A_sum = sum(A)

res = list()
res.append(A_sum - 2 * sum([A[(2*j+1)] for j in range(int((N-1)/2))]))

for i in range(1, N):
    res.append(2*A[i-1] - res[i-1])

print(' '.join(map(str, res)))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

x = [0]*N
tmp = 0
for i in range(N):
    if i % 2 == 0:
        tmp += A[i]
    else:
        tmp -= A[i]
x[0] = tmp
for i in range(1, N):
    x[i] = int(2*(A[i-1]-x[i-1]/2))
print(x)


Failing test case input:
3
1000010000 1011111000 0

Expected output:
-11101000 2011121000 11101000


Actual output:
[-11101000, 2011121000, 11101000]


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

x = [0]*N
tmp = 0
for i in range(N):
    if i % 2 == 0:
        tmp += A[i]
    else:
        tmp -= A[i]
x[0] = tmp
for i in range(1, N):
    x[i] = int(2 * (A[i - 1] - x[i - 1] / 2))

output = ""
for i in range(N):
    output += str(x[i]) + " "
print(output)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))

x1 = sum(A) - 2 * sum(A[1::2])
print(A[1::2])
print(x1, end=' ')
for i in range(N-1):
    x1 = 2 * A[i] - x1
    print(x1, end=' ')
print()

Failing test case input:
3
1000000000 0001100000 0

Expected output:
998900000 1001100000 -998900000


Actual output:
[1100000]
998900000 1001100000 -998900000 


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))

x1 = sum(A) - 2 * sum(A[1::2])
print(x1, end=' ')
for i in range(N-1):
    x1 = 2 * A[i] - x1
    print(x1, end=' ')
print()
Problem: p02984
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
x = []
s = 0
for i in range(1, n, 2):
    s += a[i]
x.append(sum(a) - 2*s)
for i in range(n):
    x.append(2*a[i]-x[i])
x.pop(-1)
print(x)

Failing test case input:
3
0010001000 1110100010 0

Expected output:
-1100099010 1120101010 1100099010


Actual output:
[-1100099010, 1120101010, 1100099010]


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
x = []
s = 0
for i in range(1, n, 2):
    s += a[i]
x.append(sum(a) - 2*s)
for i in range(n):
    x.append(2*a[i]-x[i])
x.pop(-1)
for i in range(n):
    print(x[i], end=' ')
print()

Problem: p02984
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
A = [int(i) for i in input().split()]
a = 0
for i in range(N):
  a += A[i] * (-1) ** i
b = a
print(a, end = " ")

for i in range(1, N-1):
  b = 2 * A[i-1] - b
  print(b, end = " ")

print(2 * A[N-2] - a)

Failing test case input:
3
1001001000 1011101000 0

Expected output:
-10100000 2012102000 10100000


Actual output:
-10100000 2012102000 2032302000


Fixed submission (verdict: Accepted):
N = int(input())
A = [int(i) for i in input().split()]
a = 0
for i in range(N):
  a += A[i] * (-1) ** i
b = a
print(a, end = " ")

for i in range(0, N-2):
  b = 2 * A[i] - b
  print(b, end = " ")

print(2 * A[N-2] - b)

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
A = [int(i) for i in input().split()]

x1 = sum(A)
for i in range(n):
    if i % 2 == 0:
        x1 -= A[i]
ans = [x1]
for i in range(n-1):
    tmp = 2 * A[i] - ans[i]
    ans.append(tmp)
print(" ".join([str(int(n)) for n in ans]))

Failing test case input:
3
0010000000 1110001010 0

Expected output:
-1100001010 1120001010 1100001010


Actual output:
1110001010 -1090001010 3310003030


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

x1 = sum(A)
for i in range(n):
    if i % 2 != 0:
        x1 -= 2 * A[i]
ans = [x1]
for i in range(n-1):
    tmp = 2 * A[i] - ans[i]
    ans.append(tmp)

print(" ".join([str(int(n)) for n in ans]))

Problem: p02984
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

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

total = sum(l)

for i in range(1,n,2):
    total -= l[i] * 2

ans = [total]

for i in range(1,n):
    ans.append(2* l[i-1] - ans[i-1])
    


Failing test case input:
3
0000000000 1110100010 0

Expected output:
-1110100010 1110100010 1110100010


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())

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

total = sum(l)

for i in range(1,n,2):
    total -= l[i] * 2

ans = [total]

for i in range(1,n):
    ans.append(2*l[i-1]-ans[i-1])
ans = [str(i) for i in ans]
    
print(' '.join(ans))