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

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
avg = round(sum(a)/N)
sums = []
for i in range(min(a), avg+1):
    s = 0
    for j in range(N):
        s += (i-a[j])**2
    sums.append(s)
print(min(sums))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
avg = round(sum(a)/N)
sums = []
for i in range(1, avg+1):
    s = 0
    for j in range(N):
        s += (i-a[j])**2
    sums.append(s)
print(min(sums))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
avg = round(sum(a)/N)
sums = []
for i in range(1, avg+1):
    s = 0
    for j in range(N):
        s += (i-a[j])**2
    sums.append(s)
print(min(sums))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
avg = round(sum(a)/len(a))
sums = []
for i in range(1, avg+1):
    s = 0
    for j in range(N):
        s += (a[j]-i)**2
    sums.append(s)
print(min(sums))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
avg = round(sum(a)/len(a))
sums = []
for i in range(1, avg+1):
    s = 0
    for j in range(N):
        s += (a[j]-avg)**2
    sums[i] = s
print(min(sums))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
a = list(map(int, input().split()))
avg = round(sum(a)/len(a))
sums = []
for i in range(1, avg+1):
    s = 0
    for j in range(N):
        s += (a[j]-avg)**2
    sums.append(s)
print(min(sums))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
a = list(map(int, input().split()))
avg = math.floor(sum(a)/len(a))
sums = []
for i in range(1, avg+1):
    sum = 0
    for j in range(N):
        sum += (a[j]-avg)**2
    sums.append(sum)
print(min(sums))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
a = list(map(int, input().split()))
avg = math.floor(sum(a)/len(a))
sums = []
for i in range(1, avg+1):
    sum = 0;
    for j in range(N):
        sum += (a[j]-avg)**2
    sums.append(sum)
print(min(sums))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
a = list(map(int, input().split()))2
avg = math.floor(sum(a)/len(a))
sums = []
for i in range(1, avg+1):
    sum = 0;
    for j in range(N):
        sum += (a[j]-avg)**2
    sums.append(sum)
print(min(sums))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
a = map(int, input().split())
avg = math.floor(sum(a)/len(a))
pattern = []
for i in range(1, avg+1):
    pattern[i] = []
    for j in range(N):
        pattern[i].append((a[j]-avg)**2)
    pattern[i] = sum(pattern[i])
print(min(pattern))
Problem p04029 (python)

Fixed submission:
N = int(input())
s = 0
i = 1
while i <= N:
  s = s + i
  i += 1
print(s)

Buggy submission (verdict: Runtime Error):
for i in N:
  x += 1
print(x)
Problem p04029 (python)

Fixed submission:
n = int(input())
a = 0
while n > 0:
    a += n
    n -= 1
print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
while n > 0:
    a += n
    n -= 1
print(a)

Buggy submission (verdict: Runtime Error):
n = map(int, input().split())
a = 0
while n > 0:
    a += n
    n -= 1
print(a)

Buggy submission (verdict: Runtime Error):
n = map(int, input().split())
while n > 0:
    a += n
    n -= 1
print(a)

Buggy submission (verdict: Runtime Error):
n = map(int, input().split())
a = 0
while n > 0:
    a += n
    n -= 1
print(a)

Buggy submission (verdict: Runtime Error):
n = map(int, input().split())
a = 0
while n < 0:
    a += n
    n -= 1
print(a)

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

while n < 0:
    a += n
    n -= 1
print(a)

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

while n == 0:
    a += n
    n -= 1
print(a)
Problem p04043 (python)

Fixed submission:
value = input()
if value.count("5") ==2:
  if value.count("7") ==1:
    print('YES')
  else:
    print('NO')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):

def haiku(a,b,c):
  if [a,b,c]==[5,5,7] or [a,b,c]==[5,7,5] or [a,b,c]==[7,5,5]:
      print('Yes')
  else:
      print('No')
      
  
A = int(input('1つ目の数を入力してください：'))
B = int(input('2つ目の数を入力してください：'))
C = int(input('3つ目の数を入力してください：'))

haiku(A,B,C)
Problem p04029 (python)

Fixed submission:
N = int(input())
output = 0

for i in range(N+1):
    output += i

print(output)

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

for i in range(N+1):
    output += i

print output
Problem p04043 (python)

Fixed submission:
a, b, c = map(int, input().split())
if sorted((a, b, c)) == [5, 5, 7]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
x = int(input("はじめ"))
y = int(input("中"))
z = int(input("終わり"))


if x >= 1 and x <= 10:
    if x == 5:
        if y == 5:
            if z == 7:
                print("YES")
            elif z == 5:
                print("NO")
                
        elif y == 7:
            if z == 5:
                print("YES")
            elif z == 7:
                print("NO")
                
    elif x == 7:
        if  y == 5:
            if z == 5:
                print("YES")
            elif z == 5:
                print("NO")
            else:
                print("NO")
        else:
            print("NO")
    else:
        print("NO")
else:
    print("NO")
Problem p04029 (python)

Fixed submission:
n = int(input())
sum = 0
for i in range(1,n+1):
  sum +=i
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
for i in range(1:n+1):
  sum +=i
print(sum)
Problem p04031 (python)

Fixed submission:
import math

n = int(input())
nums = list(map(int, input().split()))

avg_ceil = math.ceil(sum(nums) / len(nums))
avg_floor = math.floor(sum(nums) / len(nums))

cost_ceil = 0
cost_floor = 0

for x in nums:
    if x == avg_ceil:
        continue
    cost_ceil += (x - avg_ceil)**2

for x in nums:
    if x == avg_floor:
        continue
    cost_floor += (x - avg_floor)**2

if cost_ceil <= cost_floor:
    print(cost_ceil)
else:
    print(cost_floor)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
nums = list(map(int, input().split()))

avg_ceil = math.ceil(sum(nums) / len(nums))
avg_floor = math.floor(sum(nums) / len(nums))

cost_ceil = 0
cost_floor = 0

for x in nums:
    if x == avg_ceil:
        continue
    cost_ceil += (x - avg_ceil)**2

for x in nums:
    if x == avg_floor:
        continue
    cost_floor += (x - avg_floor)**2

if cost_ceil <= cost_floor:
    print(cost_ceil)
else
    print(cost_floor)
Problem p04031 (python)

Fixed submission:
n = int(input())
a_list = list(map(int, input().split()))

b = sum(a_list) // n
ans1 = sum([(a-b)**2 for a in a_list])

b += 1
ans2 = sum([(a-b)**2 for a in a_list])

print(min(ans1,ans2))

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

b = sum(a_list)//n

def temp(a):
  return (a-b)^2
def temp2(a):
  return (a-b-1)^2

ans1 = sum(list(map(temp, a)))
ans2 = sum(list(map(temp2, a)))
#ans1 = sum([(a-b)^2 for a in a_list])
#ans2 = sum([(a-b-1)^2 for a in a_list])

print(min(ans1,ans2))
Problem p04039 (python)

Fixed submission:
n, k = map(int, input().split())
Ds = list(map(int, input().split()))

for i in range(n, n*11):
  for d in Ds:
    if d in list(map(int, list(str(i)))):
      break
  else:
    print(i)
    exit(0)

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

for i in range(n, n*11):
  for d in Ds:
    if d in int(list(str(i))):
      break
  else:
    print(i)
    exit(0)
Problem p04045 (python)

Fixed submission:
total, k = map(int, input().split())
ds = list(input().split())

ans = total
while True:
  flag = False
  for d in ds:
    if d in list(str(ans)):
      flag = True
  if flag:
    ans += 1
  else:
    print(ans)
    exit(0)

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

for i in range(total,total*10+2):
  for d in ds:
    if d in list(str(ans)):
      break
  else:
    print(i)
    exit(0)
Problem p04046 (python)

Fixed submission:
h,w,a,b = map(int, input().split())

mod = 10**9+7 #出力の制限
N = h+w
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

ans = 0
for j in range(b,w):
  ans += cmb(h-a-1+j, j, mod) * cmb(a-1+w-j-1, a-1, mod)
print(ans%mod)

Buggy submission (verdict: Runtime Error):
h,w,a,b = map(int, input().split())

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = h+w
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

#a = cmb(n,r,mod)
ans = 0
for i in range(b,w):
  ans += cmd(h-a-1+i, i, mod) * cmd(a-1+w-i-1, a-1, mod)
print(ans%mod)

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

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

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

prev_com1 = 0
ans = 0
for i in range(h-a):
  com1 = cmb(i+b,b)
  com2 = cmb(h-b+h, h)
  ans += (com1 - prev_com1)*com2
  prev_com1 = com1
print(ans)

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

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

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

h-a
prev_com1 = 0
ans = 0
for i in range(h-a):
  com1 = cmb(i+b,b)
  com2 = cmb(h-b+h, h)
  ans += (com1 - prev_com1)*com2
print(ans)
Problem p04029 (python)

Fixed submission:
n = input()
result = 0

for i in range(int(n)):
  result += i+1

print(result)

Buggy submission (verdict: Runtime Error):
n = input()
result = 0

for i in range(n):
  result += i

print(result)

Buggy submission (verdict: Runtime Error):
n = input()
result = 0

for i in n:
  result += i

print result
Problem p04044 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, L = map(int, input().split())
# 文字列用のリスト
s = []
# N回分のインプットを受け入れる
for i in range(N):
	s.append(input())
# リストの昇順の並び替え
s.sort()
# 出力
print(''.join(s))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, L = map(int, input().split())
# 文字列用のリスト
s = []
# L回分のインプットを受け入れる
for i in range(L):
	s.append(input())
# リストの昇順の並び替え
s.sort()
# 出力
print(''.join(s))
Problem p04043 (python)

Fixed submission:
array = input().split()
if (array.count('5') == 2 and array.count('7')  == 1):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
array = input().split()
if (array.count(5) == 2 and array.count(7) == 1):
  print "YES"
else
  print "NO"
Problem p04029 (python)

Fixed submission:
n=input()
n=int(n)
a=0
for i in range(1,n+1):
    a=a+i
print(a)

Buggy submission (verdict: Runtime Error):
n=input()
a=0
for i in range(1,n+1):
  a=a+1
print(a)
Problem p04043 (python)

Fixed submission:
a,b,c=map(int,input().split())
list=[a,b,c]
list.sort()
if list==[5,5,7]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=int(input().sprit())
list=[a,b,c]
sorted(list)
if list==[5,5,7]：
  print("YES")
  else：
  print("NO")
Problem p04043 (python)

Fixed submission:
input = map(int, raw_input().split())
ans = [5, 7, 5]
for data in input:
 if int(data) < 1 or int(data) > 10:
  print 'error'
  exit()
for data in input:
 if data in ans:
   ans.remove(data)
if len(ans) == 0:
 print 'YES'
else:
 print 'NO'

Buggy submission (verdict: Runtime Error):
L, N = map(int, raw_input().split())
if L > 100 or L < 1:
 print 'error'
 exit()
if N > 100 or N < 1:
 print 'error'
 exit()
 
 
input = []
for i in range(0, N):
 sentence = raw_input()
 if len(sentence) != L:
  print 'error'
  exit()
 for j in range(0, L):
  if sentence[j] < 'a' or sentence[j] > 'z':
   print 'error'
   exit()
 input.append(sentence)
for x in sorted(input):
    print x
Problem p04029 (python)

Fixed submission:
N = int(raw_input())

sum = 0

for i in xrange(N+1):
     sum += i

print sum

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

numbers = map(int, raw_input().split())

min_num = min(numbers)
max_num = max(numbers)
min_cost = None 


for result in xrange(min_num, max_num+1):
    cost = 0 
    for number in numbers:
        cost += (number - result)**2
    if min_cost:
        if min_cost >= cost:
            min_cost = cost 
    else:
        min_cost = cost
print min_cost
Problem p04029 (python)

Fixed submission:
n=input()
print n*(n+1)/2

Buggy submission (verdict: Runtime Error):
n=raw_input()
n*(n-1)/2
Problem p04030 (python)

Fixed submission:
s=raw_input()
a=""
for k in range(len(s)):
    if s[k]=="0":
        a=a+"0"
    elif s[k]=="1":
        a=a+"1"
    elif s[k]=="B":
        if len(a)>0:
            a=a[0:len(a)-1]
print a

Buggy submission (verdict: Runtime Error):
s=input()
a=""
for k in range(len(s)):
    if s[k]=="0":
        a=a+"0"
    elif s[k]=="1":
        a=a+"1"
    elif s[k]=="b":
        a=a.rstrip(a[-1])
print a
Problem p04044 (python)

Fixed submission:
first= input()
first = first.split()

N = int(first[0])
L =[]
for i in range(N):
  s = input()
  L.append(s)
  
L.sort()
for i in L:
  print(i,end="")

Buggy submission (verdict: Runtime Error):
first= input()
first = first.split()

N = int(first[0])
L =[]
for i in range(N)
  s = input()
  L.append(s)
  
L.sort()
for i in L:
  print(i,end="")

Buggy submission (verdict: Runtime Error):
first= input()
first = first.split()

N = int(firsst[0])
L =[]
for i in range(N)
  s = input()
  L.append(s)
  
L.sort()
for i in L:
  print(i,end="")
Problem p04033 (python)

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

if a < 0 < b:
    print("Zero")
elif 0 < a < b:
    print("Positive")
elif a < b < 0:
    if (b - a + 1) % 2 == 0:
        print("Positive")
    else:
        print("Negative")

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

if a < 0 < b:
    print("Zero")
else 0 < a < b:
    print("Positive")
if a < b < 0:
    if (b - a + 1) % 2 == 0:
        print("Positive")
    else:
        print("Negative")

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

n = 1
for i in range(a, b + 1):
    n *= i

if a < 0 < b:
    print("Zero")
else 0 < a < b:
    print("Positive")
if a < b < 0:
    if (b - a + 1) % 2 == 0:
        print("Positive")
    else:
        print("Negative")
Problem p04043 (python)

Fixed submission:
# coding: utf-8
# Here your code !
xyz = raw_input().split(" ")
c1, c2 = 0, 0
for i in xyz:
    if i == "5":
        c1 += 1
    elif i == "7":
        c2 += 1
if (c1 == 2 and c2 == 1):
    print "YES"
else:
    print "NO"

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
N, K = map(int, raw_input().split(" "))
D = map(int, raw_input().split(" "))
nums = range(0,10)
#好きな数字を昇順のリストに整理
like = list(set(nums).difference(set(D)))
like.sort()
print like
#数字を上から1文字づつ処理
grade = len(str(N))-1
ans = 0
flag = False #上の桁で嫌いな数字があるか
for i in str(N):
    if int(i) == 9 and 9 not in like and not flag:
        ans += 10**(grade+1)
        flag = True
    elif int(i) not in like and not flag:
        for j in like:
            if j > int(i):
                ans += j*10**(grade)
                flag = True
                break
    elif flag:
        ans += like[0]*10**(grade)
    grade -= 1
if ans < N:
    ans = N
print ans
Problem p04039 (python)

Fixed submission:
s = input()
s = s.split(" ")
N = s[0]
K = int(s[1])

s = input()
s = s.split(" ")
ds = [int(digit) for digit in s]

minNum = min([digit for digit in range(0, 10) if digit not in ds])
nonZerominNum = min([digit for digit in range(1, 10) if digit not in ds])
maxNum = max([digit for digit in range(0, 10) if digit not in ds])

digits = [int(digit) for digit in N]

result = N
for index in range(0, len(digits)):
  digit = digits[index]
  if digit in ds:
    i = index
    if digit > maxNum:
      i = index - 1
      while i >= 0 and digits[i] == maxNum:
        i -= 1
    
    if i < 0:
      result = str(nonZerominNum) + (str(minNum) * len(N))
    else:
      biggerDigit = min([d for d in range(0, 10) if d not in ds and d > digits[i]])
      digits[i] = biggerDigit
      for j in range(i+1, len(digits)):
        digits[j] = minNum
      result = "".join([str(digit) for digit in digits])
    break

print(result)

Buggy submission (verdict: Runtime Error):
s = input()
s = s.split(" ")
N = s[0]
K = int(s[1])

s = input()
s = s.split(" ")
ds = [int(digit) for digit in s]

minNum = min([digit for digit in range(0, 10) if digit not in ds])
maxNum = max([digit for digit in range(0, 10) if digit not in ds])

digits = [int(digit) for digit in N]

result = N
for index in range(0, len(digits)):
  digit = digits[index]
  if digit in ds:
    i = index
    if digit > maxNum:
      i = index - 1
      while i >= 0 and digits[i] == maxNum:
        i -= 1
    
    if i < 0:
      result = str(minNum) * (len(N) + 1)
    else:
      biggerDigit = min([d for d in range(0, 10) if d not in ds and d > digits[i]])
      digits[i] = biggerDigit
      for j in range(i+1, len(digits)):
        digits[j] = minNum
      result = "".join([str(digit) for digit in digits])

print(result)

Buggy submission (verdict: Runtime Error):
s = input()
s = s.split(" ")
N = s[0]
K = int(s[1])

s = input()
s = s.split(" ")
ds = [int(digit) for digit in s]

minNum = min([digit for digit in range(0, 10) if digit not in ds])
maxNum = max([digit for digit in range(0, 10) if digit not in ds])

digits = [int(digit) for digit in N]

result = N
for index in range(0, len(digits)):
  digit = digits[index]
  if digit in ds:
    i = index
    if digit > maxNum:
      i = index - 1
      while i >= 0 and digits[i] == maxNum:
        i -= 1
    
    if i < 0:
      result = str(minNum) * (len(N) + 1)
    else:
      biggerDigit = min([d for d in range(0, 10) if d not in ds and d > digits[i]])
      result = N[:i] + str(biggerDigit) + (str(minNum) * (len(N) - i - 1))

print(result)
Problem p04039 (python)

Fixed submission:
n,k=map(int,input().split())
d=list(map(int,input().split()))
while True:
    m=n
    f=False
    while m>0:
        if m%10 in d:
            f=True
            break
        m=int(m/10)
    if f:
        n+=1
    else:
        print(n)
        break

Buggy submission (verdict: Runtime Error):
import random

numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
count = random.randint(1, 9)
dk, i = [], 0
while i < count:
    m = random.choice(numbers)
    if m not in dk:
        dk.append(m)
        i += 1
    else:
        continue

number_input = random.randint(10, 10000)
number_result = number_input
while True:
    string_middle = str(number_result)
    judge = 0
    for each in string_middle:
        if each in numbers:
            judge = 1
            break
        else:
             continue
    if judge == 1:
        number_result += 1
    else:
        break
print('%d %d'%(number_input, count)
print(dk)
print('%d'%number_result)
Problem p04043 (python)

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

if sorted([a, b, c]) == [5, 5, 7]: print('YES')
else: print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = [int(x) for x in in input().split()]

if sorted([a, b, c]) == [5, 5, 7]: print("YES")
else: print("NO")
Problem p04043 (python)

Fixed submission:
a = list(map(int,input().split()))
num_5 = 0
num_7 = 0

for i in a:
  if i==5:
    num_5 = num_5+1
  if i==7:
    num_7 = num_7+1

if num_5==2 and num_7==1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
num_5 = 0
num_7 = 0

for  i in a:
  if i=="5":
    num_5 = num_5+1
  if i=="7":
    num_7 = num_7+1

if num_5=2 and num_7=1:
  print "YES"
else:
  print "NO"
Problem p04043 (python)

Fixed submission:
# -*- coding: utf-8 -*-

if __name__ == "__main__":
    # str_list = [map(int, input().split())]
    # if str_list.count(5) == 2 and str_list.count(7) == 1:
    #     print('YES')
    # else:
    #     print('NO')
    str_list = list(map(int, input().split()))
    if sum(str_list) == 17:
        print('YES')
    else:
        print('NO')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

if __name__ == "__main__":
    str_sum = sum([map(int, input().split())])
    if str_sum == 17:
        print('YES')
    else:
        print('NO')
Problem p04044 (python)

Fixed submission:
# bsdk idhar kya dekhne ko aaya hai, khud kr!!!
# import math
# from itertools import *
# import random
# import calendar
import datetime
# import webbrowser

# f = open("input.txt", 'r')
# g = open("output.txt", 'w')
# n, m = map(int, f.readline().split())

n, k = map(int, input().split())
arr = []
for i in range(n):
    arr.append(input())
arr.sort()
print("".join(arr))

Buggy submission (verdict: Runtime Error):
# bsdk idhar kya dekhne ko aaya hai, khud kr!!!
# import math
# from itertools import *
# import random
# import calendar
import datetime
# import webbrowser

# f = open("input.txt", 'r')
# g = open("output.txt", 'w')
# n, m = map(int, f.readline().split())

n, k = map(int, input().split())
arr = []
for i in range(k):
    arr.append(input())
arr.sort()
print("".join(arr))
Problem p04043 (python)

Fixed submission:
a = input()
A = int(a[0])
B = int(a[2])
C = int(a[4])

if(A==5 and B==7 and C==5):
    print('YES')
elif(A==7 and B==5 and C==5):
    print('YES')
elif(A==5 and B==5 and C==7):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
if(a==5 & b==7 & c==5):
    print('yes')
elif(a==7 & b==5 & c==5):
    print('yes')
elif(a==5 & b==5 & c==7):
    print('yes')
else:
    print('no')
Problem p04043 (python)

Fixed submission:
lst = list(map(int, input().split()))
slst = sorted(lst)
if slst == [5, 5, 7]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
lst = list(map(int,input().split()))
for i in lst:
  ct = 0
	if i == 5:
      ct += 1
    elif i == 7:
      ct += 1
if ct == 3:
  return "YES"
else:
  return "NO"
Problem p04043 (python)

Fixed submission:
def test():
  x=input()
  x=x.split()
  if x == ['5','5','7']:
    print("YES")
  elif x == ['5','7','5']:
    print("YES")
  elif x == ['7','5','5']:
    print("YES")
  else:
    print("NO")
    
test()

Buggy submission (verdict: Runtime Error):
def test():
  x=input()
  x=x.split()
  if x =['5','5','7']:
    print("YES")
  elif x =['5','7','5']:
    print("YES")
  elif x =['7','5','5']:
    print("YES")
  else:
    print("NO")
Problem p04043 (python)

Fixed submission:
a,b,c = sorted(map(int, input().split()))
if (a+b+c==17)&(a==b)&(c==7):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for s in range(N)]
S.sort()
output = ""
for i in S:
  output+=i
prunt(output)

Buggy submission (verdict: Runtime Error):
a,b,c = sorted(map(int, input().split()))
if (a+b+c==17)&(a==b)&(c==7):
  return("YES")
else:
  return("NO")
Problem p04044 (python)

Fixed submission:
n, l = map(int, input().split())
s = sorted(input() for _ in range(n))
print(*s, sep="")

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for s in range(N)]
S.sort()
output = ""
for i in S:
  output+=i
prunt(output)

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for s in range(L)]
S.sort()
output = ""
for i in S:
  output+=i
prunt(output)