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

Fixed submission:
import fractions
import bisect
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N,M)
S_arr = [0]*N
T_arr = [0]*M
for i in range(1,N):
    S_arr[i] = i*(L//N)
for i in range(1,M):
    T_arr[i] = i*(L//M)
if M <= N:
    for i in range(M):
        index = bisect.bisect_left(S_arr,T_arr[i])
        if S_arr[index] == T_arr[i] and S[index] != T[i]:
            print(-1)
            exit()
else:
    for i in range(N):
        index = bisect.bisect_left(T_arr,S_arr[i])
        if T_arr[index] == S_arr[i] and T[index] != S[i]:
            print(-1)
            exit()

print(L)

Buggy submission (verdict: Runtime Error):
import fractions
import bisect
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N,M)
S_arr = [0]*N
T_arr = [0]*M
for i in range(1,N):
    S_arr[i] = i*(L//N)
for i in range(1,M):
    T_arr[i] = i*(L//M)
for i in range(M):
    index = bisect.bisect_left(S_arr,T_arr[i])
    if S_arr[index] == T_arr[i] and S[index] != T[i]:
        print(-1)
        exit()
print(L)

Buggy submission (verdict: Runtime Error):
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
N, M = map(int, input().split())
S = input()
T = input()
if S[0] != T[0]:
    print(-1)
    exit()
L = lcm(N,M)
ans = ['']*L
ans[0] = S[0]
for i in range(1,N):
    ans[i*(L//N)] = S[i]
for i in range(1,M):
    if ans[i*(L//M)] == '' or ans[i*(L//M)] == T[i]:
        ans[i*(L//M)] = T[i]
    else:
        print(-1)
        exit()
print(L)

Buggy submission (verdict: Runtime Error):
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N,M)
ans = ['']*L
ans[0] = S[0]
for i in range(1,N):
    ans[i*(L//N)] = S[i]
for i in range(1,M):
    if ans[i*(L//M)] == '' or ans[i*(L//M)] == T[i]:
        ans[i*(L//M)] = T[i]
    else:
        print(-1)
        exit()
print(L)
Problem p03240 (python)

Fixed submission:
import sys
input = sys.stdin.readline
N = int(input())
pira = [[] for i in range(N)]
for i in range(N):
	pira[i] = list(map(int, input().split()))
	if pira[i][2] != 0:
		k = pira[i]

for x in range(101):
	for y in range(101):
		tmp = k[2] + abs(x-k[0]) + abs(y-k[1])
		for i in range(len(pira)):
			if pira[i][2] != max(tmp-abs(x-pira[i][0])-abs(y-pira[i][1]),0):
				break
			if i == len(pira)-1:
				print(x,y,tmp)
				exit()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N = int(input())
pira = [[] for i in range(N)]
ans = [0,0,0]
a = False
for i in range(N):
	pira[i] = list(map(int, input().split()))
tmp = 0

for i in range(len(pira)):
	if pira[i][2] == 0:
		continue
	else:
		tmp = pira[i][2] + abs(pira[i][0]-x) + abs(pira[i][1]-y)

for x in range(101):
	for y in range(101):
		for i in range(1,len(pira)):
			if pira[i][2] == 0:
				continue
			if tmp != pira[i][2] + abs(pira[i][0]-x) + abs(pira[i][1]-y):
				a = False
				# ans = [0,0,0]
				break
			else:
				a = True
				ans = [x,y,tmp]
		if a:
			break
	if a:
		break

print(ans[0],ans[1],ans[2])
Problem p03274 (python)

Fixed submission:
N, K = map(int, input().split())
arr = list(map(int,input().split()))
left = []
right = []
for i in arr:
    if i < 0:
        left.append(abs(i))
    else:
        right.append(i)
left.sort()
tmp = 0
count = 0
if len(right) == 0:
    print(left[K-1])
    exit()
if len(right) >= K:
    tmp += right[K-1]
    i = 1
    while True:
        if len(left) < i or K-i-1 < 0:
            break
        tmp2 = right[K-i-1] + left[i-1] + min(right[K-i-1],left[i-1])
        i += 1
        if tmp2 < tmp:
            tmp = tmp2
else:
    tmp += right[-1]+left[K-len(right)-1]+min(right[-1],left[K-len(right)-1])
    i = 1
    while True:
        if K-len(right)-1+i >= K or i >= len(right) or K-len(right)-1+i >= len(left)-1:
            break
        tmp2 = right[-1-i] + left[K-len(right)-1+i] + min(right[-1-i],left[K-len(right)-1+i])
        i += 1
        if tmp2 < tmp:
            tmp = tmp2
print(tmp)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
arr = list(map(int,input().split()))
left = []
right = []
for i in arr:
    if i < 0:
        left.append(abs(i))
    else:
        right.append(i)
left.sort()
tmp = 0
count = 0
if len(right) == 0:
    print(left[K-1])
    exit()
if len(right) >= K:
    tmp += right[K-1]
    i = 1
    while True:
        if len(left) < i or K-i-1 < 0:
            break
        tmp2 = right[K-i-1] + left[i-1] + min(right[K-i-1],left[i-1])
        i += 1
        if tmp2 < tmp:
            tmp = tmp2
else:
    tmp += right[-1]+left[K-len(right)-1]+min(right[-1],left[K-len(right)-1])
    i = 1
    while True:
        if K-len(right)-1+i >= K or -1-i < 1-len(right):
            break
        tmp2 = right[-1-i] + left[K-len(right)-1+i] + min(right[-1-i],left[K-len(right)-1+i])
        i += 1
        if tmp2 < tmp:
            tmp = tmp2
print(tmp)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
arr = list(map(int,input().split()))
left = []
right = []
for i in arr:
    if i < 0:
        left.append(abs(i))
    else:
        right.append(i)
left.sort()
tmp = 0
count = 0
if len(right) >= K:
    tmp += right[K-1]
    i = 1
    while True:
        if len(left) < i or K-i-1 < 0:
            break
        tmp2 = right[K-i-1] + left[i-1] + min(right[K-i-1],left[i-1])
        i += 1
        if tmp2 < tmp:
            tmp = tmp2
else:
    tmp += right[-1]+left[K-len(right)-1]+min(right[-1],left[K-len(right)-1])
    i = 1
    while True:
        if K-len(right)-1+i >= K or -1-i < 1-K:
            break
        tmp2 = right[-1-i] + left[K-len(right)-1+i] + min(right[-1-i],left[K-len(right)-1+i])
        i += 1
        if tmp2 < tmp:
            tmp = tmp2
print(tmp)
Problem p03282 (python)

Fixed submission:
S = input()
K = int(input())
flg = True
for i in range(K):
    if len(S) <= i:
        break
    if S[i] != '1':
        flg = False
if flg:
    print('1')
    exit()
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
print('1')

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
flg = True
for i in range(K):
    if 100 <= i:
        break
    if S[i] != '1':
        flg = False
if flg:
    print('1')
    exit()
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
print('1')

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
flg = True
for i in range(K):
    if 100 < i:
        break
    if S[i] != '1':
        flg = False
if flg:
    print('1')
    exit()
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
print('1')

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
flg = True
for i in range(K):
    if S[i] != '1':
        flg = False
if flg:
    print('1')
    exit()
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
print('1')

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
flg = False
for i in range(K):
    if S[i] != '1':
        flg = True
if flg:
    print('1')
    exit()
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
print('1')
Problem p03309 (python)

Fixed submission:
N = int(input())
arr = list(map(int, input().split()))
for i in range(N):
    arr[i] = arr[i]-(i+1)
arr.sort()
sad = arr[N//2]
ans = 0
for i in arr:
    ans += abs(i-sad)
print(ans)

Buggy submission (verdict: Runtime Error):
from statistics import mode
N = int(input())
arr = list(map(int, input().split()))
for i in range(N):
    arr[i] = arr[i]-(i+1)
if len(arr) == len(set(arr)):
    sad = 0
else:
    sad = mode(arr)
ans = 0
for i in arr:
    ans += abs(i-sad)
print(ans)
Problem p03337 (python)

Fixed submission:
a, b = map(int, input().split())
max = a+b
if max < a - b:
    max = a-b
if max < a * b:
    max = a*b
print(max)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
East = [0] * (N)
if S[0] == "E":
    East[0] = 1
for i in range(N-1):
    if i == N-1:
        break
    if S[i+1] == 'E':
        East[i+1] = East[i] + 1
    else:
        East[i+1] = East[i]
# print(East)
result = East[N-1] -East[1]
for i in range(1,N):
    if i == N-1:
        ans = (i-1) -East[i-2]
    elif i == 1:
        ans = East[N-1] - East[i+1]
    else:
        right_E = East[N-1] - East[i+1]
        left_W = (i-1) -East[i-2]
        ans = right_E + left_W
    if result > ans:
        result = ans
        # print(i)
print(result)
Problem p03448 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0

for a in range(a + 1):
    for b in range(b + 1):
        for c in range(c + 1):
            sum = 500 * a + 100 * b + 50 * c
            if sum == x:
                ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())

for a in range(a + 1):
    for b in range(b + 1):
        for c in range(c + 1):
            sum = 500 * a + 100 * b + 50 * c
            if sum == x:
                ans += 1

print(ans)
Problem p03470 (python)

Fixed submission:
a = int(input())
mochi = []
for _ in range(a):
    mochi.append(int(input()))

print(len(set(mochi)))

Buggy submission (verdict: Runtime Error):
a = int(input())
mochi = []
for _ in range(a):
    mochi.append(int(input())

print(len(set(mochi)))

Buggy submission (verdict: Runtime Error):
a = int(input())
mochi = []
for _ in range(a):
    mochi.append(int(input())

print(len(set(mochi)))

Buggy submission (verdict: Runtime Error):
a = int(input())
mochi = []
for _ in range(a):
    mochi.append(int(input())
print(len(set(mochi)))
Problem p03477 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
L = A+B
R = C+D
if L > R:
    print('Left')
elif L < R:
    print('Right')
else:
    print('Balanced')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
ans = 0
for i in range(1, a+1):
    N = [int(x) for x in str(i)]
    sum_N = sum(N)
    if (b <= sum_N and sum_N <= c):
        ans += sum_N

print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
ans = 0
for i in range(1, a+1):
    N = [int(x) for x in str(i)]
    sum = sum(N)
    if (b <= sum and sum <= c):
        ans += sum

print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
ans = 0
for i range(1, a+1):
    N = [int(x) for x in str(i)]
    sum = sum(N)
    if (b <= sum and sum <= c):
        ans += sum

print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
ans = 0
for i range(1, a+1):
    N = [int(x) for x in str(i)]
    sum = sum(N)
    if b <= sum and sum <= c:
        ans += sum

print(ans)
Problem p03478 (python)

Fixed submission:
a, b, c = map(int, input().split())
ans = 0
for i in range(1, a+1):
    N = [int(x) for x in str(i)]
    sum_N = sum(N)
    if (b <= sum_N and sum_N <= c):
        ans += i

print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
ans = 0
for i range(1, a+1):
    N = [int(x) for x in str(i)]
    sum = sum(N)
    if b <= sum and sum <= c:
        ans += sum

print(ans)

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

N = []
ans = 0

for i range(1, a+1):
    N = [int(x) for x in str(i)]
    sum = sum(N)
    if b <= sum and sum <= c:
        ans += sum

print(ans)
Problem p03493 (python)

Fixed submission:
a = str(input())
ans = 0
if a[0] == "1":
    ans = ans + 1

if a[1] == "1":
    ans = ans + 1

if a[2] == "1":
    ans = ans + 1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 0
flg = "True"

while flg == "True":
    ans = ans + 1
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] / 2
        else:
            flg = "False"

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 0
flg = "True"

while flg == "True":
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] / 2
        else:
            flg = "False"
    ans = ans + 1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 0
flg = "True"

while flg == "True":
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] / 2
        else:
            flg = "False"
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 0
flg == "True"

while flg == "True":
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] / 2
        else:
            flg == "False"
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 0
while(True):
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] / 2
        else:
            break
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
a = str(input())
ans = 0
if a[0] == 0:
    ans++

if a[1] == 0:
    ans++

if a[2] == 0:
    ans++

print(ans)
Problem p03494 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0
flg = "True"

while flg == "True":
    ans += 1
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] / 2
        else:
            flg = "False"

print(ans - 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
while(True):
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] / 2
        else:
            break
    ans += 1

print(ans)
Problem p03557 (python)

Fixed submission:
import bisect
N = int(input())
A_arr = list(map(int,input().split()))
A_arr.sort()
B_arr = list(map(int,input().split()))
B_arr.sort()
C_arr = list(map(int,input().split()))
ans = 0
check_array = [0] * N
for i in range(N):
    check_array[i] = check_array[i-1]+bisect.bisect_left(A_arr,B_arr[i])
for i in C_arr:
    B_index = bisect.bisect_left(B_arr,i)
    if B_index == 0:
        continue
    ans += check_array[B_index-1]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A_arr = sorted(list(map(int,input().split())))
B_arr = sorted(list(map(int,input().split())))
C_arr = sorted(list(map(int,input().split())))
ans = 0
for i in C_arr:
    B_index = bisect.bisect_left(B_arr,i)
    for k in range(B_index):
        ans += bisect.bisect_left(A_arr,B_arr[k])
print(ans)
Problem p03565 (python)

Fixed submission:
S = input()
T = input()
count = 0
flg = False
if len(S) < len(T):
    print('UNRESTORABLE')
    exit()
while True:
    flg = False
    for i in range(1,len(T)+1):
        if S[-i-count] != T[-i] and S[-i-count] != '?':
            count += 1
            flg = True
            break
    if count == len(S) - len(T) + 1:
        print('UNRESTORABLE')
        exit()
    if not flg:
        if count == 0:
            ans = S[0:len(S)-len(T)] + T
        elif count == len(S)-len(T):
            ans = T + S[len(T):]
        else:
            ans = S[0:len(S)-len(T)-count] + T + S[-count:]
        print(ans.replace('?','a'))
        exit()

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
flg = False
while True:
    flg = False
    for i in range(1,len(T)+1):
        if S[-i-count] != T[-i] and S[-i-count] != '?':
            count += 1
            flg = True
            break
    if count == len(S) - len(T) + 1:
        print('UNRESTORABLE')
        exit()
    if not flg:
        if count == 0:
            ans = S[0:len(S)-len(T)] + T
        elif count == len(S)-len(T):
            ans = T + S[len(T):]
        else:
            ans = S[0:len(S)-len(T)-count] + T + S[-count:]
        print(ans.replace('?','a'))
        exit()

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
flg = False
while True:
    flg = False
    for i in range(1,len(T)+1):
        if S[-i-count] != T[-i] and S[-i-count] != '?':
            count += 1
            flg = True
            break
    if count == len(S) - len(T):
        print('UNRESTORABLE')
        exit()
    if not flg:
        if count == 0:
            ans = S[0:len(S)-len(T)] + T
        elif count == len(S)-len(T):
            ans = T + S[:-len(S)+len(T)]
        else:
            ans = S[0:len(S)-len(T)-count] + T + S[-count:]
        print(ans.replace('?','a'))
        exit()

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
flg = False
while True:
    flg = False
    for i in range(1,len(T)+1):
        if S[-i-count] != T[-i] and S[-i-count] != '?':
            count += 1
            flg = True
            break
    if count == len(S) - len(T):
        print('UNRESTORABLE')
        exit()
    if not flg:
        if count == 0:
            ans = S[0:len(S)-len(T)] + T
        elif count == len(S)-len(T):
            ans = T + S[:-len(S)+len(T)]
        else:
            ans = S[0:len(S)-len(T)-1] + T + S[-count:]
        print(ans.replace('?','a'))
        exit()

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
flg = False
while True:
    flg = False
    for i in range(1,len(T)+1):
        if S[-i-count] != T[-i] and S[-i-count] != '?':
            count += 1
            flg = True
            break
    if count == len(S) - len(T):
        print('UNRESTORABLE')
        exit()
    if not flg:
        if count == 0:
            ans = S[0:len(S)-len(T)] + T
        elif count == len(S)-len(T):
            ans = T + S[:-len(S)+len(T)]
        else:
            ans = S[0:len(S)-len(T)-1] + T + S[-count:]
        print(ans)
        exit()
Problem p03607 (python)

Fixed submission:
N = int(input())
arr = [int(input()) for _ in range(N)]
dic = {}
for i in arr:
    if i in dic:
        dic[i] += 1
    else:
        dic[i] = 1
a = 0
for value in dic.values():
    if value % 2 == 1:
        a += 1
print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
arr = [int(input()) for _ in range(N)]
ans = [0] * (max(arr)+1)
for i in range(N):
    ans[arr[i]] += 1
a = 0
for i in ans:
    if i % 2 == 1:
        a += 1
print(a)
Problem p03611 (python)

Fixed submission:
N = int(input())
arr = list(map(int, input().split()))
arr2 = [0]*(max(arr)+1)
if max(arr) < 4:
    print(len(arr))
    exit()
for i in range(N):
    arr2[arr[i]] += 1
ans = arr2[1] + arr2[2] + arr2[3]
tmp = ans
for i in range(4,len(arr2)):
    tmp = tmp - arr2[i-3] + arr2[i]
    if ans < tmp:
        ans = tmp
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
arr = list(map(int, input().split()))
arr2 = [0]*(max(arr)+1)
if max(arr) == 1:
    print(len(arr))
    exit()
for i in range(N):
    arr2[arr[i]] += 1
ans = arr2[1] + arr2[2] + arr2[3]
tmp = ans
for i in range(4,len(arr2)):
    tmp = tmp - arr2[i-3] + arr2[i]
    if ans < tmp:
        ans = tmp
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
arr = list(map(int, input().split()))
arr2 = [0]*(max(arr)+1)
if len(arr2) == 3:
    arr2 = [0]*4
for i in range(N):
    arr2[arr[i]] += 1
ans = arr2[1] + arr2[2] + arr2[3]
tmp = ans
for i in range(4,len(arr2)):
    tmp = tmp - arr2[i-3] + arr2[i]
    if ans < tmp:
        ans = tmp
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
arr = list(map(int, input().split()))
arr2 = [0]*(max(arr)+1)
for i in range(N):
    arr2[arr[i]] += 1
ans = arr2[1] + arr2[2] + arr2[3]
tmp = ans
for i in range(4,len(arr2)):
    tmp = tmp - arr2[i-3] + arr2[i]
    if ans < tmp:
        ans = tmp
print(ans)
Problem p03625 (python)

Fixed submission:
N = int(input())
array = list(map(int,input().split()))
array.sort(reverse=True)
array2 = []
tmp = array[0]
for i in range(1,N):
    if tmp == array[i]:
        array2.append(array[i])
    tmp = array[i]
if len(array2) >= 1 and array2.count(max(array2)) >= 4:
    print(max(array2)**2)
    exit()
array3 = list(set(array2))
array3.sort(reverse=True)
if 2 <= len(array3):
    print(array3[0]*array3[1])
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
array = list(map(int,input().split()))
array.sort(reverse=True)
array2 = []
tmp = array[0]
for i in range(1,N):
    if tmp == array[i]:
        array2.append(array[i])
    tmp = array[i]
if array2.count(max(array2)) >= 4:
    print(max(array2)**2)
    exit()
array3 = list(set(array2))
array3.sort(reverse=True)
if 2 <= len(array3):
    print(array3[0]*array3[1])
else:
    print(0)
Problem p03633 (python)

Fixed submission:
import fractions
N = int(input())
tokei = [int(input()) for _ in range(N)]
if N == 1:
    print(tokei[0])
    exit()
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
ans = lcm(tokei[0],tokei[1])
for i in range(2,N):
    ans = lcm(ans,tokei[i])
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
N = int(input())
tokei = [int(input()) for _ in range(N)]
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
ans = lcm(tokei[0],tokei[1])
for i in range(2,N):
    ans = lcm(ans,tokei[i])
print(ans)
Problem p03651 (python)

Fixed submission:
import fractions
N, K = map(int, input().split())
arr = list(map(int, input().split()))
t = arr[0]
for i in range(1,N):
    t = fractions.gcd(t,arr[i])
if max(arr) < K or K % t != 0:
    print('IMPOSSIBLE')
else:
    print('POSSIBLE')

Buggy submission (verdict: Runtime Error):
import fractions
N, K = map(int, input().split())
arr = list(map(int, input().split()))
t = fractions.gcd(arr[0],arr[1])
for i in range(1,N):
    t = fractions.gcd(t,arr[i])
if max(arr) < K or K % t != 0:
    print('IMPOSSIBLE')
else:
    print('POSSIBLE')
Problem p03965 (python)

Fixed submission:
s = input()
print(s.count('g')-(-((-len(s))//2)))

Buggy submission (verdict: Runtime Error):
print(input().count('g')-(-((-len(s))//2)))
Problem p02536 (python)

Fixed submission:
import sys
sys.setrecursionlimit(2*10**5)#必要に応じて

class UnionFind:#再帰上限に引っかかることがあるので
    def __init__(self,n):
        self.l=list(range(n))
        self.n=n
        self.rank=[0 for i in range(n)]
    def find(self,x):
        if self.l[x]==x:
            return x
        self.l[x]=self.find(self.l[x])
        return self.l[x]
    def union(self,x,y):
        if x==y:return
        if self.rank[x]>self.rank[y]:
            return self.union(y,x)
        a,b=self.find(x),self.find(y)
        self.l[a]=b
        self.rank[a]=max(self.rank[b]+1,self.rank[a])
    def isSame(self,x,y):
        return self.find(x)==self.find(y)
n,m=map(int,input().split())
u=UnionFind(n)
for i in range(m):
    a,b=map(int,input().split())
    u.union(a-1,b-1)
d=set()
for i in range(n):
    d.add(u.find(i))
print(len(d)-1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
print(max(n-m-1),0)
Problem p02553 (python)

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

Buggy submission (verdict: Runtime Error):
-1000000000 0 -1000000000 0
Problem p02664 (python)

Fixed submission:
print(input().replace('?','D'))

Buggy submission (verdict: Runtime Error):
print(input().reaplce('?','D'))
Problem p02687 (python)

Fixed submission:
s=input()
print('ABC' if s=='ARC' else 'ARC')

Buggy submission (verdict: Runtime Error):
printt('ARC' if input()=='ABC' else 'ABC')

Buggy submission (verdict: Runtime Error):
mycode

Buggy submission (verdict: Runtime Error):
x = int(input())
for i in range(-102,103):
    for j in range(-102,103):
        if (i**5)-(j**5)==x:
            print(i,j)
            exit()