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

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

Buggy submission (verdict: Runtime Error):
n = int(input())
m = int(input())
print((n-1)*(m-1))
Problem p03645 (python)

Fixed submission:
import bisect

n, m = map(int, input().split())
f_1 = []
t_n = []
jedge = 0
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        f_1.append(b)
    if b == n:
        t_n.append(a)
f_1.sort()
t_n.sort()
for i in range(len(f_1)):
    p = bisect.bisect_left(t_n, f_1[i])
    if p < len(t_n)-1 and f_1[i] == t_n[p]:
        jedge = 1
        break
    elif p == len(t_n)-1 and f_1[i] == t_n[p]:
        jedge = 1
        break
if jedge == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import bisect

n, m = map(int, input().split())
f_1 = []
t_n = []
jedge = 0
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        f_1.append(b)
    if b == n:
        t_n.append(a)
f_1.sort()
t_n.sort()
for i in range(len(f_1)):
    p = bisect.bisect_left(t_n, f_1[i])
    if p != len(t_n)-1 and f_1[i] == t_n[p+1]:
        jedge = 1
        break
    elif p == len(t_n)-1 and f_1[i] == t_n[p]:
        jedge = 1
        break
if jedge == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import bisect

n, m = map(int, input().split())
f_1 = []
t_n = []
jedge = 0
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        f_1.append(b)
    if b == n:
        t_n.append(a)
f_1.sort()
t_n.sort()
for i in range(len(f_1)):
    p = bisect.bisect_left(t_n, f_1[i])
    if p != len(t_n) and f_1[i] == t_n[p+1]:
        jedge = 1
        break
    elif p == len(t_n) and f_1[i] == t_n[p]:
        jedge = 1
        break
if jedge == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import bisect

n, m = map(int, input().split())
f_1 = []
t_n = []
jedge = 0
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        f_1.append(b)
    if b == n:
        t_n.append(a)
f_1.sort()
t_n.sort()
for i in range(len(f_1)):
    p = bisect.bisect_left(t_n, f_1[i])
    if f_1[i] == t_n[p]:
        jedge = 1
        break
if jedge == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import bisect

n, m = map(int, input().split())
f_1 = []
t_n = []
jedge = 0
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        f_1.append(b)
    if b == n:
        t_n.append(a)
f_1.sort()
t_n.sort()
for i in range(len(f_1)):
    p = bisect.bisect_left(t_n, f_1[i])
    if f_1[i] == t_n[p+1]:
        jedge = 1
        break
if jedge == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Problem p03721 (python)

Fixed submission:
n, k = map(int , input().split())
a = []
b = []
cnt = 0
for i in range(n):
    atem, btem = map(int , input().split())
    a.append(atem)
    b.append(btem)
c = list(zip(a, b))
c.sort()
a, b = zip(*c)
for i in range(n):
    cnt += b[i]
    if cnt >= k:
        print(a[i])
        break

Buggy submission (verdict: Runtime Error):
n, k = map(int , input().split())
e = []
cnt = 0
for i in range(n):
    a, b = map(int, input().split())
for j in range(b):
    e.append(a)
    e.sort()
print(e[k-1])

Buggy submission (verdict: Runtime Error):
n, k = map(int , input().split())
e = []
cnt = 0
for i in range(n):
a, b = map(int, input().split())
for j in range(b):
e.append(a)
e.sort()
print(e[k-1])
Problem p02724 (python)

Fixed submission:
x = int(input())
gold = int(x/500)
silver = int((x - 500*gold)/5)
print(gold*1000 + silver*5)

Buggy submission (verdict: Runtime Error):
x = int(input())
gold = x % 500
silver = (x - 500*g) % 5
fun = gold*1000 + silver*5
print(fun)
Problem p02755 (python)

Fixed submission:
A, B = map(int, input().split())

for x in range(1251):
    
    if (int(x * 0.08) == A) and (int(x * 0.1) == B):
        print(x)
        exit()

print("-1")

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

for x in range(1251):
    
    if (int(x * 0.08) == A) and (int(x * 0.1) == B):
        print(i)
    else:
        print("-1")
Problem p02724 (python)

Fixed submission:
num_origin = int(input())
gohyoku = int(num_origin/500)
num_zan = num_origin - gohyoku*500
go = int(num_zan/5)
 
num = go*5 + gohyoku*1000
 
print(num)

Buggy submission (verdict: Runtime Error):
num_origin = input()
gohyoku = int(num_origin/500)
num_zan = num_origin - gohyoku*500
go = int(go/5)

num = go*5 + gohyoku*1000

print(num)
Problem p02812 (python)

Fixed submission:
num = int(input())
bunsyo = input()
count = 0

for i in range(len(bunsyo)):
  if i+2 > num-1:
    continue
  if bunsyo[i] == 'A':
    if bunsyo[i+1] =='B':
      if bunsyo[i+2] == 'C':
        count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
num = int(input())
bunsyo = input()
count = 0

for i in range(len(bunsyo)):
  if bunsyo[i] == 'A':
    if bunsyo[i+1] =='B':
      if bunsyo[i+2] == 'C':
        count = count + 1
print(count)
Problem p02830 (python)

Fixed submission:
num = int(input())
 
s1,s2 = input().split()
 
ans = ''
 
for i in range(num):
	ans = ans + s1[i]
	ans = ans + s2[i]
print(ans)

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

s1,s2 = input().split()

ans = ''

for i in range(num):
	ans = ans + s1[i]
    ans = ans + s2[i]

print(ans)
Problem p03860 (python)

Fixed submission:
s = input().split()[1][0]
print('A{}C'.format(s))

Buggy submission (verdict: Runtime Error):
s = input().split()[1][0]
print('A{}C').format(s)

Buggy submission (verdict: Runtime Error):
s = input().split()[1][0]
print(f'A{s}C')
Problem p03962 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input.split())
print(len(set((a, b, c))))
Problem p04011 (python)

Fixed submission:
n, k, x, y = [int(input()) for i in range(4)]
basic = min(k * x, n * x)
plus = max((n - k) * y, 0)
print(basic + plus)

Buggy submission (verdict: Runtime Error):
inport numpy as np
n, k, x, y = map(int, input().split('\n'))
basic = np.min(k * x, n * x)
plus = np.max((n - k) * y, 0)
print(basic + plus)

Buggy submission (verdict: Runtime Error):
n, k, x, y = map(int, input().split('\n'))
basic = min(k * x, n * x)
plus = max((n - k) * y, 0)
print(basic + plus)

Buggy submission (verdict: Runtime Error):
n, k, x, y = map(int, input().split())
basic = min(k * x, n * x)
plus = max((n - k) * y, 0)
print(basic + plus)
Problem p04012 (python)

Fixed submission:
def main():
  ans = func(input())
  print(ans)
  
  
def func(sentence):
  unique_list = set(sentence)
  for s in unique_list:
    if sentence.count(s) % 2 != 0:
      return('No')
      break
  return('Yes')

if __name__ == '__main__':
  main()

Buggy submission (verdict: Runtime Error):
main():
  ans = func(input())
  print(ans)
  
  
def func(sentence):
  unique_list = set(sentence)
  for s in unique_list:
    if sentence.count(s) % 2 != 0:
      return('No')
      break
  return('Yes')

if __name__ == '__main__':
  main()
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 = map(int, input().stlip())
if sorted((a, b, c)) == [5, 5, 7]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
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 = map(int, input().split())
if set(a, b, c) == (5, 7) & a*b*c % 25 == 0:
  print(YES)
else:
  print(NO)
Problem p02783 (python)

Fixed submission:
h, a = map(int, input().split())
if h % a == 0:
	print(h//a)
else:
	print(h//a + 1)

Buggy submission (verdict: Runtime Error):
h, n = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
if h <= s:
	print('YES')
else:
	print('NO')
Problem p02789 (python)

Fixed submission:
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 p02888 (python)

Fixed submission:
import bisect


def triangles():
    n = int(input())
    l = [int(v) for v in input().split()]
    l.sort()

    count = 0
    for i in range(n):
        for j in range(i + 1, n):
            c = l[i] + l[j]
            index = bisect.bisect_left(l, c)
            count += max(index - j - 1, 0)

    print(count)


if __name__ == '__main__':
    triangles()

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(v) for v in input().split()]

l = sorted(l)
res = {}
count = 0
for i in range(len(l)-1):
    tmp_l = l
    a = l.pop(i)
    b = l.pop(i+1)
    count += len([1 for v in tmp_l if v > b - a and v < a + b])
    

print(count)
Problem p02909 (python)

Fixed submission:
S = input()

l = ['Sunny', 'Cloudy', 'Rainy']

i = l.index(S)

if i == 0:
  print('Cloudy')
elif i == 1:
  print('Rainy')
elif i == 2:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
import numpy as np

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

goods = np.array(list(map(int, input().split())))

for i in range(M):
    max_value = max(goods)
    max_index = np.where(goods == max_value)[0]
    goods[max_index] = goods[max_index]//2
    
sum_value = sum(goods)

print(sum_value)
Problem p02921 (python)

Fixed submission:
S = list(v for v in input())
T = list(v for v in input())
 
count = 0
 
for i in range(3):
  if S[i] == T[i]:
    count += 1
 
print(count)

Buggy submission (verdict: Runtime Error):
S = list(v for v in input())
T = list(v fot v in input())

count = 0

for i in range(3):
  if S[i] == T[i]:
    count += 1

print(count)
Problem p02922 (python)

Fixed submission:
A, B = map(int, input().split())

for i in range(20):
    if B <= A*i-(i-1):
        count = i
        break

print(count)

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

for i in range(11):
    if B <= A*i-(i-1):
        count = i
        break

print(count)

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

for i in range(1, 11):
    if A*i-(i-1) >= 0 and B <= A*i-(i-1):
        count = i
        break

print(count)

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

for i in range(1, 11):
    if B <= A*i-(i-1):
        count = i
        break

print(count)
Problem p02924 (python)

Fixed submission:
N = int(input())

print(N*(N-1)//2)

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

list = list(range(N))

print(sum(list))

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

list = list(range(1, N))

print(sum(list))
Problem p02999 (python)

Fixed submission:
X, A = map(int, input().split())

if X >= A:
  print(10)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
X, A = map(int, input())

if X >= A:
  print(10)
else:
  print(0)
Problem p03101 (python)

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

print(h*w - (h*b + w*a - a*b))

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

print(h*w - (h*b + w*a - a*b))
Problem p03243 (python)

Fixed submission:
import math


n = int(input())
print(111 * math.ceil(n / 111))

Buggy submission (verdict: Runtime Error):
import math


n = int(input())
print(111 * math.ceil(n / 111)

Buggy submission (verdict: Runtime Error):
from math import ceil


n = int(input())
print(111 * ceil(n // 111)

Buggy submission (verdict: Runtime Error):
from math import ceil


n = int(input())
print(111 * ceil(n / 111)
Problem p03281 (python)

Fixed submission:
n = int(input())


def count_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i:
        divisors.append(n//i)
  length = len(divisors)
  return length


l = []
for i in range(1, n + 1):
  if i % 2 == 0:
    continue
  else:
    if count_divisors(i) == 8:
      l.append(i)

      
print(len(l))

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


def count_divisors():
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i:
        divisors.append(n//i)
  length = len(divisors)
  return length


l = []
for i in range(1, n + 1):
  if i % 2 == 0:
    continue
  else:
    if count_divisors(i) == 8:
      l.append(i)

      
print(len(l))
Problem p03636 (python)

Fixed submission:
s = input()
print('{}{}{}'.format(s[0], str(len(s) - 2), s[-1]))

Buggy submission (verdict: Runtime Error):
s = input()
print(''.join(s[0], str(len(s) - 2), s[-1]))

Buggy submission (verdict: Runtime Error):
s = input()
print(''.join(s[0], len(s) - 2, s[-1]))
Problem p03102 (python)

Fixed submission:
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
cnt = 0
for _ in range(N):
  A = list(map(int, input().split()))
  cnt += int(sum([A[i] * B[i] for i in range(M)], C) > 0)
print(cnt)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
cnt = 0
for _ in range(N):
  A = list(map(int, input().split()))
  cnt += int(sum(A[i] * B[i] for i in range(M), C) > 0)
print(cnt)
Problem p03292 (python)

Fixed submission:
*a, = map(int, input().split())
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
*a = map(int, input().split())
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
*a = map(int, input().split())
print(max(a) - min(a))
Problem p03378 (python)

Fixed submission:
N, M, X = map(int, input().split())
A = list(map(int, input().split()))
cnt1 = 0
cnt2 = 0
i = X
j = X
while i <= N:
  if i in A:
    cnt1 += 1
  i += 1
while j >= 0:
  if j in A:
    cnt2 += 1
  j -= 1
print(min(cnt1, cnt2))

Buggy submission (verdict: Runtime Error):
N, M, X = map(int, input().split())
A = list(map(int, input().split()))
cnt1 = 0
cnt2 = 0
while i <= N:
  if i in A:
    cnt1 += 1
  i += 1
while i >= 0:
  if i in A:
    cnt2 += 1
  i -= 1
print(min(cnt1, cnt2))
Problem p02731 (python)

Fixed submission:
l = input();
l = int(l);
print((l/3)**3)

Buggy submission (verdict: Runtime Error):
l =input();
l = int(l);
print((L/3)^3)

Buggy submission (verdict: Runtime Error):
L = input();
print((L/3)^3)
Problem p02783 (python)

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

print(-(-a//b))

Buggy submission (verdict: Runtime Error):
h, n = (int(x) for x in input().split())
A = list(map(int, input().split()))

if n == len(A):
    if sum(A) >= h:
        print('yes')
    else:
        print('No')
Problem p02724 (python)

Fixed submission:
x = int(input())

a = x//500*1000
b = x%500//5*5

print(a+b)

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

500yen = x//500*1000
5yen = x%500//5*5

print(500yen + 5yen)

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

500yen = x//500*1000
5yen = (x - x//500)//5*5

print(500yen + 5yen)
Problem p02783 (python)

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

print((h - 1) // a + 1)

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

print((h - 1) // 4 + 1)
Problem p02761 (python)

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

s = []
c = []
num = []

for i in range(m):
    si, ci = map(int, input().split())
    s.append(si)
    c.append(ci)

if len(c) is 0:
    if n is 1:
        print(0)
        exit()
    elif n is 2:
        print(10)
        exit()
    else:
        print(100)
        exit()
        

for j in range(n):
    num.append(-1)

for k in range(len(s)):
    if s[k] is 1 and c[k] is 0 and n is not 1:
        print(-1)
        exit()
    if num[s[k]-1] is not -1 and num[s[k]-1] is not c[k]:
        print(-1)
        exit()
    else:
        num[s[k]-1] = c[k]

is_filled = False
for l in range(n):
    if num[l] is -1:
        if not is_filled:
            num[l] = 1
            is_filled = True
        else:
            num[l] = 0
    else:
        is_filled = True

print(''.join([str(x) for x in num]))

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

s = []
c = []
num = []

for i in range(n):
    num.append(-1)

for i in range(m):
    si, ci = map(int, input().split())
    s.append(si)
    c.append(ci)

for i in range(len(s)):
    # 桁条件の桁が桁数より大きい場合
    if s[i] > n:
        print(-1)
        exit()
    # ある桁の条件が矛盾している場合
    if num[s[i]-1] is not -1 and num[s[i]-1] is not c[i]:
        print(-1)
        exit()
    num[s[i]-1] = c[i]

# 先頭から条件指定されていない桁を削除していく
for i in range(len(num)):
    if num.index(-1) is i:
        del num[i]
    else:
        print(''.join([str(x) for x in num]).replace("-1", "0"))
        exit()

if num == []:
    print(-1)
else:
    print(num)
Problem p03493 (python)

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

Buggy submission (verdict: Runtime Error):
n = raw_input()
print(n.count("1"))
Problem p03543 (python)

Fixed submission:
s = input()


if s[0:3].count(s[0]) == 3 or s[1:4].count(s[3]) == 3:
  print("Yes")
else:
  print("No")

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


if s[0:3].count(s[0]) == 3 or s[1:4].count(s[3])
  print("Yes")
else:
  print("No")
Problem p03633 (python)

Fixed submission:
import fractions

def lcm(a,b):
    g = fractions.gcd(a,b)
    return (a * b)//g

n = int(input())

ans = 1
for i in range(n):
    t = int(input())
    ans = lcm(ans,t)

print(ans)

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

def lcm(a,b):
    g = gcd(a,b)
    return a/g * b

n = int(input())

ans = 1
for i in range(n):
    t = int(input())
    ans = lcm(ans,t)

print(int(ans))
Problem p03633 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np
import functools
import collections
mo = 1000000007
INF = 10**100
r = range

class infix(object):
    def __init__(self, function):
        self.function = function

    def __ror__(self, other):
        self.left = other
        return self

    def __or__(self, other):
        return self.function(self.left, other)

    def __call__(self, value1, value2):
        return self.function(value1, value2)

@infix
def c(f_t_u, f_u_r): return lambda t: f_u_r(f_t_u(t))

class _Ap(object):
    def __rlshift__(self, other):
        self.value = other
        return self

    def __rshift__(self, other):
        return other(self.value)
Ap = _Ap()
A = Ap

#d = {1:2, 3:5, 6:10, 1000043:3814}
#zip(d.keys(), d.values())<<ap>>(list |c| sorted |c| reversed |c| list |c| print)

def gcd(a,b):
    if a>b: a,b=b,a
    if a==0:return b
    return gcd(a, b%a)

n=input()<<A>>int
ret = 1
for i in range(n): a=int(input()); ret = ret * a // gcd(ret, a)
print(ret);

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np
import functools
import collections
mo = 1000000007
INF = 10**100
r = range

class infix(object):
    def __init__(self, function):
        self.function = function

    def __ror__(self, other):
        self.left = other
        return self

    def __or__(self, other):
        return self.function(self.left, other)

    def __call__(self, value1, value2):
        return self.function(value1, value2)

@infix
def c(f_t_u, f_u_r): return lambda t: f_u_r(f_t_u(t))

class _Ap(object):
    def __rlshift__(self, other):
        self.value = other
        return self

    def __rshift__(self, other):
        return other(self.value)
Ap = _Ap()
A = Ap

#d = {1:2, 3:5, 6:10, 1000043:3814}
#zip(d.keys(), d.values())<<ap>>(list |c| sorted |c| reversed |c| list |c| print)

n=input()<<A>>int
ret = 1
for i in range(n): a=int(input()); ret = ret * a // math.gcd(ret, a)
print(ret);

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np
import functools
import collections
mo = 1000000007
INF = 10**100
r = range

class infix(object):
    def __init__(self, function):
        self.function = function

    def __ror__(self, other):
        self.left = other
        return self

    def __or__(self, other):
        return self.function(self.left, other)

    def __call__(self, value1, value2):
        return self.function(value1, value2)

@infix
def c(f_t_u, f_u_r): return lambda t: f_u_r(f_t_u(t))

class _Ap(object):
    def __rlshift__(self, other):
        self.value = other
        return self

    def __rshift__(self, other):
        return other(self.value)
Ap = _Ap()
A = Ap

#d = {1:2, 3:5, 6:10, 1000043:3814}
#zip(d.keys(), d.values())<<ap>>(list |c| sorted |c| reversed |c| list |c| print)

n=input()<<A>>int
ret = 1
for i in range(n): a=int(input()); ret = ret * a // math.gcd(ret, a)
print(ret);
Problem p03713 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np

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

m = 10000000000000000000000000
m = min(m, (1 if h % 3 else 0) * w)
m = min(m, (1 if w % 3 else 0) * h)
for _ in range(2):
    for i in range(1, h+1):
        v = np.array([i*w, w//2*(h-i), (w-w//2)*(h-i)])
        m = min(m, max(v) - min(v))
    h, w = w, h

print(m)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np

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

m = math.inf
m = min(m, (1 if h % 3 else 0) * w)
m = min(m, (1 if w % 3 else 0) * h)
for _ in range(2):
    for i in range(1, h+1):
        v = np.array([i*w, w//2*(h-i), (w-w//2)*(h-i)])
        m = min(m, max(v) - min(v))
    h, w = w, h

print(m)
Problem p02921 (python)

Fixed submission:
s = input()
s2 = input()
cnt = 0
for st, st2 in zip(s, s2):
  if st == st2:
    cnt += 1
  
print(cnt)

Buggy submission (verdict: Runtime Error):
num = list(input().split(" "))
a = int(num[0])
b = int(num[1])

count = 1

while True:
  if count == 1:
  	plug = a
  else:
    plug = plug + (a - 1) 
  if plug >= b:
    break
  count += 1

print(count)

Buggy submission (verdict: Runtime Error):
cnt = int(input())
nums = list(input().split(" "))
current = 0
maxCnt = 0

for i in range(cnt - 1):
  if int(nums[i]) >= int(nums[i+1]):
    current += 1
  else:
    if maxCnt < current:
    	maxCnt = current
    current = 0

if maxCnt < current:
  maxCnt = current

print(maxCnt)
Problem p03643 (python)

Fixed submission:
print("ABC"+input())

Buggy submission (verdict: Runtime Error):
print("ABC"+inpit())
Problem p03657 (python)

Fixed submission:
import sys
a, b = map(int, input().split())
if a != 0 and a%3 == 0:
	print("Possible")
	sys.exit()
if b != 0 and b%3 == 0:
	print("Possible")
	sys.exit()
if a != 0 and b != 0 and (a+b)%3 == 0:
	print("Possible")
	sys.exit()

print("Impossible")

Buggy submission (verdict: Runtime Error):
import sys
a, b = map(int, input().split())
if a != 0 and a%3 = 0:
	print("Possible")
    sys.exit()
if b != 0 and b%3 = 0:
	print("Possible")
    sys.exit()
if a != 0 and b != 0 and (a+b)%3:
	print("Possible")
    sys.exit()

print("Impossible")
Problem p03796 (python)

Fixed submission:
import math
print(math.factorial(int(input()))%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
print(math.factrial(int(input))%(10**9+7))
Problem p03998 (python)

Fixed submission:
m={"a":list(input()),"b":list(input()),"c":list(input())}

t="a"
while True:
  if len(m[t]) > 0:
    t = m[t].pop(0)
  else:
    print(t.upper())
    break

Buggy submission (verdict: Runtime Error):
m={"A":list(input()),"B":list(input()),"C":list(input())}

t="A"
for i in range(100):
  if (len(m["A"]) == 0 and t == "A") or (len(m["C"]) == 0 and t == "B") or (len(m["C"]) == 0 and t == "C"):
    ans = t
    break
  c=m[t][0]
  for s in "ABC":
    if m[s][0] == c:
      m[s].pop(0)
  
  t=c.upper()
  
  
print(ans)