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

Fixed submission:
import sys
N=int(sys.stdin.readline())
H=list(map(int,sys.stdin.readline().split()))

dp=[0]*N

dp[1]=abs(H[0]-H[1])
for i in range(2,N):
    dp[i]=min(dp[i-1]+abs(H[i-1]-H[i]),dp[i-2]+abs(H[i-2]-H[i]))
print(dp[-1])

Buggy submission (verdict: Runtime Error):
import sys
N=int(sys.stdin.readline())
H=list(map(int,sys.stdin.readline().split()))
dp[1]=abs(H[0]-H[1])
for i in range(2,N):
    dp[i]=min(dp[i-1]+abs(H[i-1]-H[i]),dp[i-2]+abs(H[i-2]-H[i]))
print(dp[-1])

Buggy submission (verdict: Runtime Error):
import sys
N=int(sys.stdin.readline())
H=list(map(int,sys.stdin.readline().split()))

dp=[0]*N
def rec(i):
    if i==N-1:
        return 0
    elif i==N-2:
        return abs(H[i]-H[i+1])
    return min(rec(i+1)+abs(H[i]-H[i+1]),rec(i+2)+abs(H[i]-H[i+2]))
print(rec(0))
Problem p03162 (python)

Fixed submission:
import numpy as np
import sys
def solve():
    N=int(sys.stdin.readline())
    dp=np.zeros((3,N)).astype('int64')
    for i in range(N):
        a,b,c=list(map(int,sys.stdin.readline().split()))
        if i:
            dp[0,i]=max(dp[1,i-1]+a,dp[2,i-1]+a)
            dp[1,i]=max(dp[0,i-1]+b,dp[2,i-1]+b)
            dp[2,i]=max(dp[1,i-1]+c,dp[0,i-1]+c)
        else:
            dp[0,i]=a
            dp[1,i]=b
            dp[2,i]=c

    return np.max(dp[:,N-1])
    
if __name__ == '__main__':
    print(solve())

Buggy submission (verdict: Runtime Error):
import numpy as np
import sys
def solve():
    N=int(sys.stdin.readline())
    dp=np.zeros((3,N)).astype('int64')
    for i in range(N):
        a,b,c=list(map(int,sys.stdin.readline().split()))
        if i:
            dp[0,i]=max(dp[1,i-1]+a,dp[2,i-1]+a)
            dp[1,i]=max(dp[0,i-1]+b,dp[2,i-1]+b)
            dp[2,i]=max(dp[1,i-1]+c,dp[0,i-1]+c)
        else:
            dp[0,i]=a
            dp[1,i]=b
            dp[2,i]=c

    return np.max(dp[:,N-1])
    
if __name__ == '__main__':
    print(solve())
Problem p03227 (python)

Fixed submission:
I=input()
if len(I)==2:
    print(I)
else:
    print(I[2]+I[1]+I[0])

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

def diff(L):
    total=0
    for i in range(len(L)-1):
        total+=abs(L[i+1]-L[i])
    return total
for i in range(N):
    A=input()
    L.append(int(A))
L.sort()
if len(L)>3:
    length=len(L)
    SL=L[:int(length/2)]
    LL=L[int(length/2):]
    result=[]
    result.append(SL[-1])
    SL.pop(-1)
    last=LL[0]
    LL.pop(0)
    while True:
        try:
            result.append(LL[-1])
            LL.pop(-1)
            result.append(SL[0])
            SL.pop(0)
        except:
            break

    result.append(last)
    print(diff(result))    
elif len(L)==3:
    all=[diff([L[0],L[1],L[2]]),diff([L[0],L[2],L[1]]),diff([L[1],L[0],L[2]]),diff([L[1],L[2],L[0]]),diff([L[2],L[0],L[1]]),diff([L[2],L[1],L[0]])]
    print(max(all))
elif len(L)==2:
    print(abs(L[0]-L[1]))
Problem p03238 (python)

Fixed submission:
I=input()
if I=='1':
 print('Hello World')
else:
  A=input()
  B=input()
  print(int(A)+int(B))

Buggy submission (verdict: Runtime Error):
I=input()
if I==1:
 print('hello world')
else:
  A=input()
  B=input()
  print(int(A)+int(B))

Buggy submission (verdict: Runtime Error):
I=input()
if I==1:
 print('hello world')
else:
  A=Input()
  B=Input()
  print(A+B)
Problem p03239 (python)

Fixed submission:
N,T=input().split()
min=1001
for i in range(int(N)):
  cost,time=input().split()
  if int(time)<=int(T) and int(cost)<min:
    min=int(cost)
if min==1001:
  print('TLE')
else:
  print(min)

Buggy submission (verdict: Runtime Error):
N,T=input().split()
min=1001
for i in range(N):
  cost,time=input().split()
  if time<=T and cost<min:
    min=cost
if min==1001:
  print('TLE')
else:
  print(min)
Problem p04047 (python)

Fixed submission:
n=int(input())
arr=list(map(int,input().split()))
arr.sort()
s=0
for i in range(0,(2*n)-1,2):
  s+=arr[i]
print(s)

Buggy submission (verdict: Runtime Error):
n=int(input())
arr=list(map(int,input().split()))
arr=arr.sort()
s=0
for i in range(0,(2*n)-1,2):
  s+=arr[i]
print(s)
Problem p02534 (python)

Fixed submission:
k = int(input())
print(k*'ACL')

Buggy submission (verdict: Runtime Error):
K = input()
print(K*ACL)
Problem p02921 (python)

Fixed submission:
s = input()
t = input()
count=0
for i in range(3):
    if s[i]==t[i]:
        count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
s,t=map(str,input().split())
count=0
for i in range(3):
    if s[i]==t[i]:
        count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
s,t=input().split()
count=0
for i in range(3):
    if s[i]==t[i]:
        count=count+1
print(count)
Problem p02922 (python)

Fixed submission:
a,b = map(int,input().split())
sum = 1
if ((b > 1) and (b < a)):
    print(1)
elif b == 1:
    print(0)
else:
    b = b - a
    while 0 < b:
        b = b - (a-1)
        sum=sum+1
    print(sum)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = b % a
if (b > 1) && (b < a):
    print(1)
elif b == 1:
    print(0)
else:
    print(c + 1)
Problem p02646 (python)

Fixed submission:
A = list(map(int, input().split()))
B = list(map(int, input().split()))
T = int(input())
x=abs(A[0]-B[0])
v=A[1]-B[1]

if v*T>=x:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split()))
B = list(map(int, input().split()))
T = list(map(int, input().split()))
abs(A[0]-B[0])/abs(T[0]*(A[1]-B[1]))

if (B[1]-A[1])>=0:
    print('NO')
elif abs(A[0]-B[0])<abs(T[0]*(A[1]-B[1])):
    print('YES')
else:
    print('NO')
Problem p02657 (python)

Fixed submission:
a, b = map(int, input(). split())
print(a*b)

Buggy submission (verdict: Runtime Error):
num1 = int(input())
num2 = int(input())
seki = num1 * num2
print(seki)
Problem p02534 (python)

Fixed submission:
K = int(input())
s = ""
for i in range(K):
  s += "ACL"
print(s)

Buggy submission (verdict: Runtime Error):
K = int(input())
s = "
for i in range(K):
  s += "ACL"
print(s)
Problem p02553 (python)

Fixed submission:
a, b, c, d = [int(i) for i in input().split()]
print(max([a * d, a * c, b * c, b * d]))

Buggy submission (verdict: Runtime Error):
a, b, c, d = [int(i) for i in input()]
print(max([a * d, a * c, b * c, b * d]))
Problem p02582 (python)

Fixed submission:
S = input()
counts = [0]
if "R" in S:
  counts.append(1)
if "RR" in S:
  counts.append(2)
if "RRR" in S:
  counts.append(3)
print(max(counts))

Buggy submission (verdict: Runtime Error):
S = input()
counts = [0]
if "R" in S:
  counts.appned(1)
if "RR" in S:
  counts.append(2)
if "RRR" in S:
  counts.append(3)
print(max(counts))
Problem p02812 (python)

Fixed submission:
s = input()
s = input()
print(s.count("ABC"))

Buggy submission (verdict: Runtime Error):
s = input().split()[1]
print(s.count("ABC"))

Buggy submission (verdict: Runtime Error):
s = input().split()[1]
s.count("ABC")
Problem p02713 (python)

Fixed submission:
from math import gcd

def gcdx(x,y,z):
    return gcd(gcd(x,y),z)
n = int(input())
a = 0
longp = []

for i in range(1,n+1):
    for j in range(1,n+1):
        for p in range(1,n+1):
            a += gcdx(i,j,p)
           
print(a)

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
    @lru_cache(maxsize = None)
from math import gcd

def gcdx(x,y,z):
    return gcd(gcd(x,y),z)
n = int(input())
a = 0
longp = []

for i in range(1,n+1):
    for j in range(1,n+1):
        for p in range(1,n+1):
            a += gcdx(i,j,p)
           
print(a)
Problem p02789 (python)

Fixed submission:
arr=list(map(int,input().split()))
n=arr[0]
m=arr[1]
if n==m:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
arr=list(map(int,input().split())
n=arr[0]
m=arr[1]
if n==m:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
m=int(input())
if n==m:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(intpu())
m=int(input())
if n==m:
  print("Yes")
else:
  print("No")
Problem p02677 (python)

Fixed submission:
import math

a, b, h, m = map(int, input().split())

#c = (h/6 - m/360)*math.pi
c = 11.0/360.0*(60*h+m)*math.pi
x = math.sqrt(a * a + b * b - 2 * a * b * math.cos(c))
print(x)

#double c = (h/6 - m/360)*pi;
#x = sqrt(a * a + b * b - 2 * a * b * cos(c));
#cout << fixed << setprecision(15) << x << endl;

Buggy submission (verdict: Runtime Error):
import math

a, b, h, m = map(int, input().split())

#c = (h/6 - m/360)*math.pi
c = 11.0/360.0*(60*h+m)*pi
x = math.sqrt(a * a + b * b - 2 * a * b * math.cos(c))
print(x)

#double c = (h/6 - m/360)*pi;
#x = sqrt(a * a + b * b - 2 * a * b * cos(c));
#cout << fixed << setprecision(15) << x << endl;
Problem p02536 (python)

Fixed submission:
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
        
a = input().split()
N = int(a[0])
M = int(a[1])
tm = int(0)
tmp = int(0)


k = [input().split() for i in range(M)]

uf = UnionFind(N+1)

for i in range(M):
    tm = int(k[i][0])
    tmp = int(k[i][1])
    uf.union(tm, tmp)
    tm = 0
    tmp = 0

print(int(uf.group_count()) - 2)

Buggy submission (verdict: Runtime Error):
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
        
a = input().split()
N = int(a[0])
M = int(a[1])
tm = int(0)
tmp = int(0)


k = [input().split() for i in range(M)]

uf = UnionFind(N)

for i in range(M):
    tm = int(k[i][0])
    tmp = int(k[i][1])
    uf.union(tm, tmp)
    tm = 0
    tmp = 0

print(int(uf.group_count()) - 1)
Problem p02657 (python)

Fixed submission:
a = input().split()
print(int(a[0]) * int(a[1]))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a * b)
Problem p02909 (python)

Fixed submission:
a = input()
if a == "Sunny":
  print("Cloudy")
elif a == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
a = input()
if a = "Sunny":
  print("Cloudy")
elif a = "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Buggy submission (verdict: Runtime Error):
a = input()
if a = "Sunny":
  print("Cloudy")
elif a = "Cloudy":
  print("Rainy")
else:
  print("Sunny")
Problem p02910 (python)

Fixed submission:
# coding: utf-8
# Your code here!
a = input()
n = int(len(a))
amari = int(n) % 2
flag = str()
if n == 1:
    if a == "L":
        print("No")
        flag = "unko"
    else:
        pass
elif amari == 0:
    for i in range (1, (int(n) // 2)+1):
        if a[int(i) * 2 - 2] == "L":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

elif amari == 1:
    for i in range (1, (int(n) // 2)+1):
        if a[int(i) * 2 - 2] == "L":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass
    if a[int(n) - 1] == "L" and flag == "":
        print("No")
        flag = "unko"
else:
    pass

if flag == "":
    print("Yes")

Buggy submission (verdict: Runtime Error):
elif amari == 0:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

elif amari == 1:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass       
    if a[int(n) - 1] == "S" and flag == "":
        print("No")
        flag = "unko"
else:
    pass

if flag == "":
    print("Yes")

Buggy submission (verdict: Runtime Error):
a = input()
n = int(len(a))
amari = int(n) % 2
flag = str()
if n == 1:
    if a = "S":
        print("No")
        flag = "unko"
    else:
        pass

elif amari == 0:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

elif amari == 1:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass       
    if a[int(n) - 1] == "S" and flag == "":
        print("No")
        flag = "unko"
else:
    pass

if flag == "":
    print("Yes")
Problem p03474 (python)

Fixed submission:
a = input().split()
b = input()
c = int(0)

for i in range(int(a[0])):
  if b[i] == "-":
    c = 1
  else:
    pass

if b[int(a[0])] != "-":
  c = 1

for i in range(int(a[0]) + 1, int(a[0]) + int(a[1]) + 1):
  if b[i] == "-":
    c = 1
  else:
    pass

if c == 1:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a = input().split()
b = input()
c = int(0)

for i in range(int(a[0])):
  if int(b[i]) <= 9 and int(b[i]) >= 0:
    pass
  else:
    c = 1

if b[int(a[0])] != "-":
  c = 1

for i in range(int(a[0]) + 1, int(a[0]) + int(a[1]) + 1):
  if int(b[i]) <= 9 and int(b[i]) >= 0:
    pass
  else:
    c = 1

if c == 1:
  print("No")
else:
  print("Yes")
Problem p02534 (python)

Fixed submission:
k = int(input())
a = "ACL"
print(a * k)

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int,input().split())
print('Yes' if a <= b <= c <= d else 'No')

Buggy submission (verdict: Runtime Error):
k = int(input)
a = 'ACL'
print(a ** k)

Buggy submission (verdict: Runtime Error):
k = int(input))
a = 'ACL'
print(a ** k)
Problem p02639 (python)

Fixed submission:
x = list(map(int,input().split()))
print(x.index(0) + 1)

Buggy submission (verdict: Runtime Error):
x = list[map(int,input().split())]
print(x.index(0) + 1)
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):
a, b = int(input())
print('Even' if a*b % 2 == 0 else 'Odd')
Problem p03493 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
print(s.count(1))
Problem p03636 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
print(s[0]+str(lent(s)-2)+s[-1])

Buggy submission (verdict: Runtime Error):
s = input()
print(s[0]+s.str(lent(s)-2)+s[-1])

Buggy submission (verdict: Runtime Error):
print(s[0]+s.count(s-2)+s[-1])

Buggy submission (verdict: Runtime Error):
s = input()
print(s[0]+count(s-2)+s[-1])
Problem p02639 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a,b,c,d,e = map(int, input().split())
if a == 0:
  print (1)
elif b == 0:
  print (2)
elif c == 0:
  print (3)
elif d == 0:
  print (4)
else:
  print (5)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
 
def is_prime(n):
    if n == 1: return False
 
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
 
    return True
  
N= int(input())
A = input().split()
ANS = 0
for i in range(N):
  C = A[i]
  if A.count(C) == 1:
    if is_prime(i) == True:
      ANS += 1
print(ANS)
Problem p02645 (python)

Fixed submission:
# -*- coding: utf-8 -*-
s = input()
# 出力
print(s[0:3])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
N, K = map(int, input().split())
A = input().split()
AK = [[0 for j in range(N)] for i in range(2)]
for l in range(N):
  AK[0][l] = int(AK[0][l]) + int(A[l])
p = min(K,50)
for m in range(1,p+1,1):
  for o in range(N):
    if AK[0][o] == N:
      AK[1] = AK[1]+1
    else:
      for x in range(N):
        if((o-AK[0][o]+0.5) < (x+1)) and ((x+1) < (o+AK[0][o]+1.5)):
          AK[1][x] = AK[1][x] +1
  AK[0] = AK[1]
  AK[1] = [0] * N
print(*AK[0])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
N, K = map(int, input().split())
A = input().split()
AK = [[0 for j in range(N)] for i in range(2)]
for l in range(N):
  AK[0][l] = int(AK[0][l]) + int(A[l])
p = min(K,40)
for m in range(1,p+1,1):
  for o in range(N):
    for x in range(N):
      if((o-AK[0][o]+0.5) < (x+1)) and ((x+1) < (o+AK[0][o]+1.5)):
        AK[1][x] = AK[1][x] +1
  AK[0] = AK[1]
  AK[1] = [0] * N
print(*AK[0])
Problem p02628 (python)

Fixed submission:
n,k = map(int,input().split())
 
s = input().rstrip().split(' ')
st = []
 
for i in range(0,n):
  a = int(s[i]) 
  st.append(a)
 
new_st = sorted(st)
sum = 0
for j in range(0,k):
  sum += new_st[j]
  
print(sum)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split)
 
s = input().rstrip().split(' ')
st = []
 
for i in range(0,n):
  a = int(s[i]) 
  st.append(a)

new_st = sorted(st)
sum = 0
for j in range(0,k):
  sum += new_st[j]
  
print(sum)

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

s = input().rstrip().split(' ')
a = int(s[0]) 
sorted = []
sorted.append(a)

for i in range(1,n):
  a = int(s[i]) 
  sorted.append(a)
  
  main = i
  sub = i-1
  while main = 0:
    if(sorted[sub] > sorted[main]):
      stock = sorted[sub]
      sorted[sub] = sorted[main]
      sorted[main] = stock
    else:
      break
     
    main -= 1
    sub -= 1

sum = 0
for j in range(0,k):
  sum += sorted[j]
  
print(sum)
Problem p02630 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
q = int(input())
sums = sum(a)
d = {}

for i in a:
  if i in d:
    d[i] += 1
  else:
    d[i] = 1

for i in range(q):
    b,c = map(int, input().split())
    if b in d:
        sums += d[b]*(c-b)
        if c in d:
          d[c] += d[b]
        else:
          d[c] = d[b]
        d[b] = 0
    print(sums)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
sums = sum(a)
d = {}

for i in a:
  if i in d:
    d[i] += 1
  else:
    d[i] = 1

for i in range(q):
    b,c = map(int, input().split())
    if b in d:
        sums += d[b]*(c-b)
        if c in d:
          d[c] += d[b]
        else:
          d[c] = d[b]
  		d[b] = 0
    print(sums)

Buggy submission (verdict: Runtime Error):
d = {}

for i in a:
  if i in d:
    d[i] += 1
  else:
    d[i] = 1

for i in range(q):
    b,c = map(int, input().split())
    if b in d:
        sums += d[b]*(c-b)
        if c in d:
          d[c] += d[b]
        else:
          d[c] = d[b]
  
    print(sums)
Problem p02683 (python)

Fixed submission:
n,m,x = map(int, input().split())
c_a = []
for i in range(n):
      c_a.append(list(map(int, input().split())))

min_sum_answer = -1
for i in range(2**n):
      min_sum = 0
      get_score = []
      for v in range(m):
         get_score.append(0)   
      for j in range(n):
            if (i >> j) & 1 ==1:
                  min_sum += c_a[j][0]
                  for l in range(m):
                        get_score[l] += c_a[j][l+1]
     
      #print(i)
      #print(min_sum)
      pre = 0 
      for s in range(m):
            if(get_score[s] < x):
                  pre = 1
                  break
      
      if pre == 0:
            if min_sum_answer == -1:
                  min_sum_answer = min_sum 
            elif min_sum_answer > min_sum:
                  min_sum_answer = min_sum 

if min_sum_answer == 0:
      print(-1)
else:
      print(min_sum_answer)

Buggy submission (verdict: Runtime Error):
n,m,x = map(int, input().split())
c_a = []
for i in range(n):
      c_a.append(list(map(int, input().split())))

min_sum_answer = 0
for i in range(n**2):
      min_sum = 0
      get_score = []
      for m in range(m):
         get_score.append(0)   
      for j in range(n):
            if i >> j % 2 ==1:
                  mun_sum += c_a[j][0]
                  for l in range(m):
                        get_score[l] += c_a[j][l+1]
           
      pre = 0 
      for s in range(m):
            if(get_score[s} < x):
                  pre = 1
                  break
      
      if pre == 0:
            if min_sum_answer == 0:
                  min_sum_answer = min_sum 
            elif min_sum_answer > min_sum:
                  min_sum_answer = min_sum 

if min_sum_answer == 0:
      print(-1)
else:
      print(min_sum_answer)
Problem p03284 (python)

Fixed submission:
N, K = map(int,input().split())
if N%K == 0:
    print("0")
else:
    print("1")

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
if N%K == 0:
    print("0")
else:
    print("1")