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

Fixed submission:
from scipy.misc import comb


def solve(string):
    n, k = map(int, string.split())
    ans = []
    for i in range(1, k + 1):
        base = comb(n - k + 1, i, exact=True)
        var = comb(k - 1, i - 1, exact=True)
        ans.append(str(base * var % (10**9 + 7)))
    return "\n".join(ans)


if __name__ == '__main__':
    print(solve(input()))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb


def solve(string):
    n, k = map(int, string.split())
    ans = []
    for i in range(1, k + 1):
        base = comb(n - k + 1, i, exact=True)
        var = comb(k - 1, i - 1, exact=True)
        ans.append(str(base * var % (10**9 + 7)))
    return "\n".join(ans)


if __name__ == '__main__':
    print(solve(input()))
Problem p03038 (python)

Fixed submission:
def solve(string):
    n, m, *abc = map(int, string.split())
    a = sorted(abc[:n])
    bc = sorted(list(zip(*[iter(abc[n:])] * 2)), key=lambda x: x[1])
    i = 0
    ans = 0
    for b, c in bc[::-1]:
        start = i
        while i < n and a[i] < c and b > 0:
            i += 1
            b -= 1
            ans += c
        if start == i:
            break
    ans += sum(a[i:]) if i < n else 0
    return str(ans)


if __name__ == '__main__':
    n, m = map(int, input().split())
    print(solve('{} {}\n'.format(n, m) + '\n'.join([input() for _ in range(m + 1)])))

Buggy submission (verdict: Runtime Error):
def solve(string):
    n, m, *abc = map(int, string.split())
    a = sorted(abc[:n])
    bc = sorted(list(zip(*[iter(abc[n:])] * 2)), key=lambda x: x[1])
    i = 0
    ans = 0
    for b, c in bc[::-1]:
        start = i
        while a[i] < c and b > 0:
            i += 1
            b -= 1
            ans += c
        if start == i:
            break
    ans += sum(a[i:])
    return str(ans)


if __name__ == '__main__':
    n, m = map(int, input().split())
    print(solve('{} {}\n'.format(n, m) + '\n'.join([input() for _ in range(m + 1)])))
Problem p03072 (python)

Fixed submission:
def solve(string):
    n, *h = map(int, string.split())
    count = 1
    for i in range(1, n):
        if max(h[:i]) <= h[i]:
            count += 1
    return str(count)


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

Buggy submission (verdict: Runtime Error):
def solve(string):
    n, *h = map(int, string.split())
    count = 1
    for i in range(1, n):
        if max(h[:i]) <= h[i]:
            count += 1
    return str(count)


if __name__ == '__main__':
    print(solve(input()))
Problem p03075 (python)

Fixed submission:
def solve(string):
    a, *_, e, k = map(int, string.split())
    return "Yay!" if e - a <= k else ":("


if __name__ == '__main__':
    print(solve('\n'.join([input() for _ in range(6)])))

Buggy submission (verdict: Runtime Error):
def solve(string):
    a, *_, e, k = map(int, string.split())
    return "Yay!" if e - a <= k else ":("


if __name__ == '__main__':
    print(solve(input()))
Problem p03127 (python)

Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from fractions import gcd
from functools import reduce


def solve(string):
    n, *a = map(int, string.split())
    return str(reduce(gcd, a))


if __name__ == '__main__':
    print(solve("\n".join([input(), input()])))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from math import gcd
from functools import reduce


def solve(string):
    n, *a = map(int, string.split())
    return str(reduce(gcd, a))


if __name__ == '__main__':
    print(solve("\n".join([input(), input()])))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from math import gcd
from functools import reduce


def solve(string):
    n, *a = map(int, string.split())
    return str(reduce(gcd, a))


if __name__ == '__main__':
    print(solve("4\n2 10 8 40"))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from math import gcd
from functools import reduce


def solve(string):
    n, *a = map(int, string.split())
    return str(reduce(gcd, a))


if __name__ == '__main__':
    print(solve("4\n2 10 8 40"))
Problem p03137 (python)

Fixed submission:
import numpy as np


def solve(string):
    n, m, *x = map(int, string.split())
    x = sorted(np.diff(sorted(x)))
    return str(sum(x)) if n == 1 else str(sum(x[:-n + 1]))


if __name__ == '__main__':
    print(solve("\n".join([input(), input()])))

Buggy submission (verdict: Runtime Error):
import numpy as np
def solve(string):
    n, m, *x = map(int, string.split())
    x = np.asarray(sorted(x))
    return str(sum(sorted(np.diff(x))[:-n+1]))



if __name__ == '__main__':
    print(solve("\n".join([input(), input()])))
Problem p03208 (python)

Fixed submission:
def solve(string):
    n, k = map(int, string.split("\n")[0].split(" "))
    ins = list(map(int, string.split("\n")[1:]))
    ins.sort()
    return str(min([ins[i + k - 1] - ins[i] for i in range(len(ins) - k + 1)]))


if __name__ == '__main__':
    n, k = map(int, input().split(" "))
    ins = [input() for _ in range(n)]
    print(solve("{} {}\n{}".format(n, k, "\n".join(ins))))

Buggy submission (verdict: Runtime Error):
ef solve(string):
    n, k = map(int, string.split("\n")[0].split(" "))
    ins = list(map(int, string.split("\n")[1:]))
    ins.sort()
    return str(min([ins[i + k - 1] - ins[i] for i in range(len(ins) - k + 1)]))


if __name__ == '__main__':
    n, k = map(int, input().split(" "))
    ins = [input() for _ in range(n)]
    print(solve("{} {}\n{}".format(n, k, "\n".join(ins))))
Problem p03221 (python)

Fixed submission:
import time
import numpy as np

# def solve(n, m, py):
"""
n, m = map(int, input().split())
py = [list(map(int, input().split())) for _ in range(m)]
"""

n, m = map(int, input().split())
py = [list(map(int, input().split())) for _ in range(m)]
p = [[] for _ in range(n)]
start = time.time()
for _p, _y in py:
    p[_p - 1].append(_y)
# print(time.time() - start)
for i in range(n):
    p[i] = np.argsort(np.argsort(p[i]))

# print(time.time() - start)
counter = [0 for _ in range(n)]
for _p, _y in py:
    # print("{:06}{:06}".format(_p, p[_p - 1].index(_y) + 1))
    # t = "{:06}{:06}".format(_p, p[_p - 1].index(_y) + 1)
    # print(counter[_y])
    t = "{:06}{:06}".format(_p, p[_p - 1][counter[_p - 1]] + 1)
    print(t)
    counter[_p - 1] += 1

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


n, m = map(int, input().split())
py = [list(map(int, input().split())) for _ in range(m)]
p = [[] for _ in range(n)]
start = time.time()
for _p, _y in py:
    p[_p - 1].append(_y)
for i in range(n):
    p[i] = np.argsort(np.argsort(p[i]))

counter = [0 for _ in range(n)]
for _p, _y in py:
    t = "{:06}{:06}".format(_p, p[_p - 1][counter[_p - 1]] + 1)
    print(t)
    counter[_p - 1] += 1

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


def solve(string):
    n, m, *py = map(int, string.split())
    p = [[] for _ in range(n)]
    for _p, _y in py:
        p[_p - 1].append(_y)
    for i in range(n):
        p[i] = np.argsort(np.argsort(p[i]))
    counter = [0 for _ in range(n)]
    for _p, _y in py:
        t = "{:06}{:06}".format(_p, p[_p - 1][counter[_p - 1]] + 1)
        print(t)
        counter[_p - 1] += 1
        p[i] = np.argsort(np.argsort(p[i]))


if __name__ == '__main__':
    n, m = map(int, input().split())

    print(solve("{} {}\n".format(n, m) + "\n".join([input() for _ in range(m)])))
Problem p03252 (python)

Fixed submission:
s = input()
t = input()

c_s = sorted([s.count(_c) for _c in set(s)])
c_t = sorted([t.count(_c) for _c in set(t)])

if c_s == c_t:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
def solve(string):
    s, t = map(int, string.split())

    c_s = sorted([s.count(_c) for _c in set(s)])
    c_t = sorted([t.count(_c) for _c in set(t)])

    if c_s == c_t:
        return "Yes"
    else:
        return "No"


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))
Problem p03426 (python)

Fixed submission:
import numpy as np

h, w, d = map(int, input().strip().split(" "))
a = [[int(i) for i in input().strip().split(" ")] for _ in range(h)]
q = int(input().strip())
lr = [input().strip().split(" ") for _ in range(q)]
rs = [None for _ in range(h * w)]
cs = [None for _ in range(h * w)]
for _r, _a in enumerate(a):
    for _c, __a in enumerate(_a):
        rs[__a - 1] = _r
        cs[__a - 1] = _c
rs_d = [rs[i::d] for i in range(d)]
cs_d = [cs[i::d] for i in range(d)]
costs = [
    np.cumsum(
        np.abs(np.array(_rs[1:]) - np.array(_rs[:-1])) +
        np.abs(np.array(_cs[1:]) - np.array(_cs[:-1]))) for _rs, _cs in zip(rs_d, cs_d)
]
for l, r in lr:
    l = int(l) - 1
    r = int(r) - 1
    if l == r:
        print(0)
    elif l < d:
        print(costs[r % d][r // d - 1])
    else:
        print(costs[r % d][r // d - 1] - costs[l % d][l // d - 1])

Buggy submission (verdict: Runtime Error):
from functools import partial
from itertools import islice


def take(n, iterable):
    return list(islice(iterable, n))


def chunked(iterable, n):
    return iter(partial(take, n, iter(iterable)), [])


def distance(x, y):
    return abs(x[0] - y[0]) + abs(x[1] - y[1])


def solve(s):
    h, w, d, *aqlr = map(int, s.split())
    n = h * w
    pos = [(i // w, i % w) for i, _a in enumerate(aqlr[:n])]
    cost = [0] * (n + 1)
    for i in range(d + 1, n + 1):
        cost[i] = cost[i - d] + distance(pos[i - d], pos[i])
    return "\n".join(["%d" % (cost[r] - cost[l]) for l, r in chunked(aqlr[n + 1:], 2)])


n, m, d = map(int, input().split())
l = '{} {} {}\n'.format(n, m, d) + '\n'.join([input() for _ in range(n)])
q, = map(int, input().split())
l += '\n{}\n'.format(q) + '\n'.join([input() for _ in range(q)])
print(solve(l))
Problem p03272 (python)

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

Buggy submission (verdict: Runtime Error):
l = list(map(input().split()))
print(l[0]-l[1]+1)
Problem p02754 (python)

Fixed submission:
n, a, b = map(int,input().split())
if a == 0 and b == 0:
    print(0)
if a != 0 or b != 0:
         
    kumi = n // (a + b)
    nokori = n % (a + b)
    if nokori == 0:
        print(a * kumi)
    elif nokori >= 1 and nokori < a:
        print(a * kumi + nokori)
    elif nokori >= a:
        print(a * kumi + a)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
l = ""
cnt = 0
n1 = "b" * A
n2 = "r" * B
for i in range(N + 2):
    l += n1 + n2
   
for j in l[0 : N]:
    if j == "b":
        cnt += 1
          
print(cnt)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
l = ""
cnt = 0
for i in range(N + 1):
    n1 = "b" * A
    n2 = "r" * B
    l += n1 + n2
    
for j in l[0 : N]:
    if j == "b":
        cnt += 1
          
print(cnt)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
l = ""
cnt = 0
for i in range(10 **100):
    n1 = "b" * A
    n2 = "r" * B
    l += n1 + n2
    for j in range(N):
       if j == "b":
           cnt += 1
print(cnt)
Problem p02859 (python)

Fixed submission:
num = int(input())
print(int(num * num))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if max(a,b) <= 9:
    print(int(a * b))

else:
    print(-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a >= 10 or b >= 10:
    print(int(a * b))

else:
    print(-1)
Problem p02879 (python)

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

if max(a, b) <= 9:
  print(a * b)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
if a >= 10 or b >= 10:
    print(int(a * b))

else:
    print(-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
if a >= 10 or b >= 10:
    print(a * b)

else:
    print(-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
if a >= 10 or a >= 10:
    print(a * b)

else:
    print(-1)
Problem p02916 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ap = 0
ad = 0
for i in a:
    ap += b[i - 1]
    
for j in range(1, len(a)):
    
    if a[j] - a[j - 1] == 1:
            ad += c[a[j - 1] - 1]

print(ap + ad)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ap = 0
ad = 0
for i in a:
    ap += b[i - 1]
    
for j in range(1, len(a)):
    
    if a[j] - a[j - 1] == 1:
            ad += c[j]

print(ap + ad)
Problem p03011 (python)

Fixed submission:
l= list(map(int, input().split()))
print(sum(l) - max(l))

Buggy submission (verdict: Runtime Error):
l= map(int, input().split())
print(sum(l) - max(l))
Problem p03327 (python)

Fixed submission:
N = int(input())
if N >= 1000:
    print("ABD")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
N = input()
if N >= 1000:
    print("ABD")
else:
    print("ABC")
Problem p03631 (python)

Fixed submission:
l = str(input())
if l[0] == l[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l = int(input())
if l[0] == l[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l = int(input())
if l[0] = l[2]:
    print("Yes")
else:
    print("No")
Problem p03775 (python)

Fixed submission:
N = int(input())
l = []
for A in range(1, int(N ** 0.5) + 1):
    B = N // A
    if N == A * B:
        
        l.append(max(len(str(A)), len(str(B))))
        #print(A, B)
print(min(l))

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().split())
for i in range(N + 1):
    for j in range(N + 1 - i):
        k = int((Y - 10000 * i - 5000 * j) / 1000)
        if N - i - j >= k >= 0 and i + j + k == N:
            print(i, j, k)
            exit()
print(-1, -1, -1)
Problem p02571 (python)

Fixed submission:
s = input()
t = input()

a = []

for i in range(len(s)-len(t)+1):
    count = 0
    for j in range(len(t)):
        if t[j] == s[i + j]:
            count += 1
    a.append(count)
print(len(t)-max(a))

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

a = []

for i in range(len(s)-len(t)):
    count = 0
    for j in range(len(t)):
        if t[j] == s[i + j]:
            count += 1
    a.append(count)
print(len(t)-max(a))

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

a = []

for i in range(len(s)-len(t)):
    count = 0
    for j in range(len(t)):
        if t[j] == s[i + j]:
            count += 1
    a.append(count)
print(len(t)-max(a))
Problem p02572 (python)

Fixed submission:
n = input()
a = list(map(int, input().split()))
b = sum(a)
sum = 0

for i in range(len(a)):
    b -= a[i]
    sum += a[i]*b   

print(sum%(10**9+7))

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
b = sum(a)
sum = 0

for i in range(n):
    b -= a[i]
    sum += a[i]*b   

print(sum%(10**9+7))

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map((int%10**9+7), input().split()))
sum = 0

for i in range(len(a)):
    for j in range(len(a)):
        if i<j:
            sum += (a[i]) * (a[j])
    
print(sum % 10**9+7)
Problem p02595 (python)

Fixed submission:
import math

n, d = input().split()
count = 0
dn = int(d)

for i in range(int(n)):
    x = list(map(int,input().split()))
    if dn >= math.sqrt(x[0] ** 2 + x[1] ** 2):
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import math

n, d = int(input().split())
count = 0

for i in range(n):
    xn, yn = int(input().split())
    if d >= math.sqrt(xn ** 2 + yn ** 2):
        count += 1

print(count)
Problem p02659 (python)

Fixed submission:
import math
x, y = list(map(float, input().split()))

x = int(x)
y = int(y * 100 + 0.5)
 
print(x * y // 100)

Buggy submission (verdict: Runtime Error):
x, y = input().split()
 
x = int(x)
y = float(y)
 
print(int(x * y, '10'))

Buggy submission (verdict: Runtime Error):
x, y = input().split()

x = int(x)
y = float(y)

print(int(x * y, 10))
Problem p02790 (python)

Fixed submission:
a,b = input().split()
aa=''.join([a for _ in range(int(b))])
bb=''.join([b for _ in range(int(a))])
print(max(int(aa),int(bb)))

Buggy submission (verdict: Runtime Error):
a,b = input().split()
aa=''.join([int(a) for _ in range(int(b))])
bb=''.join([int(b) for _ in range(int(a))])
print(max(int(aa),int(bb)))
Problem p02948 (python)

Fixed submission:
import heapq
n,m= map(int,input().split())
feeindays = [[] for _ in range(m)]
for i in range(n):
    a,b= map(int,input().split())
    if a<=m:feeindays[a-1]+=[b]
q=[]
heapq.heapify(q)
pay=0
for l in feeindays:
    for c in l:heapq.heappush(q,-c)
    if len(q)!=0:pay+=-1 * heapq.heappop(q)
print(pay)

Buggy submission (verdict: Runtime Error):
import heapq
n,m= map(int,input().split())
feeindays = [[] for _ in range(m)]
for i in range(n):
    a,b= map(int,input().split())
    feeindays[a-1]+=[b]
q=[]
heapq.heapify(q)
pay=0
for l in feeindays:
    for c in l:heapq.heappush(q,-c)
    if len(q)!=0:pay+=-1 * heapq.heappop(q)
print(pay)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
dic = {}
for _ in range(N):
    a,b = map(int,input().split())
    if a > M:
        pass
    else:
        if a in dic.keys():
            dic[a].append(b)
        else:
            dic[a] = [b]
#print(dic)
lis = [[]] * M
for p in dic.keys():
    lis[p-1] = dic[p]
#print('lis:',lis)
g = 0
for i in range(M):
    if lis[i] == []:
        pass
    else:
        #print('sublis:',lis[i])
        mx = max(lis[i])
        g += mx
        lis[i].remove(mx)
        if i+1 < M:
            if len(lis[i])>0:
                lis[i+1].extend()
    #print(lis)
print(g)
Problem p03013 (python)

Fixed submission:
def org_fib(t):
    t1 = 1
    t2 = 2
    fib = 0
    if t == 1:
        return t1
    elif t == 2:
        return t2
    else:
        for _ in range(t-2):
            fib = t1+t2
            t1 = t2
            t2 = fib
    return fib % 1000000007

N,M = map(int,input().split())
if N == 1:
    print(1)
elif M == 0:
    print(org_fib(N))
else:
    pre_a = -1
    k = []
    ef = True
    for i in range(M):
        a = int(input())
        if (a-pre_a == 1):break
        k.append(a-pre_a-2)
        pre_a = a
    else:
        ef = False
        k.append(N-a-1)

    if ef:print(0)
    else:
        g = 1
        for kk in k:
            if kk == 0:pass
            else:g = (g * org_fib(kk)) % 1000000007
        print(g)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
pre_a = -1
k = []
ef = True
for i in range(M):
    a = int(input())
    if (a-pre_a == 1):break
    k.append(a-pre_a-2)
    pre_a = a
else:
    ef = False
    k.append(N-a-1)
nk = sorted(k)
def org_fib(t):
    t1 = 1
    t2 = 2
    fib = 0
    if t == 1:
        return t1
    elif t == 2:
        return t2
    else:
        for _ in range(t-2):
            fib = t1+t2
            t1 = t2
            t2 = fib
    return fib

if ef:print(0)
else:
    g = 1
    for nnkk in nk:
        if nnkk == 0:
            pass
        else:
            g = (g * org_fib(nnkk)) % 1000000007
    print(g)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
pre_a = -1
k = []
ef = False
for i in range(M):
    a = int(input())
    if a == 1:pre_a = 1
    else:
        if a-pre_a == 1:
            ef = True
            break
        #print(a,pre_a)
        k.append(a-pre_a-2)
        #print(k)
        pre_a = a
else:
    if a < N:k.append(N-a-1)
#print(k)
nk = sorted(k)
#print('nk:',nk)
def fib(sorted_lis):
    t1 = 1
    t2 = 2
    retl = []
    fi = 0
    i = 0
    for k in range(max(sorted_lis)+1):
        if k == 0:fi = 1
        elif k == 1:fi = t1
        elif k == 2:fi = t2
        else:
            fi = t1 + t2
            t1 = t2
            t2 = fi
        while (i < len(sorted_lis)) and (sorted_lis[i] == k):
            retl.append(fi % 1000000007)
            i += 1
    return retl
if ef:print(0)
else:
    cl = fib(nk)
    #print(cl)
    g = 1
    for kk in cl:g = (g * kk) % 1000000007
    print(g)
Problem p03104 (python)

Fixed submission:
def xor_sum(n):
    m1 = (n+1)//4
    m2 = (n+1)%4
    if m2 == 0:return 0
    else:
        ret = 0
        for i in range(m1*4,m1*4+m2):ret ^= i
        else: return ret

a,b = map(int, input().split())
if a==b:print(a)
else:
    ans = xor_sum(a-1) ^ xor_sum(b)
    print(ans)

Buggy submission (verdict: Runtime Error):
def xor_sum(n):
    m1 = (n+1)//4
    m2 = (n+1)%4
    if m2 == 0:return 0
    else:
        ret = 0
        for i in range(m1*4,m1*4+m2):ret ^= i
        else: return ret

a,b = map(int, input().split())
if a==b:print(a)
else:ans = xor_sum(a-1) ^ xor_sum(b)
print(ans)
Problem p03127 (python)

Fixed submission:
import fractions
from functools import reduce
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
n = int(input())
a = list(map(int,input().split()))
print(gcd_list(a))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
n = int(input())
a = list(map(int,input().split()))
print(gcd_list(a))
Problem p03315 (python)

Fixed submission:
c = 0
for s in input():
  if s == '+':c += 1
  else:c-= 1
print(c)

Buggy submission (verdict: Runtime Error):
c = 0
for s in input():
  if s = '+':c += 1
  else:c-= 1
print(c)
Problem p03327 (python)

Fixed submission:
N = int(input())
if N >=1000:
  print('ABD')
else:
  print('ABC')

Buggy submission (verdict: Runtime Error):
N = int(input())
if N >=1000:
  print('ABD'
else:
  print('ABC')
Problem p03631 (python)

Fixed submission:
n = input()
if n == n[::-1]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = input()
if n = n[::-1]:
  print('Yes')
else:
  print('No')