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

Fixed submission:
i = input()[::-1]
T = []
for t in ['dreamer', 'dream', 'eraser', 'erase']:
    T.append(t[::-1])

match = True
while match:
    match = False
    for t in T:
        if i.startswith(t):
            match = True
            i = i.replace(t, '', 1)
            if len(i) < 1:
                print('YES')
                exit()

print('NO')

Buggy submission (verdict: Runtime Error):
i = input().rstrip()

T = ['dreamer', 'dream', 'eraser', 'erase']

def exec(s):
    for t in T:
        if s.startswith(t):
            n = s.replace(t, '', 1)
            if len(n) == 0:
                print('YES')
                exit()
            else:
                exec(n)

exec(i)
print('NO')

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

T = ['dreamer', 'dream', 'eraser', 'erase']

def exec(s):
    for t in T:
        if s.startswith(t):
            n = s.replace(t, '', 1)
            if len(n) == 0:
                print('YES')
                exit()
            else:
                exec(n)

exec(i)
print('NO')

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

T = ['dreamer', 'dream', 'eraser', 'erase']

ans = False

def exec(s):
    for t in T:
        if s.startswith(t):
            n = s.replace(t, '', 1)
            if len(n) == 0:
                print('YES')
                exit()
            else:
                exec(n)

exec(i)
print('NO')
Problem p04001 (python)

Fixed submission:
import sys

S = list(map(int, sys.stdin.readline().strip()))
len_S = len(S)
ans = 0
for i in range(2 ** (len_S - 1)):
  sum_ = S[len_S - 1]
  cursor = len_S - 1
  power = 0
  while cursor > 0:
    cursor -= 1 
    if i % 2 == 1:
      power += 1
    else:
      power = 0
    sum_ += S[cursor] * (10 ** power)
    i >>= 1
  ans += sum_
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

S = list(map(int, sys.stdin.readline()))
len_S = len(S)
ans = 0
for i in range(2 ** (len_S - 1)):
  sum_ = S[len_S - 1]
  cursor = len_S - 1
  power = 0
  pattern = i
  while cursor > 0:
    cursor -= 1 
    if pattern % 2 == 1:
      power += 1
    else:
      power = 0
    sum_ += S[cursor] * (10 ** power)
    pattern = pattern // 2
  ans += sum_
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

S = list(map(int, sys.stdin.readline()))
len_S = len(S)
ans = 0
for i in range(2 ** (len_S - 1)):
  sum_ = S[len_S - 1]
  cursor = len_S - 1
  power = 0
  pattern = i
  while cursor > 0:
    cursor -= 1 
    if pattern % 2 == 1:
      power += 1
    else:
      power = 0
    sum_ += S[cursor] * (10 ** power)
    pattern //= 2
  ans += sum_
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

S = list(map(int, sys.stdin.readline()))
len_S = len(S)
ans = 0
for i in range(2 ** (len_S - 1)):
  sum_ = S[len_S - 1]
  cursor = len_S - 1
  power = 0
  pattern = i
  while cursor > 0:
    cursor -= 1 
    if pattern % 2 == 1:
      power += 1
    else:
      power = 0
    sum_ += S[cursor] * (10 ** power)
    pattern >>= 1
  ans += sum_
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

S = list(map(int, list(sys.stdin.readline())))
len_S = len(S)
ans = 0
for i in range(2 ** (len_S - 1)):
  sum_ = S[len_S - 1]
  cursor = len_S - 1
  power = 0
  while cursor > 0:
    cursor -= 1 
    if i % 2 == 1:
      power += 1
    else:
      power = 0
    sum_ += S[cursor] * (10 ** power)
    i >>= 1
  ans += sum_
      
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

S = list(map(int, sys.stdin.readline()))
len_S = len(S)
ans = 0
for i in range(2 ** (len_S - 1)):
  sum_ = S[len_S - 1]
  cursor = len_S - 1
  power = 0
  while cursor > 0:
    cursor -= 1 
    if i % 2 == 1:
      power += 1
    else:
      power = 0
    sum_ += S[cursor] * (10 ** power)
    i >>= 1
  ans += sum_
      
print(ans)
Problem p03284 (python)

Fixed submission:
def test():
    n,k = map(int,input().split())
    print(0 if n % k == 0 else 1)


if __name__ == "__main__":
    test()

Buggy submission (verdict: Runtime Error):
def test():
    n,k = map(int,input().split())
    a = int(n / k)
    b = int(n % a)

    if b == 0:
        print(b)
    else:
        print(abs(a-b))


if __name__ == "__main__":
    test()
Problem p03289 (python)

Fixed submission:
def test():
    s = input()
    a = []
    count = 0
    if s[0] == "A":
        for i in range(2,len(s)-1):
            if s[i] == "C":
                a.append(i)
                count += 1

    s2 = list(s)
    for i in a:
        s2.remove(s[i])

    s3 = "".join(s2[1:])

    if count == 1 and s3.islower():
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    test()

Buggy submission (verdict: Runtime Error):
def test():
    s = input()
    a = []
    count = 0
    if s[0].isupper():
        for i in range(2,len(s)-1):
            if s[i] == "C":
                a.append(i)
                count += 1

    s2 = list(s)
    for i in a:
        s2.remove(s2[i])

    s3 = "".join(s2[1:])

    if count == 1 and s3.islower():
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    test()
Problem p03324 (python)

Fixed submission:
def test():
    d,n = map(int,input().split())
    if n == 100:
        n += 1
    print(100**d*n)


if __name__ == "__main__":
    test()

Buggy submission (verdict: Runtime Error):
def test():
    d,n = map(int,input().split())
    if d == 0:
        a = [i for i in range(1,n+1) if int(i/100)==0 or i%100 != 0]
        print(a[n])
    elif d == 1:
        a = [i for i in range(1,n+1) if int(i/100)==1]
        print(a[n])
    elif d == 2:
        a = [i for i in range(1,n+1) if int(i/100)==2]
        print(a[n])


if __name__ == "__main__":
    test()
Problem p03625 (python)

Fixed submission:
def test():
    n = int(input())
    a = list(map(int,input().split()))
    a.sort()
    b = []
    i = 0
    while i + 1 < n:
        if a[i] == a[i+1]:
            b.append(a[i])
            i += 2
        else:
            i += 1
    print(b[-1]*b[-2] if len(b)>=2 else 0)


if __name__ == "__main__":
    test()

Buggy submission (verdict: Runtime Error):
def test():
    n = int(input())
    a = list(map(int,input().split()))
    a.sort()
    print(a)
    b = []
    i = 0
    while i + 1 < n:
        if a[i] == a[i+1]:
            b.append(a[i])
            i += 2
        else:
            i += 1
    print(b[-1]*b[-2])



if __name__ == "__main__":
    test()
Problem p03141 (python)

Fixed submission:
#!/usr/bin/env python3

n = int(input())
A = [tuple(int(x) for x in input().split()) for i in range(n)]
A.sort(key=lambda ab: -(ab[0] + ab[1]))
print(sum(a for a, _ in A[::2]) - sum(b for _, b in A[1::2]))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

import functools

def cmp1(p0, p1):
    (_, t0, a0), (_, t1, a1) = p0, p1
    return (t1 - a0) - (t0 - a1)

def cmp2(p0, p1):
    (_, t0, a0), (_, t1, a1) = p0, p1
    return (a1 - t0) - (a0 - t1)

n = int(input())
AB = [tuple((i, *(int(x) for x in input().split()))) for i in range(n)]

A = sorted(AB, key=functools.cmp_to_key(cmp1))
B = sorted(AB, key=functools.cmp_to_key(cmp2))
used = {-1}
a, b = -1, -1
ans = 0

for _ in range(n // 2):
    while a in used:
        a, s, _ = A.pop(0)
    used.add(a)
    ans += s

    while b in used:
        b, _, s = B.pop(0)
    used.add(b)
    ans -= s

if n % 2 == 1:
    while a in used:
        a, s, _ = A.pop(0)
    used.add(a)
    ans += s

print(ans)
Problem p04033 (python)

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

if a > 0:
    print('Positive')
elif a <= 0 and 0 <= b:
    print('Zero')
elif (b - a) % 2 == 0:
    print('Negative')
else:
    print('Positive')

Buggy submission (verdict: Runtime Error):
n, l = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
dp = [[None] * n for _ in range(n)]

Aacc = [A[0]]
for i in range(1, n):
    Aacc.append(Aacc[i - 1] + A[i])

def length(a, b):
    return Aacc[b] - (Aacc[a - 1] if a > 0 else 0)

def search(a, b):
    if dp[a][b] is None:
        if a == b:
            ans = []
        elif length(a, b) >= l:
            for cut in range(a, b):
                left = search(a, cut)
                if left is not False:
                    right = search(cut + 1, b)
                    if right is not False:
                        ans = [cut] + left + right
                        break
            else:
                ans = False
        else:
            ans = False

        dp[a][b] = ans

    return dp[a][b]

ans = search(0, n - 1)
if ans is False:
    print('Impossible')
else:
    print('Possible')
    for a in ans:
        print(a + 1)
Problem p03324 (python)

Fixed submission:
L, R = map(int,input().split())
print((100**L)*(int((R-1)/99)+R))

Buggy submission (verdict: Runtime Error):
L, R = map(int,input().split())
print((100**L)*(int((R-1)/99)+R)
Problem p03545 (python)

Fixed submission:
target = input()
length = len(target)
binary = length - 1
target_list = []
for i in range(length):
    if i:
        target_list.append("")
    target_list.append(target[i])
for bit in range(binary ** 2):
    temp = target_list.copy()
    for i in range(binary):
        if bit & (1 << i):
            temp[1 + 2 * i] = "+"
        else:
            temp[1 + 2 * i] = "-"
    temp = "".join(temp)
    if eval(temp) == 7:
        print(temp + "=7")
        break

Buggy submission (verdict: Runtime Error):
nums = [n for n in input()]
ope = ["+", "-"]
for b in range(2 ** 3):
    temp = nums[0]
    for i in range(3):
        temp += ope[b & (1 << i)] + nums[i + 1]
    if eval(temp) == 7:
        print(temp+"=7")
        break

Buggy submission (verdict: Runtime Error):
nums = [n for n in input()]
ope = ["+", "-"]
for b in range(2 ** 3):
    temp = nums[0]
    for i in range(3):
        temp += f"{ope[b & (1 << i)]}{nums[i + 1]}"
    if eval(temp) == 7:
        print(temp+"=7")
        break

Buggy submission (verdict: Runtime Error):
nums = [n for n in input()]
ope = ["+", "-"]
for b in range(2 ** 3):
    temp = nums[0]
    for i in range(3):
        temp += f"{ope[b & (1 << i)]}{nums[i + 1]}"
    if eval(temp) == 7:
        print(temp)
        break
Problem p04001 (python)

Fixed submission:
target = input()
length = len(target)
binary = length - 1
target_list = []
answers = 0
for i in range(length):
    if i:
        target_list.append("")
    target_list.append(target[i])
for bit in range(2 ** binary):
    temp = target_list.copy()
    for i in range(binary):
        if bit & (1 << i):
            temp[1 + 2 * i] = "+"
    # print(temp, bit)
    answers += eval("".join(temp))
print(answers)

Buggy submission (verdict: Runtime Error):
target = input()
length = len(target)
binary = length - 1
target_list = []
answers = 0
for i in range(length):
    if i:
        target_list.append("")
    target_list.append(target[i])
for bit in range(2 ** binary):
    temp = target_list.copy()
    for i in range(binary):
        if bit & (1 << i):
            temp[1 + 2 * i] = "+"
    # print(temp, bit)
    answers += eval("".join(temp))
print(answers)
Problem p04006 (python)

Fixed submission:
loop, magic_cost = map(int, input().split(" "))
cost = [n for n in map(int, input().split(" "))]
answer = float("inf")
min_costs = [float("inf") for n in range(loop)]
for i in range(loop):
    for j in range(loop):
        min_costs[j] = min(min_costs[j], cost[(i - j) % loop])
    answer = min(answer, sum(min_costs) + (magic_cost * (i) ) )
print(answer)

Buggy submission (verdict: Runtime Error):
loop, magic_cost = map(int, input().split(" "))
cost = [n for n in map(int, input().split(" "))]
answer = float("inf")
min_costs = [float(inf) for n in range(loop)]
for i in range(loop):
    for j in range(loop):
        min_costs[j] = min(min_costs[j], cost[(i - j) % loop])
    answer = min(answer, sum(min_costs) + (magic_cost * (i) ) )
print(answer)
Problem p03577 (python)

Fixed submission:
s=input()
print(s[:-8])

Buggy submission (verdict: Runtime Error):
s=input()
print(s-"FESTIVAL")
Problem p02801 (python)

Fixed submission:
x = input()
if x =='a':
    print('b')
if x =='b':
    print('c')
if x =='c':
    print('d')
if x =='d':
    print('e')
if x =='e':
    print('f')
if x =='f':
    print('g')
if x =='g':
    print('h')
if x =='h':
    print('i')
if x =='i':
    print('j')
if x =='j':
    print('k')
if x =='k':
    print('l')
if x =='l':
    print('m')
if x =='m':
    print('n')
if x =='n':
    print('o')
if x =='o':
    print('p')
if x =='p':
    print('q')
if x =='q':
    print('r')
if x =='r':
    print('s')
if x =='s':
    print('t')
if x =='t':
    print('u')
if x =='u':
    print('v')
if x =='v':
    print('w')
if x =='w':
    print('x')
if x =='x':
    print('y')
if x =='y':
    print('z')

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K, M = map(int,input().split())
A = list(map(int,input().split()))
A = np.array(A)
if M*N-np.mean(A)*(N-1) < 0:
    print(0)
elif M*N-np.mean(A)*(N-1)<K:
    print(Decimal(str(M*N-np.mean(A)*(N-1))).quantize(Decimal('0'), rounding=ROUND_HALF_UP))
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
nput()
if x =='a':
    print('b')
if x =='b':
    print('c')
if x =='c':
    print('d')
if x =='d':
    print('e')
if x =='e':
    print('f')
if x =='f':
    print('g')
if x =='g':
    print('h')
if x =='h':
    print('i')
if x =='i':
    print('j')
if x =='j':
    print('k')
if x =='k':
    print('l')
if x =='l':
    print('m')
if x =='m':
    print('n')
if x =='n':
    print('o')
if x =='o':
    print('p')
if x =='p':
    print('q')
if x =='q':
    print('r')
if x =='r':
    print('s')
if x =='s':
    print('t')
if x =='t':
    print('u')
if x =='u':
    print('v')
if x =='v':
    print('w')
if x =='w':
    print('x')
if x =='x':
    print('y')
if x =='y':
    print('z')
Problem p02909 (python)

Fixed submission:
s = input()
d = {"Sunny": "Cloudy", "Cloudy": "Rainy",  "Rainy": "Sunny"}
print(d[s])

Buggy submission (verdict: Runtime Error):
s = input()
if s == "Sunny":
    print("Cloudy")
else if s == "Cloudy":
    print("Rainy"):
else:
    print("Sunny")
Problem p02947 (python)

Fixed submission:
def main():
    n = int(input())
    array_s = []
    array = []
    for i in range(n):
        array_s.append(input())
 
    for s in array_s:
        array.append(''.join(sorted(s)))
    array = sorted(array)
    ans = 0
    count = 1
    for i in range(n-1):
        if array[i] == array[i+1]:
            count += 1
            if i != n-2:
                continue
        ans += int(count*(count-1)/2)
        count = 1
    print(ans)
 
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)
      
      
n = int(input())
sn = {}
sn_list = []
for i in range(n):
    s = input()
    sn_list.append(s)
for s in sn_list:
    s = "".join(sorted(s))
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1

count = 0
for v in sn.values():
    count += sigma(v)
print(count)

Buggy submission (verdict: Runtime Error):
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)

n = int(input())
sn = {}
sn_list = []
for i in range(n):
    s = input()
    sn_list.append(s)
for s in sn_list:
    s = "".join(sorted(s))
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1
        
        
count = 0
for v in sn.values():
    count += sigma(v)
print(count)

Buggy submission (verdict: Runtime Error):
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)
      
      
      
n = int(input())
sn = {}
sn_list = []
for i in range(n):
    s = "".join(sorted(input()))
    sn_list.append(s)
for s in sn_list:
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1
        
        
count = 0
for v in sn.values():
    count += sigma(v)
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
sn = {}
for i in range(n):
    s = "".join(sorted(input()))
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1
        
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)
      
      
count = 0
for v in sn.values():
    count += sigma(v)
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
sn = {}
for i in range(n):
    s = "".join(sorted(input()))
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1
        
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)
      
count = 0
for v in sn.values():
    count += sigma(v)
print(count)

Buggy submission (verdict: Runtime Error):
def sigma(c):
    if c == 1:
        return 1
    elif c == 0:
        return 0
    else:
        return c + sigma(c-1)

n = int(input())
sn = {}
for i in range(n):
    s = "".join(sorted(input()))
    if not(s in sn):
        sn[s] = 0
    else:
        sn[s] += 1
        
count = 0
for v in sn.values():
    count += sigma(v)
print(count)
Problem p02971 (python)

Fixed submission:
n = int(input())
an = []
max_1 = 1
max_2 = 1
count = 1
max1_index = [0]
for i in range(n):
    a = int(input())
    if a > max_1:
        tmp = max_1
        max_1 = a
        count = 1
        max1_index = [i]
        max_2 = tmp
    elif a == max_1:
        count += 1
        max1_index.append(i)
    elif max_1 >  a > max_2:
        max_2 = a
    an.append(a)
if count == 1:
    for i in range(n):
        if i in max1_index:
            print(max_2)
        else:
            print(max_1)
else:
    for i in range(n):
        print(max_1)

Buggy submission (verdict: Runtime Error):
n = int(input())
an = []
max_1 = 1
max_2 = 1
count = 1
for i in range(n):
    a = int(input())
    if a > max_1:
        tmp = max_1
        max_1 = a
        count = 1
        max1_index = [i]
        max_2 = tmp
    elif a == max_1:
        count += 1
        max1_index.append(i)
    elif max_1 >  a > max_2:
        max_2 = a
    an.append(a)
    
if count == 1:
    for i in range(n):
        if i in max1_index:
            print(max_2)
        else:
            print(max_1)
else:
    for i in range(n):
        print(max_1)

Buggy submission (verdict: Runtime Error):
n = int(input())
an = []
max_1 = 1
max_2 = 1
count = 1
for i in range(n):
    a = int(input())
    if a > max_1:
        max_1 = a
        count = 1
        max1_index = [i]
    elif a == max_1:
        count += 1
        max1_index.append(i)
    elif max_1 > a and a > max_2:
        max_2 = a
        max2_index = i
    an.append(a)
    
    
if count == 1:
    for i in range(n):
        if i in max1_index:
            print(max_2)
        else:
            print(max_1)
else:
    for i in range(n):
        print(max_1)
Problem p02983 (python)

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

l = lr[0]
r = lr[1]

ans=2018
tr=min(2019, r-l)
for i in range(l, l+tr):
    for j in range(l+1, l+tr+1):
        ans = min(ans, (i*j)%2019)
        
        
print(ans)

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())
l = lr[0]
r = lr[1]
 
ans=2019
l_2019 = l % 2019
r_2019 = r % 2019
 
for i in range(l_2019,r_2019):
    for j in range(i+1, r_2019+1):
        new_ans = (i * j) % 2019
        if new_ans < ans:
            ans = new_ans
        
print(ans)

Buggy submission (verdict: Runtime Error):
l = lr[0]
r = lr[1]
 
ans=2019
l_2019 = l % 2019
r_2019 = r % 2019
 
for i in range(l_2019,r_2019):
    for j in range(i+1, r_2019+1):
        new_ans = (i * j) % 2019
        if new_ans < ans:
            ans = new_ans
        
print(ans)
Problem p03000 (python)

Fixed submission:
nx = list(map(int, input().split()))
ln = list(map(int, input().split()))
n = nx[0]
x = nx[1]

dn = 0
count = 1
for i in range(0, n, 1):
    dn += ln[i]
    if dn > x:
        break
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
nx = list(map(int, input().split()))
ln = list(map(int, input().split()))
n = nx[0]
x = nx[1]

dn = 0
count = 1
for i in range(0, n+1, 1):
    dn += ln[i]
    if dn > x:
        break
    count += 1
print(count)
Problem p03206 (python)

Fixed submission:
d = int(input())

if d == 25:
  print("Christmas")
elif d == 24:
  print("Christmas Eve")
elif d == 23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")

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


h = []
for i in range(N):
  h.append(int(input()))
  
  
h.sort()
ans = h[-1] - h[0]

for i in range(N-K+1):
  ans = min(ans, h[i+K-1] - h[i])
print(ans)

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


p = []
for i in range(N):
  p.append(int(input()))
  
p_max = p.index(max(p))


p[p_max] = p[p_max] / 2 

print(int(sum(p)))

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

if D == 25:
 print("Christmas")
else if D == 24:
 print("Christmas Eve")
else if D== 23:
 print("Christmas Eve Eve")
else:
 print("Christmas Eve Eve Eve")
Problem p03061 (python)

Fixed submission:
import fractions
from functools import reduce

n = int(input())
a = [int(_) for _ in input().split()]
left, right, ans = ([0], [0], 0)

for i in range(n):
    left.append(fractions.gcd(left[i], a[i]))
    right.append(fractions.gcd(right[i], a[n-i-1]))

for i in range(n):
    g = fractions.gcd(left[i], right[n-i-1])
    if ans < g:
        ans = g

print(ans)

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

n = int(input())
a = [int(_) for _ in input().split()]
ans = 0

for i in range(n):
    r = reduce(math.gcd, a[:i] + a[i+1:])
    if ans < r:
        ans = r

print(ans)
Problem p03323 (python)

Fixed submission:
a, b = [int(_) for _ in input().split()]
print('Yay!' if a <= 8 and b <= 8 else ':(')

Buggy submission (verdict: Runtime Error):
a, b = [int(_) for _ in input().split())]
print('Yay!' if a <= 8 and b <= 8 else ':()')
Problem p03962 (python)

Fixed submission:
print(len(set((int(i) for i in input().split()))))

Buggy submission (verdict: Runtime Error):
i = lambda: int(input())
print(len(set([i(), i(), i()])))
Problem p02843 (python)

Fixed submission:
X = int(input())
c = X // 100

if (c * 100) <= X <= (c * 105):
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import sys
X = input()

if int(X) < 100:
    print(0)
    sys.exit(1)
    
tmp = int(X[-2] + X[-1])

iteration = 0

for i in range(5, 0, -1):
    iteration = tmp // i
    tmp %= i
    
    if tmp == 0:
        break

if (iteration * 100) >= int(X):
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
X = input()
tmp = int(X[-2] + X[-1])

iteration = 0

for i in range(5, 0, -1):
    iteration = tmp // i
    tmp %= i
    
    if tmp == 0:
        break

if (iteration * 100) >= int(X):
    print(1)
else:
    print(0)
Problem p03262 (python)

Fixed submission:
from fractions import gcd
from functools import reduce


def gcd_expand(values):
    return reduce(gcd, values)


N, X = map(int, input().split())
x = map(int, input().split())

x_abs = [abs(X - i) for i in x]
print(gcd_expand(x_abs))

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


def gcd_expand(values):
    return reduce(gcd, values)


N, X = map(int, input().split())
x = map(int, input().split())

x_abs = [abs(X - i) for i in x]
print(gcd_expand(x_abs))