Problem p02984 (python)

Fixed submission:
import numpy as np
N = int(input())
A = list(map(int, input().split()))
a = np.array(A)
# l = int(((N*N)+1)/2)
b = []
for i in range(N):
    if i%2==0:
        b.append(1)
    else:
        b.append(-1)
c = np.dot(np.array(b),a)
x = [c]
for j in range(1,N):
    x_j = 2*a[j-1] - x[j-1]
    x.append(x_j)
ans = list(map(str, list(map(int, list(x)))))
print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(int, input().split()))
a = np.array(A)
l = int(((N*N)+1)/2)
b = []
for i in range(l):
    b.append(1)
    b.append(-1)
b = b[:-1]
c = (np.array(b).reshape(N,N)
# print(b)
# c = (np.delete(b, 2*l-1, axis=None)).reshape(N,N)
# print(c)
# d = c.reshape(N,N)
inv = 0.5*( np.triu(c) - ( np.tril(c) - np.eye(N) ) )
g = np.eye(N)
x = 2*(np.dot(inv,a))
ans = list(map(str, list(map(int, list(x)))))
print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np

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



a = np.array(A)
l = int(((N**2)+1)/2)



b = np.tile((1,-1),(1,l))

print(1)

# c = (np.delete(b, 2*l-1, axis=None)).reshape(N,N)
# # print(c)
# d = c.reshape(N,N)

# inv = 0.5*( np.triu(c) - ( np.tril(c) - np.eye(N) ) )
# g = np.eye(N)
# print(inv)

# x = 2*(np.dot(inv,a))
# print(x)

# ans = list(map(str, list(map(int, list(x)))))
# print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np

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

a = np.array(A)
l = int(((N**2)+1)/2)
b = np.tile((1,-1),(1,l))
c = (np.delete(b, 2*l-1, axis=None)).reshape(N,N)
# print(c)
# d = c.reshape(N,N)
print(1)
# inv = 0.5*( np.triu(c) - ( np.tril(c) - np.eye(N) ) )
# g = np.eye(N)
# print(inv)

# x = 2*(np.dot(inv,a))
# print(x)

# ans = list(map(str, list(map(int, list(x)))))
# print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np

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

a = np.array(A)
l = int(((N**2)+1)/2)
b = np.tile((1,-1),(1,l))
c = (np.delete(b, 2*l-1, axis=None)).reshape(N,N)
# print(c)
# d = c.reshape(N,N)
inv = 0.5*( np.triu(c) - ( np.tril(c) - np.eye(N) ) )
# g = np.eye(N)
# print(inv)
print(1)
# x = 2*(np.dot(inv,a))
# print(x)

# ans = list(map(str, list(map(int, list(x)))))
# print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np

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

a = np.array(A)
l = int(((N**2)+1)/2)
b = np.tile((1,-1),(1,l))
c = (np.delete(b, 2*l-1, axis=None)).reshape(N,N)
# print(c)
# d = c.reshape(N,N)
inv = 0.5*( np.triu(c) - ( np.tril(c) - np.eye(N) ) )
# g = np.eye(N)
# print(inv)
x = 2*(np.dot(inv,a))
# print(x)
print(1)
# ans = list(map(str, list(map(int, list(x)))))
# print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np

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

a = np.array(A)
l = int(((N**2)+1)/2)
b = np.tile((1,-1),(1,l))
c = (np.delete(b, 2*l-1, axis=None)).reshape(N,N)
# print(c)
# d = c.reshape(N,N)
inv = 0.5*( np.triu(c) - ( np.tril(c) - np.eye(N) ) )
# g = np.eye(N)
# print(inv)
x = 2*(np.dot(inv,a))
# print(x)
ans = list(map(str, list(map(int, list(x)))))
print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np

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

a = np.array(A)
l = int(((N**2)+1)/2)
b = np.tile((1,-1),(1,l))
c = np.delete(b, 2*l-1, axis=None)
d = c.reshape(N,N)
e = np.triu(d)
f = np.tril(d)
g = np.eye(N)

inv = 0.5*(e-(f-g))

x = 2*(np.dot(inv,a))

ans = list(map(str, list(map(int, list(x)))))
print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np

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

a = np.array(A)
l = int(((N**2)+1)/2)
b = np.tile((1,-1),(1,l))
c = np.delete(b, 2*l-1, axis=None)
d = c.reshape(N,N)
e = np.triu(d)
f = np.tril(d)
g = np.eye(N)

inv = 0.5*(e-(f-g))

x = 2*(np.dot(inv,a))

print(x)

ans = list(map(str, list(map(int, list(x)))))
print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np

a = np.array(A)
l = int(((N**2)+1)/2)
b = np.tile((1,-1),(1,l))
c = np.delete(b, 2*l-1, axis=None)
d = c.reshape(N,N)
e = np.triu(d)
f = np.tril(d)
g = np.eye(N)

inv = 0.5*(e-(f-g))

x = 2*(np.dot(inv,a))

ans = list(map(str, list(map(int, list(x)))))
print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
a = np.array(A)
b = np.zeros((N,N))
for i in range(N):
    if i < (N-1):
        b[i][i] = 1
        b[i][i+1] = 1
    else:
        b[i][i] = 1
        b[i][0] = 1
c = np.linalg.inv(b)
x = np.dot(2,np.dot(c,a))
ans = list(map(str, list(map(int, list(x)))))
print(" ".join(ans))