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

Fixed submission:
import fractions
from functools import reduce

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

# 累積GCD
left = [0] * (n + 1)
right = [0] * (n + 1)
for i in range(n):
  left[i + 1] = (fractions.gcd(left[i], a[i]))
  right[n - i - 1] = (fractions.gcd(right[n - i], a[n - 1 - i]))

ans = 0
for i in range(n):
  ans = max(ans, fractions.gcd(left[i], right[i + 1]))
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
from functools import reduce


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


n = int(input())
lst = list(map(int, input().split()))
lst.sort()

v = 0
index = 0
# 2値の最大公約数を求める
for i in range(n):
  arr = lst[:i] + lst[i + 1:len(lst)]
  g = gcd(*arr)
  if g > v:
    v = g
    index = i

print(v)
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split(" "))
print(H//A + (1 if H%A != 0 else 0))

Buggy submission (verdict: Runtime Error):
hp, _ = map(int, input().split(" "))
s = sum(map(int, input().split(" ")))
print((hp - s) <= 0)
Problem p02784 (python)

Fixed submission:
hp, _ = map(int, input().split(" "))
s = sum(map(int, input().split(" ")))
print("Yes" if (hp - s) <= 0 else "No")

Buggy submission (verdict: Runtime Error):
hp, _ = map(int, input().split(" "))
s = sum(map(int, input().split(" ")))
return (hp - s) <= 0
Problem p02783 (python)

Fixed submission:
import math

hp , attack = map(int,input().split())

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.ceil(hp / attack))

print(int(ans))

Buggy submission (verdict: Runtime Error):
import sys
import math

args = sys.argv

hp = int(args[1])
attack = int(args[2])

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.ceil(hp / attack))

print(int(ans))

Buggy submission (verdict: Runtime Error):
import sys
import math

args = sys.argv

hp = int(args[1])
attack = int(args[2])

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.ceil(hp / attack))

print(ans)

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv

hp = int(args[1])
attack = int(args[2])

if(hp <= attack):
    ans = "1"
else:
    ans = str(hp // attack)

print(ans)

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

import sys
import math

args = sys.argv

hp = int(args[1])
attack = int(args[2])

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.floor(hp / attack))

print(str(ans))

Buggy submission (verdict: Runtime Error):
import sys
import math

args = sys.argv

hp = int(args[1])
attack = int(args[2])

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.floor(hp / attack))

print(str(ans))

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv
if(args[0] <= args[1]):
    ans = "1"
else:
    ans = int(args[1]) / int(args[0])

print(str(ans))
Problem p02786 (python)

Fixed submission:
h = input()

def myfunc(hp: 'int') -> 'int':
    if(hp == 1):
        return 1
    elif(hp > 1):
        return int(myfunc(hp/2)) * 2 + 1
    return hp


if __name__ == '__main__':
    ans = myfunc(int(h))
    print(ans)

Buggy submission (verdict: Runtime Error):
h = input()

def myfunc(hp):
    if(hp == 1):
        return 1
    elif(hp > 1):
        return int(myfunc(hp/2)) + int(myfunc(hp/2)) + 1


if __name__ == '__main__':
    ans = myfunc(int(h))
    print(ans)

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

attack_count = 0
fin_flag = 0

print(monster)

while(fin_flag == 0):

    for i in range(len(monster)) :
        attack_count = attack_count + 1
        if(monster[i] == 1):
            if(i == 0 and monster[0] == 1):
                fin_flag = 1
                break
            monster.pop(i)
        else:
            monster.append(monster[i]//2)
            monster.append(monster[i]//2)
            monster.pop(i)

print(attack_count+1)
Problem p03086 (python)

Fixed submission:
b = input()
ans = []
cnt = 0

for i in b:
    if i in "ACTG":
        cnt+=1
    else:
        ans.append(cnt)
        cnt = 0

ans.append(cnt)

print(max(ans))

Buggy submission (verdict: Runtime Error):
b = input()
ans = []
cnt = 0

for i in b:
    if i in "ACTG":
        cnt+=1
    else:
        ans.append(cnt)
        cnt = 0

print(max(ans))

Buggy submission (verdict: Runtime Error):
b = input()
ans =0
cnt =0
 
for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
            cnt = 0
 
print(ans)
b = input()
ans =0
cnt =0

for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
            cnt = 0

print(ans)

Buggy submission (verdict: Runtime Error):
b = input()
ans =0
cnt =0
 
for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
            cnt = 0
 
print(ans)
b = input()
ans =0
cnt =0

for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
        cnt = 0

print(ans)
Problem p03231 (python)

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(x, y):
    return (x * y) // gcd(x, y)



M, N = map(int, input().split())
S = input()
T = input()

MA = [S[0]]
NA = [T[0]]

L = lcm(M, N)

m = L/M
n = L/N

for i in range(M):
    if i % n == 0:
        MA.append(S[i])

for i in range(N):
    if i % m == 0:
        NA.append(T[i])

if MA == NA:
    print(L)
else:
    print("-1")

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

M, N = map(int, input().split())
S = input()
T = input()

MA = [S[0]]
NA = [T[0]]

L = lcm(M, N)

m = L/M
n = L/N

for i in range(M):
    if i % n == 0:
        MA.append(S[i])

for i in range(N):
    if i % m == 0:
        NA.append(T[i])

if MA == NA:
    print(L)
else:
    print("-1")
Problem p03238 (python)

Fixed submission:
N = int(input())

if N == 1:
    a = "Hello World"
    print(a)

if N == 2:
    A = int(input())
    B = int(input())
    C = A+B
    print(C)

Buggy submission (verdict: Runtime Error):
N = int(input())
p = []
for i in range(N):
    X1, Y1, H1 = map(int, input().split())
    if H1 != 0:
        p.append([X1, Y1, H1])

if len(p) == 1:
    print(p[0][0], p[0][1], p[0][2])
    exit()


for i in range(101):
    for j in range(101):
        h = -1
        fg = True
        for t in p:
            if h == -1:
                h = t[2] + abs(i - t[0]) + abs(j - t[1])

            else:
                ht = t[2] + abs(i - t[0]) + abs(j - t[1])
                if h == ht:
                    h = ht
                else:
                    fg = False
                    break
        if fg:
            print(i, j, h)
Problem p03240 (python)

Fixed submission:
N = int(input())
p = []
for i in range(N):
    X1, Y1, H1 = map(int, input().split())
    if H1 != 0:
        p.append([X1, Y1, H1])

if len(p) == 1:
    print(p[0][0], p[0][1], p[0][2])
    exit()


for i in range(101):
    for j in range(101):
        h = -1
        fg = True
        for t in p:
            if h == -1:
                h = t[2] + abs(i - t[0]) + abs(j - t[1])

            else:
                ht = t[2] + abs(i - t[0]) + abs(j - t[1])
                if h == ht:
                    h = ht
                else:
                    fg = False
                    break
        if fg:
            print(i, j, h)

Buggy submission (verdict: Runtime Error):
N = int(input())
x =[]
y =[]
h =[]
for i in range(N):
    x1, y1, h1 = [int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
    h.append(h1)

for i in range(101):
    for j in range(101):
        flag = True
        for k in range(N):

            if k == 0 and h[k] != 0:
                temp = max(abs(x[k]-i) + abs(y[k]-j) + h[k], 0)

            if temp != max(abs(x[k]-i) + abs(y[k]-j) + h[k], 0) and h[k] != 0:
                flag = False

        if flag == True:
            print(i, j, temp)

Buggy submission (verdict: Runtime Error):
N = int(input())
x =[]
y =[]
h =[]
for i in range(N):
    x1, y1, h1 = [int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
    h.append(h1)

for i in range(101):
    for j in range(101):
        flag = True
        for k in range(N):
            
            if k == 0 and h[i] != 0:
                temp = max(abs(x[k]-i) + abs(y[k]-j) + h[k], 0)

            if temp != max(abs(x[k]-i) + abs(y[k]-j) + h[k], 0) and h[i] != 0 :
                flag = False

        if flag == True:
            print(i, j, temp)
Problem p03597 (python)

Fixed submission:
n = int(input())
a = int(input())
print(n*n-a)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(x, y):
    return (x * y) // gcd(x, y)



M, N = map(int, input().split())
S = input()
T = input()

MA = [S[0]]
NA = [T[0]]

L = lcm(M, N)

m = L/M
n = L/N

for i in range(M):
    if i % n == 0:
        MA.append(S[i])

for i in range(N):
    if i % m == 0:
        NA.append(T[i])

if MA == NA:
    print(L)
else:
    print("-1")
Problem p03719 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a<=c<=b:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
x =[]
y =[]
for i in range(m):
    x1, y1 = [int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
d ={}
for i in range(1,n+1):
    d[i]=0

for i in range(m):
    d[x[i]] += 1
    d[y[i]] += 1

for i in range(1,n+1):
    print(d[i])
Problem p02811 (python)

Fixed submission:
K,X = map(int,input().split())
if 500*K >= X:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math
import fraction
from functools import reduce
N,M=map(int,input().split())
A=list(map(int,input().split()))
def lcm_base(x, y):
    return (x * y) // fraction.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
saisyou = lcm(*A)
kosuu = math.ceil(M/saisyou)
print(kosuu)
Problem p02952 (python)

Fixed submission:
N = int(input())
cnt = 0
for i in range(1,N+1):
  if len(str(i))%2 != 0:
    cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
cnt = 0
for i in range(1,N+1):
  if len(str(i))%2 != :
    cnt+=1
print(cnt)
Problem p03105 (python)

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

if num > c:
	print(c)

else:
	print(num)

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

a = input()
b = input()
c = input()

if a*c <= b:
	print(c)

else:
	print(b/a)

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

a = input()
b = input()
c = input()

if a*c <= b:
	print('高橋くんは' + a*c + '円以上持っているのでお気に入りの音を' + c + '回聞いて満足します。')
 	print(c)
    
else:
  	print('高橋くんが満足できないこともあります。')
    print(b/a)

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

a = input()
b = input()
c = input()

if a*c <= b:
	print('高橋くんは' + a*c + '円以上持っているのでお気に入りの音を' + c + '回聞いて満足します。')
 	print(c)
    
else:
  	print('高橋くんが満足できないこともあります。')
    print('b/a')

Buggy submission (verdict: Runtime Error):
#coding:utf-8
a = input()
b = input()
c = input()

if a*c <= b:
    print(c)
    print("高橋くんは8円以上持っているのでお気に入りの音を4回聞いて満足します。")

else:
    print(b/a)
    print("高橋くんが満足できないことがあります。")
Problem p03106 (python)

Fixed submission:
a,b,k = map(int, input().split())
count = 0
for i in range (min(a,b),0,-1):
	if a % i == 0 and b % i == 0:
		count += 1
		d = i;
	if count == k:
		print(d)
		break

Buggy submission (verdict: Runtime Error):
a,b,k = map(int, input().split())
for i in range (min(a,b),0,-1):
	if a % i == 0 and b % i == 0:
		count += 1
		d = i;
	if count == k:
		print(d)
		break

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


A = []

B = []


for i in range (1,a+1):

	if(a % i == 0):

		A.append(i)


for j in range (1,b+1):

	if(a % i == 0):

		B.append(j)


G = set(A) & set(B)


G.reverse()



print(G[k])

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


A = []

B = []


for i in range (1,a+1):

	if(a % i == 0):

		A.append(i)


for j in range (1,b+1):

	if(a % i == 0):

		B.append(j)


G = set(A) and set(B)


G.reverse()



print(G[k])

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

A = []
B = []

for i in range (1,a+1):
	if(a % i == 0):
		A.append(i)

for j in range (1,b+1):
	if(a % i == 0):
		B.append(j)

G = set(A) and set(B)

G.reverse()

num = input()

print(G[num])

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

A = []
B = []

for i in range (1,a+1):
	if(a % i == 0):
		A.append(i)

for j in range (1,b+1):
	if(a % i == 0):
		B.append(j)

G = set(A) and set(B)

G.reverse()

num = input()

print(G[num])
Problem p03060 (python)

Fixed submission:
n = int(input())
v,c = list(map(int,input().split())),list(map(int,input().split()))
ans = 0
for i in range(n):
    if v[i] > c[i]:
        ans += v[i] - c[i]
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
v,c = list(map(int,input().split()),list(map(int,input().split())
ans = 0
for i in range(n):
    if v[i] > c[i]:
        ans += v[i] - c[i]
print(ans)
Problem p03101 (python)

Fixed submission:
x,y = input().split(),input().split()
h,w,hh,ww = int(x[0]),int(x[1]),int(y[0]),int(y[1])
print((h - hh) * (w - ww))

Buggy submission (verdict: Runtime Error):
import sys
x,y = input().split(),input().split()
h,w,hh,ww = x[0],x[1],y[0],y[1]
print((h - hh) * (w - ww))

Buggy submission (verdict: Runtime Error):
x,y = input().split(),input().split()
h,w,hh,ww = x[0],x[1],y[0],y[1]
print((h - hh) * (w - ww))
Problem p02789 (python)

Fixed submission:
N,M=list(map(int,input().split()))
if N>M:
    print("No")
else:
    print("Yes")

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


def lcm(x,y):   
    return x*y//gcd(x,y)

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

l=reduce(lcm,A)
    
ans=0
for i in range(N):
    ans+=l//A[i]

print(ans%(10**9+7))
Problem p02783 (python)

Fixed submission:
h,a=map(int,input().split())
i=0
while h-a*i>0:
  i+=1
print(i)

Buggy submission (verdict: Runtime Error):
h,a=map(int, input().split())
a*m>=h
print(m)
Problem p02789 (python)

Fixed submission:
n,m=map(int,input().split())
if n==m:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
,m=map(int,input().split())
if n==m:
  print('Yes')
else:
  print('No'

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
if n=m:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
if n=m:
  print('Yes')
else:
  print('No')
Problem p02801 (python)

Fixed submission:
c=input()
print(chr(ord(c)+1))

Buggy submission (verdict: Runtime Error):
c=input()
c=c.upper()
c=chr(ord(c+1))
print(c)

Buggy submission (verdict: Runtime Error):
c=input()
c=chr(ord(c+1))
print(c)

Buggy submission (verdict: Runtime Error):
c=input()
chr(ord(c+1))
print(c)
Problem p02945 (python)

Fixed submission:
a,b=map(int,input().split())
if a+b>a*b and a+b>a-b:
  print(a+b)
elif a*b>a+b and a*b>a-b:
  print(a*b)
else:
  print(a-b)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a+b>a*b,a-b:
  print(a+b)
elif a*b>a+b,a-b:
  print(a*b)
elif a-b>a*b,a+b:
  print(a-b)
Problem p02787 (python)

Fixed submission:
def main():
    h, n = map(int, input().split())
    magic_list = []

    for _ in range(n):
        a, b = map(int, input().split())
        magic_list.append((a, b))

    ans = solve(h, magic_list)
    print(ans)


def solve(h, magic_list):
    # 1-origin
    inf = 1 << 40
    max_attack = max(magic_list)[0]
    dp = [inf] * (h + max_attack)
    dp[0] = 0

    # time O(HN)
    for hp in range(1, h + max_attack):
        for attack, mp in magic_list:
            if hp >= attack and dp[hp - attack] < inf:
                dp[hp] = min(dp[hp], dp[hp - attack] + mp)

    return min(dp[h:])


main()

Buggy submission (verdict: Runtime Error):
def main():
    h, n = map(int, input().split())
    magic_list = []

    for _ in range(n):
        a, b = map(int, input().split())
        magic_list.append((a, b))

    ans = solve(h, magic_list)
    print(ans)


def solve(h, magic_list):
    # 1-origin
    dp = [0] * (h + 1)

    # time O(HN)
    for hp in range(1, h + 1):
        dp[hp] = min(dp[hp - attack] + mp for attack, mp in magic_list)

    return dp[h]


main()
Problem p03112 (python)

Fixed submission:
import bisect


def solve(a_list, b_list, position):
    # time O(log(A))
    a_right_key = bisect.bisect_left(a_list, position)
    a_left_key = a_right_key - 1
    # time O(log(B))
    b_right_key = bisect.bisect_left(b_list, position)
    b_left_key = b_right_key - 1

    a_left, a_right = a_list[a_left_key], a_list[a_right_key]
    b_left, b_right = b_list[b_left_key], b_list[b_right_key]

    ans = 10 ** 20
    for a_position in [a_left, a_right]:
        for b_position in [b_left, b_right]:
            distance1 = abs(position - a_position) + abs(a_position - b_position)
            distance2 = abs(position - b_position) + abs(a_position - b_position)
            ans = min(ans, distance1, distance2)
    return ans


def main():
    inf = 10 ** 20
    A, B, Q = map(int, input().split())

    # time O(A)
    a_list = [int(input()) for _ in range(A)]
    a_list = [-inf] + a_list + [inf]
    # time O(B)
    b_list = [int(input()) for _ in range(B)]
    b_list = [-inf] + b_list + [inf]

    # time O(Q (log(A) + log(B))
    for _ in range(Q):
        position = int(input())
        ans = solve(a_list, b_list, position)
        print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import bisect


def solve(a_list, b_list, position):
    # time O(log(A))
    a_right_key = bisect.bisect_left(a_list, position)
    a_left_key = a_right_key - 1
    # time O(log(B))
    b_right_key = bisect.bisect_left(b_list, position)
    b_left_key = b_right_key - 1

    a_left, a_right = a_list[a_left_key], a_list[a_right_key]
    b_left, b_right = b_list[b_left_key], b_list[b_right_key]

    ans = 10 ** 20
    for a_position in [a_left, a_right]:
        for b_position in [b_left, b_right]:
            distance1 = abs(position - a_position) + abs(a_position - b_position)
            distance2 = abs(position - b_position) + abs(a_position - b_position)
            ans = min(ans, distance1, distance2)
    return ans


def main():
    inf = 10 ** 20
    A, B, Q = map(int, input().split())

    # time O(A)
    a_list = [int(input()) for _ in range(A)]
    a_list = [-inf] + a_list + [inf]
    # time O(B)
    b_list = [int(input()) for _ in range(A)]
    b_list = [-inf] + b_list + [inf]

    # time O(Q (log(A) + log(B))
    for _ in range(Q):
        position = int(input())
        ans = solve(a_list, b_list, position)
        print(ans)


if __name__ == "__main__":
    main()
Problem p02783 (python)

Fixed submission:
from math import ceil
H, A = map(int, input().split())
print(ceil(H/A))

Buggy submission (verdict: Runtime Error):
import math
l = input().split()
print(math.ceil(l[0]/l[1]))
Problem p02783 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100000) 
H, A = map(int, input().split())

def calc_atack(H, A, counter =0):
    H -= A
    counter += 1
    if H <= 0:
        return counter
    else:
        return calc_atack( H, A, counter = counter)


print(calc_atack(H, A))

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

def calc_atack(H, A, counter =0):
    H -= A
    counter += 1
    if H <= 0:
        return counter
    else:
        return calc_atack( H, A, counter = counter)


print(calc_atack(H, A))

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

def calc_atack(H, A, counter =0):
    H -= A
    counter += 1
    if H <= 0:
        return counter
    else:
        return calc_atack( H, A, counter = counter)


print(calc_atack(H, A))
Problem p03455 (python)

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

result = a* b

if result % 2 == 0:
    print('Even')
else:
    print('Odd')

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

result = s* t

if result % 2 == 0:
    print('Even')
else:
    print('Odd')
Problem p02783 (python)

Fixed submission:
h,d = list(map(int, input().split()))
c,m = divmod(h,d)
if 0 != m:
  m = 1
print(c+m)

Buggy submission (verdict: Runtime Error):
H,N = list(map(int,input().split()))
alist = list(map(int,input().split()))
if H <= sum(alist):
  print("Yes")
else:
  print("No")
Problem p04043 (python)

Fixed submission:
# coding: utf-8

data = list(map(int,input().split()))
if 2 == data.count(5) and 1 == data.count(7):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
num, size = map(int,input().split())
data =[]
for x in range(num):
    data.append(input())
print(''.join(sorted(data)))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
num, size = map(int,input().split())
data =[]
for x in range(num):
    data.append(input())
print(''.join(sorted(data)))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
num, size = map(int,input().split())
data =[]
for x in range(num):
    data.append(input())
print(str.join(data.sort()))

Buggy submission (verdict: Runtime Error):
num, size = map(int,input().split())
data =[]
for x in range(num):
    data.append(input())
data.sort()
print(data.join())

Buggy submission (verdict: Runtime Error):
num, size = map(int,input().split())
data =[]
for x in range(num):
    data.append(input())
data.sort()
print(data.join())

Buggy submission (verdict: Runtime Error):
data = list(map(int,"5 7 5".split())
if 2 == data.count(5) and 1 == data.count(7):
    print("Yes")
else:
    print("No")
Problem p04044 (python)

Fixed submission:
# coding: utf-8
num, size = map(int,input().split())
data =[]
for x in range(num):
    data.append(input())
print(''.join(sorted(data)))

Buggy submission (verdict: Runtime Error):
num, size = map(int,input().split())
data =[]
for x in range(num):
    data.apend(input())
print(data.sort().join())
Problem p02818 (python)

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

if a+b > k:
  if k >a :
     print(0,b-(k-a))
  elif k<=a:
     print(a-k,b)
else:
  print(0,0)

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

if k > a :
  print("0",b-(k-a))
elif k=<a:
  print(a-k,b)
Problem p02830 (python)

Fixed submission:
n = int(input())
a,b = input().split()
a = list(a)
b = list(b)
ans =""
 
for i in range(n):
  ans += a[i]
  ans += b[i]
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a,b = input().split()
a = [i for i in a]
b = [i for i in b]
ans =""

for i in range(n):
  ans += a[n]
  ans += b[n]
print(ans)
Problem p02848 (python)

Fixed submission:
n = int(input())
s = input()
ans =""
 
for i in s:
  m = (ord(i)-ord("A")+n)%26
  ans += chr(m+ord("A"))
 
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s input()
ans =""

for i in s:
  m = (ord(i)-ord("A")+n)%26
  ans += chr(m+ord("A"))

print(ans)
Problem p02886 (python)

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
sum = 0
 
for i in range(n):
  for j in range(i+1,n):
    sum += (d[i]*d[j])
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = list(map,input().split())
sum = 0
 
for i in range(n):
  for j in range(i+1,n):
    sum += (d[i]*d[j])
print(sum)

Buggy submission (verdict: Runtime Error):
s = int(input())
d = list(map,input().split())
sum = 0
 
for i in range(n):
  for j in range(i+1,n):
    sum += (d[i]*d[j])
print(sum)

Buggy submission (verdict: Runtime Error):
s = int(input())
d = list(map,input().split())
sum = 0
 
for i in range(n):
  for j in range(i+1,n):
    sum += (d[i]*d[j])
print(ans)

Buggy submission (verdict: Runtime Error):
s = int(input())
d = list(map,input().split())
sum = 0

for i in range(n):
  for j in range(i+1,n):
    sum += d[i]*d[j]
print(ans)