Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03408 (python)

Fixed submission:
n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]
result=0
for i in set(s):
    result=max(result,s.count(i)-t.count(i))
print(result)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]
for i in set(s):
    result=s.count(i)-t.count(i)
print(max(o,result))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]
for i in range(n):
    result=s.count(s[i])-t.count(s[i])
print(max(o,result))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for j in range(m)]
for i in range(n):
    result=s.count(s[i])-t.count(s[i])
print(max(o,result))

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    s=list(input())
m=int(input())
for j in range(m):
    t=list(input())

result=0
for i in range(n):
    result=s.count(s[i])-t.count(s[i])

print(max(o,result))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(input() for i in range(n))
m=int(input())
t=list(input() for j in range(m))

for i in range(n):
    result=s.count(s[i])-t.count(s[i])

print(max(o,result))

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    s=list(input())
m=int(input())
for j in range(m):
    t=list(input())

for i in range(n):
    result=s.count(s[i])-t.count(s[i])

print(max(o,result))

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    s=list(str(input()))
m=int(input())
for j in range(m):
    t=list(str(input()))

for i in range(n):
    result=s.count(s[i])-t.count(s[i])

print(max(o,result))

Buggy submission (verdict: Runtime Error):
import collections

n=int(input())
for i in range(n):
    s=list(input())
m=int(input())
for j in range(m):
    t=list(input())

cs=collections.Counter(s)
ct=collections.Counter(t)

cst=cs-ct

print(max(cst))

Buggy submission (verdict: Runtime Error):
import collections

n=int(input())
for i in range(n):
    s=list(map(str,input()))
m=int(input())
for j in range(m):
    t=list(map(str,input()))

cs=collections.Counter(s)
ct=collections.Counter(t)

cst=cs-ct

print(max(cst))

Buggy submission (verdict: Runtime Error):
import collections

n=int(input())
for i in range(n):
    s=list(map(str,input().split()))
m=int(input())
for j in range(m):
    t=list(map(str,input().split()))

cs=collections.Counter(s)
ct=collections.Counter(t)

cst=cs-ct

print(max(cst))

Buggy submission (verdict: Runtime Error):
import collections

n=int(input())
for i in range(n):
    s=list(map(str,input()))
m=int(input())
for j in range(m):
    t=list(map(str,input()))

cs=collections.Counter(s)
ct=collections.Counter(t)

cst=cs-ct

print(max(cst))

Buggy submission (verdict: Runtime Error):
import collections

n=int(input())
for i in range(n):
    s=list(str(input()))
m=int(input())
for j in range(m):
    t=list(str(input()))

cs=collections.Counter(s)
ct=collections.Counter(t)

cst=cs-ct

print(max(cst))
Problem p03416 (python)

Fixed submission:
A,B=map(int,input().split())
count=0
for i in range(A,B+1):
        if str(i)==str(i)[::-1]:
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
count=0
for i in range(A,B+1):
    for j in i:
        array_j=list(map(int,str(j)))
        if array_j==reversed(array_j):
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    for j in i:
        array_j=list(map(int,str(j)))
        if array_j==reversed(array_j):
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    for j in i:
        array_i=list(map(int,str(j)))
        if array_i==reverse(array_i):
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    for j in i:
        array_i=list(map(int,str(i)))
        if array_i==reverse(array_i):
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    array_i=list(map(int,str(i)))
    if set(array_i)==set(reverse(array_i)):
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    array_i=list(map(int,str(i)))
    if array_i==reverse(array_i):
        count+=1
    print(count)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    array_i=list(map(int,str(i)))
    if array_i==reverse(array_i):
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    array_i=list(map(int,str(i)))
    if array_i==reverse(array_i):
        count+=1
print(count)
Problem p03433 (python)

Fixed submission:
N=int(input())
A=int(input())
if N%500<=A:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,A=map(int,input().split())
if N%500<=A:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,A=map(int,input().split())
if N%500<=A:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,A=map(int,input().split())
if N>A and (N-A)%500==0:
    print("Yes")
elif N<=A:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N,A=map(int,input().split())
if N>A and (N-A)%500==0:
    print("Yes")
elif N<=A:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,A=map(int,input().split())
if N>=A and (N-1*A)%500==0:
    print("Yes")
elif N<A:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,A=map(int,input().split())
if (N-1*A)%500==0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,A=map(int,input().split())
if (N-A)%500==0:
    print("Yes")
else:
    print("No")
Problem p03436 (python)

Fixed submission:
from collections import deque
def bfs():
    d=[[float("inf")]*w for i in range(h)]
    dx=[1,0,-1,0]
    dy=[0,1,0,-1]
    que=deque([])
    que.append((0,0))
    d[0][0]=0
    cnt=0
    while que:
        p=que.popleft()
        if p[0]==h-1 and p[1]==w-1:
            break
        for i in range(4):
            nx=p[0]+dx[i]
            ny=p[1]+dy[i]
            if 0<=nx and nx<h and 0<=ny and ny<w and maze[nx][ny]!="#" and d[nx][ny]==float("inf"):
                que.append((nx,ny))
                d[nx][ny]=d[p[0]][p[1]]+1
    for i in range(h):
        for j in range(w):
            if maze[i][j]=="#":
                cnt+=1
    if d[h-1][w-1]!=float("inf"):
        return h*w-d[h-1][w-1]-1-cnt
    else:
        return -1

h,w=map(int,input().split())
maze=[list(input()) for i in range(h)]

print(bfs())

Buggy submission (verdict: Runtime Error):
from collections import deque
def bfs():
    d=[[float("inf")]*w for i in range(h)]
    dx=[1,0,-1,0]
    dy=[0,1,0,-1]
    que=deque([])
    que.append((0,0))
    d[0][0]=0
    while que:
        p=que.popleft()
        if p[0]==h-1 and p[1]==w-1:
            break
        for i in range(4):
            nx=p[0]+dx[i]
            ny=p[1]+dy[i]
            if 0<=nx and nx<h and 0<=ny and ny<w and maze[nx][ny]!="#" and d[nx][ny]==float("inf"):
                que.append((nx,ny))
                d[nx][ny]=d[p[0]][p[1]]+1
    return d[h][w]

h,w=map(int,input().split())

if d[h][w]!=inf:
    ans=h*w-d[h][w]-1-maze.count("#")
else:
    ans=-1

print(ans)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
print("Even" if a*b%2==0 else "Odd")

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if x+y>t or (x+y+t)%2:
      print("NO")
      exit()
print("YES")

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if x+y>t or (x+y+t)%2==1:
      print("NO")
      exit()
print("YES")

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if x+Y>t or (x+y+t)%2==1:
      print("NO")
      exit()
print("YES")

Buggy submission (verdict: Runtime Error):
a,b==map(int,input().split())
print("Even" if a*b%2==0 else "Odd")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print("Even" if a*b%2===0 else "Odd")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a*b%2===0
    print('even')
if a*b%2===1
    print('odd')
Problem p03457 (python)

Fixed submission:
import sys
N=int(input())
for i in range(N):
  t,x,y=map(int,input().split())
  if (x+y)%2==t%2 and x+y<=t:
    pass
  else:
    print('No')
    sys.exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
N=int(input())
for i in range (N):
    x,y,t=map(int,input().split())
    if x+y<=t and (x+y)%2==t%2:
        pass
    else print("NO")
    sys.exit()
print("YES")

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if x+Y>t or (x+y+t)%2==1:
      print("NO")
      exit()
print("YES")

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if x+Y>t or (x+y+t)%2:
      print("NO")
      exit()
print("YES")

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if x+y<=t and t%2==(x+y)%2:count+=1
print("YES" if count==n else "NO")

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if x+y<=n and t%2==(x+y)%2:count+=1
print("YES" if count==n else "NO")

Buggy submission (verdict: Runtime Error):
n=input()
for i in range(n):
    t,x,y=map(int,input().split())
    if x+y<=n and t%2==(x+y)%2:
        count+=1
print("YES" if count==n else "NO")
Problem p03469 (python)

Fixed submission:
s=str(input())
print(s.replace("2017","2018"))

Buggy submission (verdict: Runtime Error):
s=str(input())
print(s.replace("2017"."2018"))

Buggy submission (verdict: Runtime Error):
s=str(input())
print(s.reprace("2017"."2018"))
Problem p03478 (python)

Fixed submission:
n,a,b=map(int,input().split())
ans=0
for i in range(n+1):
    if a<=sum(list(map(int,list(str(i)))))<=b:
        ans+=i
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
ans=0
for i in range(n+1):
    if a<=sum(list(map(int,list(str(i))))<=b:
        ans+=i
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
ans=0
for i in range(n+1):
    if a<=sum(map(int,str(i))<=b:
        ans+=i
print(ans)
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
input()
A=list(map(int,input().split()))
ans=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    ans+=1
print(ans)
Problem p03494 (python)

Fixed submission:
input()
A=list(map(int,input().split()))
ans=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
input()
A=list(map(int,input().split())
ans=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    ans+=1
print(ans)
Problem p03495 (python)

Fixed submission:
import collections

n,k=map(int,input().split())
a=list(map(int,input().split()))

a_counter=collections.Counter(a)
li=a_counter.most_common()[k:]
ans=0
for i in li:
    ans+=i[1]
print(ans)

Buggy submission (verdict: Runtime Error):
import collections

n,k=int(input())
a=list(map(int,input().split()))

a_counter=collections.Counter(a)
li=a_counter.most_common()[k:]
ans=0
for i in li:
    ans+=i[1]
print(ans)

Buggy submission (verdict: Runtime Error):
import collections

n,k=int(input())
a=list(map(int,input().split()))

a_counter=collections.Counter(a)
li=a_counter.most_common()[k:]
ans=0
for i in li:
    ans+=li(i)[1]
print(ans)

Buggy submission (verdict: Runtime Error):
import collections

n,k=int(input())
a=list(map(int,input().split()))

a_counter=collections.Counter(a)
li=a_counter.most_common()[k:]
ans=0
ans+=li[1]
print(ans)
Problem p03556 (python)

Fixed submission:
n=int(input())
a=[]
for i in range(1,100000):
    if i**2<=n:
        a.append(i)
print((max(set(a)))**2)

Buggy submission (verdict: Runtime Error):
n=int(input())
m==1
for i in range(2,100000):
    if i**2<=n:
        m=max(i,m)
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
m==1
for i in range(100000):
    if i**2<=n:
        m=max(i,m)
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
m==1
for i in range(100000):
    if i**2<=n:
        m=max(i,m)
print(int(m))
Problem p03565 (python)

Fixed submission:
sd=input()
t=input()

n=len(sd)
m=len(t)
s=[]

for i in range(n-m,-1,-1):
    t_kamo=sd[i:i+m]
    for j in range(m+1):
        if j==m:
            print((sd[:i]+t+sd[i+m:]).replace("?","a"))
            exit()
        if t_kamo[j]=="?":
            continue
        elif t_kamo[j]!=t[j]:
            break
print("UNRESTORABLE")

Buggy submission (verdict: Runtime Error):
sd=input()
t=input()

n=len(sd)
m=len(t)
s=[]

for i in range(n-m,-1,-1):
    t_kamo=sd[i:i+m]
    for j in range(m+1):
        if j==m:
            print((sd[:i]+t+sd[i+m:]).replace("?","a"))
        if t_kamo[j]=="?":
            continue
        elif t_kamo[j]!=t[j]:
            break
print("UNRESTORABLE")

Buggy submission (verdict: Runtime Error):
sd=input()
t=input()

n=len(sd)
m=len(t)
s=[]

for i in range(n-m,-1,-1):
    t_kamo=sd[i:i+m]
    for j in range(m+1):
        if j==m:
            print((sd[:i]+t+sd[i+m:]).replace("?","a"))
        if k_kamo[j]=="?":
            continue
        elif k_kamo[j]!=t[j]:
            break
print("UNRESTORABLE")
Problem p03610 (python)

Fixed submission:
S=input()
print(S[::2])

Buggy submission (verdict: Runtime Error):
S=list(map(str,input().split()))
print(join(S[::2]))
Problem p03636 (python)

Fixed submission:
s=input()
l=len(s)
print(s[0]+str(l-2)+s[-1])

Buggy submission (verdict: Runtime Error):
s=str(input())
a=len(s)
b=len(s[1:len[s]])
print(s[0]+'b'+s[-1])

Buggy submission (verdict: Runtime Error):
s=str(input())
a=len(s)
b=len(s[1:len[s]])
print(s[0]+'a'+s[-1])

Buggy submission (verdict: Runtime Error):
s=str(input())
a=len(s)
b=len(s[1:len[s])
print(s[0]+'a'+s[-1])
Problem p03644 (python)

Fixed submission:
N=int(input())
print(2**(len(bin(N))-3))

Buggy submission (verdict: Runtime Error):
N=int(input())
print(2**len(bin(N)-3))

Buggy submission (verdict: Runtime Error):
N=int(input())
while i<N+1:
    count(i)=o
    if i%2==0:
        count(i)+=1
    else:
        break
if count(a)=max(count(i)):
    print(a)
Problem p03658 (python)

Fixed submission:
N,K=map(int,input().split())
li=list(map(int,input().split()))
li_sort=sorted(li,reverse=True)
print(sum(li_sort[:K]))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
li=[map(int,input().split())]
li_sort=sorted(li,reverse=True)
print(sum(li_sort[::K]))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
li=[map(int,input().split())]
li_sort=sorted(li,reverse=True)
print(sum(li_sort[:K]))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
li=[int(input())]
li_sort=sorted(li,reverse=True)
print(sum(li_sort[:K]))
Problem p03720 (python)

Fixed submission:
n,m=map(int,input().split())
li=[]
for i in range(m):
    a,b=map(int,input().split())
    li.append(a)
    li.append(b)

for j in range(1,n+1):
    print(li.count(j))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split() for i in range(n)))
for i in range(1,n+1):
    print(a.count(i))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
print(a.count(i) for i in range (1,n+1), sep='\n')
Problem p03760 (python)

Fixed submission:
o=input()
p=input()
n=[]
for i in range(len(o)):
    n.append(o[i])
    if i <=len(p)-1:
        n.append(p[i])
print(''.join(n))

Buggy submission (verdict: Runtime Error):
o=input()
p=input()
print(''.join(i+j for i,j in zip (o,p))

Buggy submission (verdict: Runtime Error):
o=input()
p=input()
print(''.join(i+j in zip (o,p))
Problem p03777 (python)

Fixed submission:
a,b=input().split()
if a=='H' and b=='H':
    print('H')
elif a=='H' and b=='D':
    print('D')
elif a=='D' and b=='H':
    print('D')
else:
    print('H')

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if a='H' and b='H':
    print('H')
elif a='H' and b='D':
    print('D')
elif a='D' and b='H':
    print('D')
else:
    print('H')
Problem p04011 (python)

Fixed submission:
n=int(input())
k=int(input())
x=int(input())
y=int(input())
if n>k:
    print(x*k+y*(n-k))
else:
    print(x*n)

Buggy submission (verdict: Runtime Error):
n,k,x,y=map(int,input().split() for i in range(4)]
if n>k:
    print(x*k+y*(n-k))
else:
    print(x*k)
Problem p04044 (python)

Fixed submission:
N,L=map(int,input().split())
S=list(input() for i in range(N))
S_sort=sorted(S)
print(''.join(S_sort))

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[input() for i in range(N)]
print(''.join(S.sort()))

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[input() for i in range(N)]
print(''.join(S.sort))
Problem p03061 (python)

Fixed submission:
import fractions
import copy
n = int(input())
a = list(map(int, input().split()))
a_r = copy.copy(a)
a_r.reverse()
cumsum_gcd = [0]
cumsum_gcd_r = [0]
for i in range(n-1):
    cumsum_gcd.append(fractions.gcd(cumsum_gcd[i], a[i]))
    cumsum_gcd_r.append(fractions.gcd(cumsum_gcd_r[i], a_r[i]))
cumsum_gcd_r.reverse()
ans = []
for i in range(n):
    ans.append(fractions.gcd(cumsum_gcd[i], cumsum_gcd_r[i]))
print(max(ans))

Buggy submission (verdict: Runtime Error):
import fractions
import copy
n = int(input())
a = list(map(int, input().split()))
a_r = copy.copy(a)
a_r.reverse()
cumsum_gcd = [0]
cumsum_gcd_r = [0]
for i in range(n-1):
    cumsum_gcd.append(fractions.gcd(cumsum_gcd[i], a[i]))
    cumsum_gcd_r.append(fractions.gcd(cumsum_gcd_r[i], a_r[i]))
cumsum_gcd_r.reverse()
print(cumsum_gcd, cumsum_gcd_r)
ans = []
for i in range(n):
    ans.append(fractions.gcd(cumsum_gcd[i], cumsum_gcd_r[i]))
print(max(ans)
Problem p03206 (python)

Fixed submission:
ChrismasDay = 25
text = "Christmas"
D = int(input())
D = 25 - D
for i in range(D):
    text = text + " Eve"
print(text)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [input() for i in range(n)]
max_value = p.index(max(p))
p[max_value] = int(p[max_value]) / 2
sum = 0
for i in range(len(p)):
    sum += int(p[i])
print(sum)
Problem p03262 (python)

Fixed submission:
from fractions import gcd
n, x = map(int,input().split())
xi = list(map(int,input().split()))

for i, n in enumerate(xi):
    xi[i] = abs(xi[i]-x)
ans = xi[0]
for i in range(len(xi)):
    ans = gcd(ans, xi[i])
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n, x = map(int,input().split())
xi = list(map(int,input().split()))

for i, n in enumerate(xi):
    xi[i] = abs(xi[i]-x)

if len(xi)==1:
    print(xi[0])
    exit()
    
xi.sort()
print(math.gcd(xi[0], xi[1]))

Buggy submission (verdict: Runtime Error):
n, x = map(int,input().split())
xi = list(map(int,input().split()))

for i, n in enumerate(xi):
    xi[i] = abs(xi[i]-x)

while 1:
    out = min(xi)
    for i, n in enumerate(xi):
        if n%out!=0:
            for j in range(2,out+1):
                if out%j==0:
                    out = out / j
            continue
    print(int(out))
    exit()
Problem p03059 (python)

Fixed submission:
A, B, T = map(int, input().split())
reward=0
time=0

for t in range(T):
    time += 1
    if time%A == 0:
        reward = reward + B
        
print(reward)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
T=int(input())
reward=0
time=0

for t in range(T):
    time += 1
    if time%A == 0:
        reward = reward + B
        
print(reward)

Buggy submission (verdict: Runtime Error):
aaa
Problem p03061 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 29 20:51:40 2019

@author: makigon
"""

import fractions
from functools import reduce
 
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
 
N = int(input())
a = list(map(int,input().split()))
ans = 0

t_left = [0 for i in range(N)]
t_right = [0 for i in range(N)]

t_left[0] = a[0]
t_left[1] = fractions.gcd(a[0],a[1])

for i in range(2,N):
    t_left[i] = fractions.gcd(t_left[i-1],a[i])

t_right[N-1] = a[N-1]
t_right[N-2] = fractions.gcd(a[N-1],a[N-2])

for j in range(N-3,0,-1):
    t_right[j] = fractions.gcd(t_right[j+1],a[j])
    

for i in range(0,N-2):
    tmp = fractions.gcd(t_left[i],t_right[i+2])
    if tmp > ans:
        ans = tmp
    
print(max(ans,t_right[1],t_left[N-2]))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
from fractions import gcd

def gcd(*numbers):
    return reduce(gcd, numbers)

def gcd_list(numbers):
    return reduce(gcd, numbers)

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

ans = 0

for i in range(N):
    a = A.pop(0)
    p = gcd_list(A)
    if p > ans:
        ans = p
    A.append(a)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

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

ans = 0

for i in range(N):
    a = A.pop(0)
    p = gcd_list(A)
    if p > ans:
        ans = p
    A.append(a)
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 27 20:55:53 2019

@author: makigon
"""
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

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

ans = 0

for i in range(N):
    a = A.pop(0)
    p = gcd_list(A)
    if p > ans:
        ans = p
    A.append(a)
print(ans)
Problem p03102 (python)

Fixed submission:
import numpy as np

N, M, C = map(int, input().split())
B = list(map(int, input().split())) 
A = np.zeros((N,M))



for i,_ in enumerate(A):
    A[i:] = list(map(int, input().split())) 

cnt = 0
z = 0
for A_line in A:
    for i,a in enumerate(A_line):
        z = z + a*B[i]
    if z+C >0:
        cnt += 1
    z = 0

print(cnt)

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

N, M, C = map(int, input().split())
B = list(map(int, input().split())) 
A = np.zeros((N,M))

A[0:] = list(map(int, input().split())) 
A[1:] = list(map(int, input().split())) 

cnt = 0
z = 0
for A_line in A:
    for i,a in enumerate(A_line):
        z = z + a*B[i]
    if z+C >0:
        cnt += 1
    z = 0

print(cnt)