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

Fixed submission:
H,W = [int(x) for x in input().split()]
li = []
op = []
def get_wh(index):
    h = index//W
    if(h%2==0):
        w = index%W +1
    else:
        w = W - index%W
    return h+1,w

for i in range(H):
    if(i%2 == 0):
        li+=[int(x)%2 for x in input().split()]
    else:
        li+=[int(x)%2 for x in input().split()][::-1]

for index in range(len(li[:-1])):
    if(li[index]==1):
        li[index]=0
        li[index+1]=1-li[index+1]
        op.append(get_wh(index)+get_wh(index+1))

print(len(op))
for i in op:
    print(i[0],i[1],i[2],i[3])

Buggy submission (verdict: Runtime Error):
H,W = [int(x) for x in input().split()]
li = []
op = []
def get_wh(index):
    h = index//W
    if(h%2==0):
        w = index%W +1
    else:
        w = W - index%W
    return h+1,w

for i in range(H):
    if(i%2 == 0):
        li+=[int(x)%2 for x in input().split()]
    else:
        li+=[int(x)%2 for x in input().split()][::-1]

for index,i in enumerate(li):
    if(i==1):
        li[index]-=1
        li[index+1]=1-li[index+1]
        op.append(get_wh(index)+get_wh(index+1))

print(len(op))
for i in op:
    print(i[0],i[1],i[2],i[3])
Problem p03282 (python)

Fixed submission:
S = input()
K = int(input())
if(S[0]!='1'):
  print(S[0])
else:
  i=0
  while(S[i]=='1'):
    i += 1
    if(i==len(S)):
      break
  if(K<=i):
    print('1')
  else:
    print(S[i])

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
if(S[0]!='1'):
  print(S[0])
else:
  i=0
  while(S[i]=='1'):
    i += 1
  if(K<=i):
    print('1')
  else:
    print(S[i])

Buggy submission (verdict: Runtime Error):
S = int(input())
K = int(input())
if(S[0]!='1'):
  print(S[0])
else:
  i=0
  while(S[i]=='1'):
    i += 1
  if(K<=i):
    print('1')
  else:
    print(S[i])
Problem p03316 (python)

Fixed submission:
N = input()
s = 0
for i in N:
  s+=int(i)
if(int(N)%s == 0):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = input()
s = 0
for i in N:
  s+=int(i)
if(N%s == 0):
  print('Yes')
else:
  print('No')
Problem p03338 (python)

Fixed submission:
N = int(input())
S = input()
max_cnt = 0
for i in range(N):
  li1 = [0]*26
  li2 = [0]*26
  cnt = 0
  for j in S[i:]:
    li1[ord(j)-97]+=1
  for j in S[:i]:
    li2[ord(j)-97]+=1
  for j in range(26):
    if(li1[j]>0 and li2[j]>0):
      cnt += 1
  max_cnt = max(max_cnt,cnt)
print(max_cnt)

Buggy submission (verdict: Runtime Error):

Copy
Copy

    N = int(input())
    S = input()
    max_cnt = 0
    for i in range(N):
      li1 = [0]*26
      li2 = [0]*26
      cnt = 0
      for j in S[i:]:
        li[ord(j)-97]+=1
      for j in S[:i]:
        li[ord(j)-97]+=1
      for j in range(26):
        if(li1[j]>0 and li2[j]>0):
          cnt += 1
      max_cnt = max(max_cnt,cnt)
    print(max_cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
max_cnt = 0
for i in range(101):
  li1 = [0]*26
  li2 = [0]*26
  cnt = 0
  for j in S[i:]:
    li[ord(j)-97]+=1
  for j in S[:i]:
    li[ord(j)-97]+=1
  for j in range(26):
    if(li1[j]>0 and li2[j]>0):
      cnt += 1
  max_cnt = max(max_cnt,cnt)
print(max_cnt)
Problem p03361 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)

H,W = [int(x) for x in input().split()]
S = [list('.'*(W+2))]+[list('.'+input()+'.') for _ in range(H)]+[list('.'*(W+2))]
lix = [-1,0,1,0]
liy = [0,-1,0,1]
flag = True
def dfs(x,y):
    cnt = 0
    if(S[x][y]=='.'):
        return 0
    else:
        cnt += 1
        S[x][y]='.'
        for i in range(4):
            if(S[x+lix[i]][y+liy[i]]!='.'):
                cnt += dfs(x+lix[i],y+liy[i])
        return cnt

for i in range(1,H+1):
    for j in range(1,W+1):
          if(dfs(i,j)==1):
              flag = False
if(flag):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
H,W = [int(x) for x in input().split()]
S = [list('.'*(W+2))]+[list('.'+input()+'.') for _ in range(H)]+[list('.'*(W+2))]
lix = [-1,0,1,0]
liy = [0,-1,0,1]
flag = True
def dfs(x,y):
    cnt = 0
    if(S[x][y]=='.'):
        return 0
    else:
        cnt += 1
        S[x][y]='.'
        for i in range(4):
            if(S[x+lix[i]][y+liy[i]]!='.'):
                cnt += dfs(x+lix[i],y+liy[i])
        return cnt

for i in range(1,H+1):
    for j in range(1,W+1):
          if(dfs(i,j)==1):
              flag = False
if(flag):
    print('Yes')
else:
    print('No')
Problem p03399 (python)

Fixed submission:
A,B,C,D = [int(input()) for _ in range(4)]
print(min(A,B)+min(C,D))

Buggy submission (verdict: Runtime Error):
A,B,C,D = [int(x) for x in input().split()]
print(min(A,B)+min(C,D))
Problem p03404 (python)

Fixed submission:
A,B = [int(x) for x in input().split()]
K = 50
h,w = 2*K,2*K
cntA = A-1
cntB = B-1
print(h,w)
for i in range(h):
    pr = ''
    if(i<K):
        for j in range(w):
            if(cntA>0):
                if((i%2==0 and j%2==0)):
                    pr += '.'
                    cntA -= 1
                else:
                    pr += '#'
            else:
                pr += '#'
    else:
        pr = ''
        for j in range(w):
            if(cntB>0 and i>K):
                if((i%2==0 and j%2==0)):
                    pr += '#'
                    cntB -= 1
                else:
                    pr += '.'
            else:
                pr += '.'
    print(pr)

Buggy submission (verdict: Runtime Error):
A,B = [int(x) for x in input().split()]
K = 50
h,w = 2*K,2*K
cntA = A-1
cntB = B-1
print(h,w)
for i in range(h):
    if(i<K):
        pr = ['#'*w]
        for j in range(w):
            if(cntA>0):
                if(i%2==0 and w%2==0):
                    pr[j] = '.'
                    cntA -= 1
                elif(i%2==1 and w%2==1):
                    pr[j] = '.'
                    cntA -= 1
    else:
        pr = ['.'*w]
        for j in range(w):
            if(cntB>0):
                if(i%2==0 and w%2==0):
                    pr[j] = '#'
                    cntA -= 1
                elif(i%2==1 and w%2==1):
                    pr[j] = '#'
                    cntA -= 1
    print(str(*pr))
Problem p03415 (python)

Fixed submission:
a = input()
b = input()
c = input()
print(a[0]+b[1]+c[2])

Buggy submission (verdict: Runtime Error):
a = [x for x in input().split()]
b = [x for x in input().split()]
c = [x for x in input().split()]
print(a[0]+b[1]+c[2])
Problem p03437 (python)

Fixed submission:
import fractions as math
X,Y = [int(x) for x in input().split()]
lcm = X*Y//math.gcd(X,Y)
if(lcm==X):
    print(-1)
else:
    print(X)

Buggy submission (verdict: Runtime Error):
import math
X,Y = [int(x) for x in input().split()]
lcm = X*Y//math.gcd(X,Y)
if(lcm==X):
    print(-1)
else:
    print(X)

Buggy submission (verdict: Runtime Error):
import math
X,Y = [int(x) for x in input().split()]
lcm = X*Y//math.gcd(X,Y)
if(lcm//X<=2):
    print(-1)
else:
    print(X*2)
Problem p03469 (python)

Fixed submission:
S = input()
s = ''
for index,i in enumerate(S):
  if(index == 3):
    s+='8'
  else:
  	s+=i
print(s)

Buggy submission (verdict: Runtime Error):
S = input()
S[3] = '8'
print(S)
Problem p03474 (python)

Fixed submission:
A,B = [int(x) for x in input().split()]
S = input()
flag = True
for ind,i in enumerate(S):
  if(ind!=A):
      if(ord(i)<48 or 57<ord(i)):
         flag = False
         break
  else:
      if(i!='-'):
         flag = False
         break
if(flag):
     print('Yes')
else:
     print('No')

Buggy submission (verdict: Runtime Error):
A,B = [int(x) for x in input().split()]
S = input()
flag = True
for ind,i in enumerate(S):
  if(ind!=A):
      if(ord(i)<48 or 57<ord(i):
         flag = False
         break
  else:
      if(i!='-'):
         flag = False
         break
if(flag):
         print('Yes')
else:
         print('No')
Problem p03583 (python)

Fixed submission:
N = int(input())
ans = []
n = 4/N
for i in range(1,3501):
    flag = True
    for j in range(1,3501):
        if(4*i*j-N*j-N*i==0):
            continue
        k = N*i*j/(4*i*j-N*j-N*i)
        if(int(k)==k and k>0):
            ans=[i,j,int(k)]
            flag = False
            break
    if(not flag):
        break
print(ans[0],ans[1],ans[2])

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = []
n = 4/N
for i in range(1,3501):
    flag = True
    for j in range(1,3501):
        if(n-1/i-1/j==0):
            continue
        k = 1/(n-1/i-1/j)
        if(int(k)==k and k>0):
            ans=[i,j,int(k)]
            flag = False
            break
    if(not flag):
        break
print(ans[0],ans[1],ans[2])

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = []
n = 4/N
for i in range(3501,0,-1):
    for j in range(3501,0,-1):
        if(n-1/i-1/j==0):
            continue
        k = 1/(n-1/i-1/j)
        if(int(k)==k and k>0):
            ans=[i,j,k]
            break
print(ans[0],ans[1],int(ans[2]))

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = []
n = 4/N
for i in range(N,0,-1):
    for j in range(N,0,-1):
        if(n-1/i-1/j==0):
            continue
        k = 1/(n-1/i-1/j)
        if(int(k)==k and k>0):
            ans=[i,j,k]
            break
print(ans[0],ans[1],int(ans[2]))
Problem p03599 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100000000)
A,B,C,D,E,F = [int(x) for x in input().split()]

x = []
y = []
ans_max = 0
ans = [0,0]

for i in range(F//(100*A)+1):
    for j in range((F-100*A*i)//(100*B)+1):
        water = 100*(A*i+B*j)
        if(water<=F and not water in x and water!=0):
            x.append(water)

ans[0]=x[0]

for i in range(F):
    for j in range(F):
        salt = C*i+D*j
        if(salt<=F and not salt in y):
            y.append(salt)

for i in x:
    for j in y:
        if(i==0):
            continue
        elif(100*j <= i*E and i+j <= F):
            percent = 100*j/(i+j)
            if(ans_max < percent):
                ans_max = percent
                ans = [i,j]

print(sum(ans),ans[1])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000000)
A,B,C,D,E,F = [int(x) for x in input().split()]

x = []
y = []
ans_max = 0
ans = []

for i in range(F//(100*A)+1):
    for j in range((F-100*A*i)//(100*B)+1):
        water = 100*(A*i+B*j)
        if(water<=F and not water in x):
            x.append(water)

for i in range(F):
    for j in range(F):
        salt = C*i+D*j
        if(salt<=F and not salt in y):
            y.append(salt)

for i in x:
    for j in y:
        if(i==0):
            continue
        elif(100*j <= i*E and i+j <= F):
            percent = 100*j/(i+j)
            if(ans_max < percent):
                ans_max = percent
                ans = [i,j]

print(sum(ans),ans[1])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1000000)
A,B,C,D,E,F = [int(x) for x in input().split()]

x = []
y = []
ans_max = 0
ans = []

for i in range(F//(100*A)+1):
    for j in range((F-100*A*i)//(100*B)+1):
        water = 100*(A*i+B*j)
        if(water<=F and not water in x):
            x.append(water)

for i in range(F):
    for j in range(F):
        salt = C*i+D*j
        if(salt<=F and not salt in y):
            y.append(salt)

for i in x:
    for j in y:
        if(i==0):
            break
        elif(100*j <= i*E and i+j <= F):
            percent = 100*j/(i+j)
            if(ans_max < percent):
                ans_max = percent
                ans = [i,j]

print(sum(ans),ans[1])

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = [int(x) for x in input().split()]
#%%
x = []
y = []
ans_max = 0
ans = []

for i in range(F//(100*A)+1):
    for j in range((F-100*A*i)//(100*B)+1):
        water = 100*(A*i+B*j)
        if(water<=F and not water in x):
            x.append(water)

for i in range(F):
    for j in range(F):
        salt = C*i+D*j
        if(salt<=F and not salt in y):
            y.append(salt)

for i in x:
    for j in y:
        if(i==0):
            break
        elif(100*j < i*E and i+j <= F):
            percent = 100*j/(i+j)
            if(ans_max < percent):
                ans_max = percent
                ans = [i,j]

print(sum(ans),ans[1])
Problem p03612 (python)

Fixed submission:
N = int(input())
p = [int(x) for x in input().split()]
cnt = 0
flag = True
for ind,i in enumerate(p):
    if(ind+1==i and flag):
        cnt+=1
        if(ind!=N-1):
            if(p[ind+1]==ind+2):
                flag = False
    else:
        flag = True
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
p = [int(x) for x in input().split()]
cnt = 0
flag = True
for ind,i in enumerate(p):
    if(ind+1==i and flag):
        cnt+=1
        if(p[ind+1]==ind+2):
            flag = False
    else:
        flag = True
print(cnt)
Problem p03644 (python)

Fixed submission:
N = int(input())
X = 1
while(N>=X):
  X = X<<1
print(X>>1)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = 1
while(N>=X):
  　X = X<<1
print(X>>1)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = 1
while(N>=X):
  　X<<1
print(X>>1)
Problem p03651 (python)

Fixed submission:
import fractions as math
from functools import reduce
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
N,K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
x = gcd_list(A)
if(K%x==0 and max(A)>=K):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
N,K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
x = gcd_list(A)
if(K%x==0 and max(A)>=K):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
N,K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
x = gcd_list(A)
if(K%x==0 and max(A)-min(A)>K):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
N,K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
x = gcd_list(A)
if(K%x==0 and max(A)-min(A)>K):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
Problem p03658 (python)

Fixed submission:
N,K = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
l.sort(reverse = True)
print(sum(l[:K]))

Buggy submission (verdict: Runtime Error):
N,K = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
l.sort(reversed = True)
print(sum(l[:K]))
Problem p03722 (python)

Fixed submission:
from operator import itemgetter

def BellmanFord(edges,num_v,source):
  #グラフの初期化
  inf=float('inf')
  dist=[inf for i in range(num_v)]
  dist[source-1]=0

  #辺の緩和
  for i in range(num_v+1):
    for edge in edges:
      if edge[0] != inf and dist[edge[1]-1] > dist[edge[0]-1] + edge[2]:
        dist[edge[1]-1] = dist[edge[0]-1] + edge[2]
        if i==num_v and edge[1]==num_v: return -1

  return dist


#%%
N,M = [int(x) for x in input().split()]
edges = []
for _ in range(M):
    l = [int(x) for x in input().split()]
    l[2]*=-1
    edges.append(l)
#%%
route = BellmanFord(edges,N,1)
if(route == -1):
    print('inf')
else:
    print(-int(route[N-1]))

Buggy submission (verdict: Runtime Error):
def BellmanFord(edges,num_v,source):
  #グラフの初期化
  inf=float("inf")
  dist=[inf for i in range(num_v)]
  dist[source-1]=0
  
  #辺の緩和
  for i in range(num_v):
    for edge in edges:
      if edge[0] != inf and dist[edge[1]-1] > dist[edge[0]-1] + edge[2]:
        dist[edge[1]-1] = dist[edge[0]-1] + edge[2]
        if i==num_v-1: return -1
  
  return dist


N,M = [int(x) for x in input().split()]
edges = []
for _ in range(N):
    l = [int(x) for x in input().split()]
    l[2]*=-1
    edges.append(l)

route = BellmanFord(edges,N,1)
if(route == -1):
    print('inf')
else:
    print(-route[-1])
Problem p03759 (python)

Fixed submission:
a,b,c = [int(x) for x in input().split()]
if(b-a == c-b):
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c = [int(x) for x in input().split()]
if(b-a = c-b):
  print('YES')
else:
  print('NO')
Problem p03844 (python)

Fixed submission:
A,op,B = [x for x in input().split()]
A = int(A)
B = int(B)
if(op == '+'):
  print(A+B)
else:
  print(A-B)

Buggy submission (verdict: Runtime Error):
A,op,B = [x for x in input().split()]
A = int(A)
B = int(B)
if(op = '+'):
  print(A+B)
else:
  print(A-B)
Problem p03848 (python)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
mod = 10**9+7
c = 1-N%2
flag = True
di = {}
if(N==1):
    if(A[0]==0):
        print(1)
    else:
        print(0)
else:
    for i in A:
        if(i not in di):
            di[i]=1
        else:
            di[i]+=1
    for i in range(N//2):
        if(i+c==0):
            if(0 not in di):
                flag = False
            else:
                flag &= (di[i]==1)
        else:
            if(i*2+c not in di):
                flag = False
            else:
                flag &= (di[i*2+c]==2)
        if(not flag):
            print(0)
            break
    else:
        print((2<<(N//2-1))%mod)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]
mod = 10**9+7
c = 1-N%2
flag = True
di = {}
if(N==1):
    if(A[0]==0):
        print(1)
    else:
        print(0)
else:
    for i in A:
        if(i not in di):
            di[i]=1
        else:
            di[i]+=1
    for i in range(N//2):
        if(i+c==0):
            flag &= (di[i]==1)
        else:
            flag &= (di[i*2+c]==2)
        if(not flag):
            print(0)
            break
    else:
        print((2<<(N//2-1))%mod)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]
mod = 10**9+7
c = 1-N%2
flag = True
di = {}
if(N==1):
    if(A[0]==0):
        print(1)
    else:
        print(0)
else:
    for i in A:
        if(i not in di):
            di[i]=1
        else:
            di[i]+=1
    for i in range(N//2):
        if(i+c==0):
            flag &= (di[i]==1)
        else:
            flag &= (di[i*2+c]==2)
        if(not flag):

            else:
                print(0)
            break
    else:
        print((2<<(N//2-1))%mod)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]
mod = 10**9+7
c = 1-N%2
flag = True
di = {}
for i in A:
    if(i not in di):
        di[i]=1
    else:
        di[i]+=1
for i in range(N//2):
    if(i+c==0):
        flag &= (di[i]==1)
    else:
        flag &= (di[i*2+c]==2)
    if(not flag):
        if(N==1):
            print(1)
        else:
            print(0)
        break
else:
    print((2<<(N//2-1))%mod)
Problem p03943 (python)

Fixed submission:
li = [int(x) for x in input().split()]
li.sort()
li.reverse()
if(li[0]==li[1]+li[2]):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
    li = [int(x) for x in input().split()]
    li.sort()
    li.reverse()
    if(li[0]==li[1]+li[2]):
      print('Yes')
    else:
      print('No')

Buggy submission (verdict: Runtime Error):
li = [int(x) for x in input().split()]
li.sort()
li.reversed()
if(li[0]==li[1]+li[2]):
  print('Yes')
else:
  print('No')
Problem p03994 (python)

Fixed submission:
s = input()
K = int(input())
ans = ''
for ind,i in enumerate(s):
    if(i=='a' and ind!=len(s)-1):
        ans+='a'
        continue
    d = 123-ord(i)
    if(ind==len(s)-1):
        K%=26
        if(K>=d):
            ans += chr(97+K-d)
            continue
        ans+=chr(ord(i)+K)
    elif(K>=d):
        K-=d
        ans+='a'
    else:
        ans+=i
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
K = int(input())
ans = ''
for ind,i in enumerate(s):
    if(i=='a' and ind!=len(s)-1):
        ans+='a'
        continue
    n = ord(i)
    d = 122-n
    if(ind==len(S)-1):
        K%=26
    if(K>d):
        K-=d+1
        ans+='a'
    elif(ind==len(s)-1):
        K%=26
        ans+=chr(ord(i)+K)
    else:
        ans+=i
print(ans)
Problem p02608 (python)

Fixed submission:
N=int(input())

a=[0]*10**4

for x in range(1,100):
     for y in range(1,100):
         for z in range(1,100):
             n=(x+y+z)**2-(x*y+y*z+z*x)
             if n<=10000:
                 a[n-1]+=1

for n in range(N):
    print(a[n])

Buggy submission (verdict: Runtime Error):
N=int(input())

a=[0]*10**4

for x in range(1,100):
     for y in range(1,100):
         for z in range(1,100):
             n=(x+y+z)**2-(x*y+y*z+z*x)
             if n<=10000:
                 a[n-1]+=1

for n in range(1,N+1):
    print(a[n])

Buggy submission (verdict: Runtime Error):
N=int(input())

a=[0]*10**4

for x in range(1,(N+1)):
     for y in range(1,(N+1)):
         for z in range(1,(N+1)):
             n=(x+y+z)**2-(x*y+y*z+z*x)
             a[n+1]+=1

for n in range(1,N+1):
    print(a[n])

Buggy submission (verdict: Runtime Error):
N=int(input())

a=[0]*10**4

for x in range(1,(N+1)):
     for y in range(1,(N+1)):
         for z in range(1,(N+1)):
             n=(x+y+z)**2-(x*y+y*z+z*x)
             a[n]+=1

for n in range(1+N+1):
    print(a[n])

Buggy submission (verdict: Runtime Error):
N=int(input())

a=[0]*10**4
count=0
for x in range(1,(N+1)):
     for y in range(1,(N+1)):
         for z in range(1,(N+1)):
             n=(x+y+z)**2-(x*y+y*z+z*x)
             a[n]+=1

for n in range(1+N+1):
    print(a[n])

Buggy submission (verdict: Runtime Error):
N=int(input())

a=[0]*10**4
count=0
for x in range(1,(N+1)):
     for y in range(1,(N+1)):
         for z in range(1,(N+1)):
             n=(x+y+z)**2-(x*y+y*z+z*x)
             a[n]+=1

for n in range(1+N+1):
    print(a[n])

Buggy submission (verdict: Runtime Error):
N=int(input())

for n in range(1,N+1):
    count=0
    for x in range(1,(n+1)/3):
        for y in range(1,(n+1)/3):
            for z in range(1,(n+1)/3):
                if (x+y+z)**2-(x*y+y*z+z*x)==n:
                    count=count+1
    print(count)
Problem p02780 (python)

Fixed submission:
import math

n,k = input().split()
p = input().split()

n = int(n)
k = int(k)
#p = [int(s) for s in p]

#print(p)

ex =0
ext = []
ext2 = []
for f in range(n):
    pi = int(p[f])
    xs =(pi+1)/2
    ext.append(xs)

ext2.append(ext[0])
for i in range(1,n):
    ext2.append(ext2[i-1]+ext[i])

ex = ext2[k-1]
for j in range(1,n-k+1):
    ext3 =ext2[j+k-1]-ext2[j-1]
    if ext3 > ex: ex = ext3

print('{:.12f}'.format(ex))

Buggy submission (verdict: Runtime Error):
s =0

print(n,a)

for f in range(n):
  
  for g in range(n):

    if g != f:
    	if a[f] == a[g]:
      		#print(a[f], a[g])
      		s = s+1
      
if s>0: print("NO")
else: print('YES')
Problem p04031 (python)

Fixed submission:
N = int(input())
an = list(map(int, input().split()))

cost = 10000*N
ans = 10000*N
for i in range(-100,100+1):
    cost = sum([(j - i)**2 for j in an])
    ans = min(ans, cost)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
an = list(map(int, input()))

cost = 10000*3
ans = 10000*3
for i in range(-100,100+1):
    cost = sum([(j - i)**2 for j in an])
    ans = min(ans, cost)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
an = list(map(int, input()))

cost = 10000
ans = 10000
for i in range(-100,100+1):
    cost = sum([(j - i)**2 for j in an])
    ans = min(ans, cost)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
an = list(map(int, input()))

cost = 10000
ans = 10000
for i in range(-100,100+1):
    cost = sum([(j - i)**2 for j in range(1, N+1)])
    ans = min(ans, cost)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
an = list(map(int, input()))

cost = 0
ans = 0
for i in range(-100,100+1):
    cost = sum([(j - i)**2 for j in range(1, N+1)])
    ans = min(ans, cost)

print(ans)