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

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s, t = map(str, input().split())

print('{}{}'.format(t, s))

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s, t = map(str, input().split())

print(f'{t}{s}')

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s, t = map(str, input().split())

print(f'{t}{s}')
Problem p03200 (python)

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

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

S = readline().decode().rstrip()

res = 0
b_cnt = 0

for c in S:
    if c == 'B':
        b_cnt += 1
    elif c == 'W':
        res += b_cnt

print(res)

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

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

S = readline().decode().rstrip()

res = 0
b_cnt = 0

for c in S:
    if c == 'B':
        b_cnt += 1
    elif c == 'W':
        res += b_cnt

print(res)
Problem p03243 (python)

Fixed submission:
n = int(input())
if (n % 111) == 0:
	ans = (n // 111) * 111
else:
	ans = (n // 111 +1) * 111
print(int(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(111,999,111):
    if i< n < i+111:
        ans = i + 111
        break
print(int(ans))
Problem p03274 (python)

Fixed submission:
import numpy as np

n, k = list(map(int, input().split()))
x = np.array(list(map(int, input().split())))

result = np.inf
for i in range(len(x) - k +1):
    tmp1 = np.abs(x[i+k-1] - x[i]) + np.abs(x[i])
    tmp2 = np.abs(x[i+k-1] - x[i]) + np.abs(x[i+k-1])
    result = np.min([tmp1, tmp2, result])

print(int(result))

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

n, k = list(map(int, input().split()))
x = np.array(list(map(int, input().split())))

result = np.inf
for i in range(len(x) - k):
    tmp1 = np.abs(x[i+k-1] - x[i]) + np.abs(x[i])
    tmp2 = np.abs(x[i+k-1] - x[i]) + np.abs(x[i+k-1])
    result = np.min([tmp1, tmp2, result])

print(int(result))
Problem p03296 (python)

Fixed submission:
N = map(int, input())
a = list(map(int, input().split()))
all_set = set(range(1, 10000))

use_set = list(set(all_set - set(a)))

count = 0
for i in range(len(a)-1):
    if a[i] == a[i+1]:
        a[i+1] = use_set[0]
        use_set = use_set[1:]
        count += 1
    
print(count)

Buggy submission (verdict: Runtime Error):
T = int(input())
a = []
for i in range(T):
    a.append(list(map(int, input().split())))
for r in a:
    s, b, c, d = r[0], r[1], r[2], r[3]
    mod_list = []
    if (s < b) or (b>d):
        print('No')
        continue
    if (c>b):
        print('Yes')
        continue
    while True:
        s = s%b
        if s > c:
            print('No')
            break
        s += d
        if s in mod_list:
            print('Yes')
            break
        mod_list.append(s)

Buggy submission (verdict: Runtime Error):
T = int(input())
a = []
for i in range(T):
    a.append(list(map(int, input().split())))
for r in a:
    s, b, c, d = r[0], r[1], r[2], r[3]
    mod_list = []
    if (s < b) or (b>d):
        print('No')
        break
    if (c>b):
        print('Yes')
        break
    while True:
        s = s%b
        if s > c:
            print('No')
            break
        s += d
        if s in mod_list:
            print('Yes')
            break
        mod_list.append(s)
Problem p03427 (python)

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

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

c, *N = str(int(readline())+1)
print(int(c) + 9 *len(N)- 1)

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

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

c, *N = str(int(readline())+1)
print(int(c) + 9 *len(N)- 1)

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

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())
N_chr = str(N)
c = N_chr[0]

acc = int(c) + 9 *(len(N_chr)-1)
if N == acc:
    print(acc)
else:
    print(acc-1)
Problem p03569 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s = read().decode("utf-8").rstrip()
l = 0
r = len(s) - 1

cnt = 0
while len(s) != 0:
    if s[0] == s[-1]:
        s = s[1:-1]
    elif s[0] == 'x':
        s += 'x'
        cnt += 1
    elif s[-1] == 'x':
        s = 'x' + s
        cnt += 1
    else:
        print(-1)
        sys.exit()

print(cnt)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s = read().decode("utf-8").rstrip()
l = 0
r = len(s) - 1

cnt = 0
while l != r:
    if s[l] == s[r]:
        l += 1
        r -= 1
    elif s[l] == 'x':
        l += 1
        cnt += 1
    elif s[r] == 'x':
        r -= 1
        cnt += 1
    else:
        print(-1)
        sys.exit()

print(cnt)
Problem p02612 (python)

Fixed submission:
pay = int(input())

print(0 if pay % 1000 == 0 and pay != 0 else 1000 - (pay % 1000))

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

d = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}

for _ in range(n):
    s = str(input())
    d[s] += 1

print('AC x {}\nWA x {}\nTLE x {}\nRE x {}\n'.format(d['AC'], d['WA'], d['TLE'], d['RE']))
Problem p02613 (python)

Fixed submission:
n = int(input())

d = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}

for _ in range(n):
    s = str(input())
    d[s] += 1

print('AC x {}\nWA x {}\nTLE x {}\nRE x {}\n'.format(d['AC'], d['WA'], d['TLE'], d['RE']))

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

d = {}

for _ in range(n):
    s = str(input())
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1

print('AC x {}\nWA x {}\nTLE x {}\nRE x {}\n'.format(d['AC'], d['WA'], d['TLE'], d['RE']))
Problem p02616 (python)

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

a = list(map(int, input().split()))
a_pos = sorted([i for i in a if i >= 0])
a_neg = sorted([i for i in a if i < 0], reverse=True)

mod = 10 ** 9 + 7
ans = 1

if len(a_pos) == 0 and k % 2:
    for i in a_neg[:k]:
        ans = ans * i % mod
    print(ans)
    exit()

while k > 0:
    if k == 1 or len(a_neg) <= 1:
        if len(a_pos) == 0:
            ans *= a_neg.pop()
        elif len(a_pos) > 0:
            ans *= a_pos.pop()
        k -= 1
    elif len(a_pos) <= 1:
        ans *= a_neg.pop() * a_neg.pop()
        k -= 2
    
    elif a_pos[-1] * a_pos[-2] > a_neg[-1] * a_neg[-2]:
        ans *= a_pos.pop()
        k -= 1
    elif a_pos[0] * a_pos[1] <= a_neg[-1] * a_neg[-2]:
        ans *= a_neg.pop() * a_neg.pop()
        k -= 2
    ans %= mod

else:
    print(ans)

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

a = list(map(int, input().split()))
a_pos = list(sorted(filter(lambda x: x > 0, a)))
a_neg = list(sorted(filter(lambda x: x < 0, a), reverse=True))

mod = 10 ** 9 + 7
ans = 1

if len(a_pos) == 0 and k % 2:
    for i in a_neg[:k]:
        ans = ans * i % mod
    print(ans)
    exit()

while k > 0:
    if k == 1 or len(a_neg) <= 1:
        if len(a_pos) == 0:
            ans *= a_neg.pop()
        elif len(a_pos) > 0:
            ans *= a_pos.pop()
        k -= 1
    elif len(a_pos) <= 1:
        ans *= a_neg.pop() * a_neg.pop()
        k -= 2
    
    elif a_pos[-1] * a_pos[-2] > a_neg[-1] * a_neg[-2]:
        ans *= a_pos.pop()
        k -= 1
    elif a_pos[0] * a_pos[1] <= a_neg[-1] * a_neg[-2]:
        ans *= a_neg.pop() * a_neg.pop()
        k -= 2
    ans %= mod

else:
    print(ans)

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

a = list(map(int, input().split()))
a_pos = list(sorted(filter(lambda x: x > 0, a), reverse=True))
a_neg = list(sorted(filter(lambda x: x < 0, a)))

mod = 10 ** 9 + 7
ans = 1

if len(a_pos) == 0 and k % 2:
    for i in a_neg[:k]:
        ans = ans * i % mod
    print(ans)
    exit()

while k > 0:
    if k == 1 or len(a_neg) <= 1:
        if len(a_pos) == 0:
            ans *= a_neg.pop()
        elif len(a_pos) > 0:
            ans *= a_pos.pop()
        k -= 1
    elif len(a_pos) <= 1:
        ans *= a_neg.pop() * a_neg.pop()
        k -= 2
    
    elif a_pos[0] * a_pos[1] > a_neg[0] * a_neg[1]:
        ans *= a_pos.pop(0)
        k -= 1
    elif a_pos[0] * a_pos[1] <= a_neg[0] * a_neg[1]:
        ans *= a_neg.pop(0) * a_neg.pop(0)
        k -= 2
    ans %= mod

print(ans)
Problem p02612 (python)

Fixed submission:
N = int(input())
if N%1000==0:
    print(0)
else:
    print(1000-N%1000)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N%1000==0:
print(0)
else
print(N%1000)
Problem p02677 (python)

Fixed submission:
import math
A,B,H,M = map(int, input().split())
a = 360*H/12+30*M/60
b = 360*M/60
c = abs(a-b)
d = A**2+B**2-2*A*B*math.cos(math.radians(c))
print(math.sqrt(d))

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M = map(int, input().split())
a = 360*H/12+30*M/60
b = 360*M/60
c = abs(a-b)
if c < 90:
    sin(c) = math.sin(math.radians(c))
    cos(c) = math.sin(math.radians(c))
    d = B-A*cos(c)
    e = (d**2+(A*sin(c))**2)**0.5
    print(e)
elif c == 90:
    e = (A**2+B**2)**0.5
    print(e)
elif c > 90:
    sin(c) = math.sin(math.radians(180-c))
    cos(c) = math.sin(math.radians(180-c))
    d = B+A*cos(c)
    e = (d**2+(A*sin(c)**2)**0.5
    print(e)
Problem p02760 (python)

Fixed submission:
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))

al = a1+a2+a3
n =int(input())

for i in range(n):
    b = int(input())
    if b in al:
        al[al.index(b)] = 0
if al[0] + al[1] + al[2] == 0 or al[3] + al[4] + al[5] == 0 or al[6] + al[7] + al[8] == 0 or al[0] + al[3] + al[6] == 0 or al[1] + al[4] + al[7] == 0 or al[2] + al[5] + al[8] == 0 or al[0] + al[4] + al[8] == 0 or al[2] + al[4] + al[6] == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))

al = a1+a2+a3
n =int(input())

for i in range(n):
    b = int(input())
    if b in al:
        al[al.index()] = 0
if al[0] + al[1] + al[2] == 0 or al[3] + al[4] + al[5] == 0 or al[6] + al[7] + al[8] == 0 or al[0] + al[3] + al[6] == 0 or al[1] + al[4] + al[7] == 0 or al[2] + al[5] + al[8] == 0 or al[0] + al[4] + al[8] == 0 or al[2] + al[4] + al[6] == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))

al = a1+a2+a3
n =int(input())

for i in range(n):
    b = int(input())
    if b in al:
        al[al.index()] = 0
if a1[0] + a1[1] + a1[2] == 0 or a2[0] + a2[1] + a2[2] == 0 or a3[0] + a3[1] + a3[2] == 0 or a1[0] + a2[0] + a3[0] == 0 or a1[1] + a2[1] + a3[1] == 0 or a1[2] + a2[2] + a3[2] == 0 or a1[0] + a2[1] + a3[2] == 0 or a1[2] + a2[1] + a3[0] == 0:
    print("Yes")
else:
    print("No")
Problem p02761 (python)

Fixed submission:
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
for i in range(0, 10**n):
    if len(str(i)) == n and all(str(i)[s-1] == str(c) for s,c in sc):
        print(i)
        break
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
for i in range(0, 10**n):
    if len(str(i)) == n and all(str(i)[s-1] == str(c) for j in sc):
        print(i)
        break
else:
    print(-1)
Problem p02765 (python)

Fixed submission:
N,R = map(int, input().split())
if N >= 10:
    k = R
    print(k)
else:
    k = 100*(10-N)+R
    print(k)

Buggy submission (verdict: Runtime Error):
N,R = map(int, input().split())
if N >= 10:
    k = R
    print(k)
else:
    k = 100*(10-N)+R
    orint(k)
Problem p02767 (python)

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
s = []
for i in range(1,101):
    b = sum((a[j]-i)**2 for j in range(N))
    s.append(b) 
print(min(s))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
s = []
for i in range(1,101):
    b = sum((a[j]-i-1)**2 for j in range(N))
    s.append(b) 
print(min(b))
Problem p02780 (python)

Fixed submission:
N,K = map(int, input().split())
A = [(1+int(x))/2 for x in input().split()]
wa = []
w = 0
for i in range(0,K):
    w = w+A[i]
wa.append(w)
for j in range(N-K):
    w = w + A[j+K] - A[j]
    wa.append(w)
print(max(wa))

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
A = [(1+int(x))/2 for x in input().split()]
wa = []
w = 0
for i in range(0,K):
    w = w+A[i]
wa.append(w)
for j in range(N-k):
    w = w + wa[j+K] - wa[j]
    wa.append(w)
print(max(wa))
Problem p02817 (python)

Fixed submission:
S,T = map(str, input().split())
print(T+S)

Buggy submission (verdict: Runtime Error):
S,T = list(map(int, input().split()))
print(T+S)

Buggy submission (verdict: Runtime Error):
S,T = list(map(int, input().split()))
print(T+S)
Problem p02677 (python)

Fixed submission:
import math

N = input().split(" ")
A = int(N[0])
B = int(N[1])
H = int(N[2])
M = int(N[3])

naga = (30 * H) + (M / 2)
mizi = 6 * M

if naga < mizi:
  deg = mizi - naga
elif naga >= mizi:
  deg = naga - mizi
if deg >= 180:
  deg = 360 - deg

s = (A ** 2) + (B ** 2) - (2 * A * B * math.cos(math.radians(deg)))

s = s**(1/2)
print('{:.20f}'.format(s))

Buggy submission (verdict: Runtime Error):
import math

N = input().split(" ")
A = int(N[0])
B = int(N[1])
H = int(N[2])
M = int(N[3])

naga = (30 * H) + (M / 2)
mizi = 6 * M

if naga < mizi:
  deg = mizi - naga
elif naga > mizi:
  deg = naga - mizi
if deg > 180:
  deg = 360 - deg

s = (A ** 2) + (B ** 2) - (2 * A * B * math.cos(math.radians(deg)))

s = s**(1/2)
print('{:.20f}'.format(s))
Problem p02700 (python)

Fixed submission:
N = input().split(" ")
TL = int(N[0])
TA = int(N[1])
AL = int(N[2])
AA = int(N[3])
a = 0

while a == 0:
  AL = AL - TA
  if AL <= 0:
    a = 1
    break
  TL = TL - AA
  if TL <= 0:
    a = 2
    break
if a == 1:
  print("Yes")
elif a == 2:
  print("No")

Buggy submission (verdict: Runtime Error):
N = input().split(" ")
TL = int(N[0])
TA = int(N[1])
AL = int(N[2])
AA = int(N[3])
a = 0

while a = 0:
  AL = AL - TA
  if AL <= 0:
    a = 1
    brake
  TA = TA - AA
  if TA <= 0:
    a = 2
    brake
if a = 1:
  print("Yes")
if a = 2:
  print("No")
Problem p02687 (python)

Fixed submission:
S=input()
if S == "ABC":print("ARC")
else : print("ABC")

Buggy submission (verdict: Runtime Error):
S = input()
if S is "ABC":
  print("ARC)
else:print("ABC")
Problem p02791 (python)

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

total = 0
minl = l[0]

for i in l:
    if i <= minl:
        total += 1
        minl = i

print(total)

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

counter = 0

for i in range(0,N):
    if li[i+1]>li[i]:
        counter += 1
    else:
        pass
print(counter)
Problem p02811 (python)

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

if K*500>=X:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import itertools
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
nums = [i for i in range(1,n+1)]
fac = [words for words in itertools.permutations(nums)]
ans = abs(fac.index(p) - fac.index(q))
print(ans)
Problem p02900 (python)

Fixed submission:
import math
import collections
def f(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n = n//f
        else:f += 2
    if n != 1:
        a.append(n)
    return a

a,b = map(int,input().split())
a = set(collections.Counter(f(a)).keys())
b = set(collections.Counter(f(b)).keys())
print(len(a&b)+1)

Buggy submission (verdict: Runtime Error):
def cf(x1,x2):
    count=[]
    for i in range(2,max(int(math.sqrt(x1)),int(math.sqrt(x2))+1)):
        if x1 % i == 0 and x2 % i == 0:
            count.append(i)
    return count

A,B = map(int,input().split())
li = cf(A,B)
c = 1
for i in li:
    for j in li:
        if i % j == 0:
            if i == j:
                c +=1
            else:
                break
print(c)
Problem p02909 (python)

Fixed submission:
S = input()
if S == "Sunny":
    print("Cloudy")
elif S =="Cloudy":
    print("Rainy")
elif S==("Rainy"):
    print("Sunny")

Buggy submission (verdict: Runtime Error):
S = input()
if S == "Sunny":
    print("Cloudy")
elif S =="Cloudy":
    print("Rainy"):
else:
    print("Sunny")
Problem p02923 (python)

Fixed submission:
N = int(input())
li = list(map(int,input().split()))
ans = 0
cnt =0
for i in range(N-1):
    if li[i]>=li[i+1]:
        cnt+=1
    else:
        ans = max(ans,cnt)
        cnt = 0
print(max(ans,cnt))

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

step = 0
while True:
    if N>int(li[N+1]):
        step +=1
        N+=1
    else:
        pass
    
print(step)
Problem p03060 (python)

Fixed submission:
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
S = 0
for i in range(N):
    D = V[i] - C[i]
    if D >0:
        S = S + D
    
print(S)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
S = 0
for i in range(N):
    D = V[i] - C[i]
    if D >0:
    S = S + D
    
print(S)
Problem p03086 (python)

Fixed submission:
s = str(input())
ACGT = {"A", "C", "G", "T"}

ans = 0
for i in range(len(s)):
    for j in range(i, len(s) + 1):
        t = s[i: j]
        for k in t:
            if k not in ACGT:
                break
        else:
            ans = max(ans, len(t))
print(ans)

Buggy submission (verdict: Runtime Error):
s = str(input())
ACGT = {"A", "C", "G", "T"}

ans = 0
for i in range(len(s)):
    for j in range(i, len(s) + 1):
        k = s[i: j]
        for l in k:
            if l not in ACGT:
                break
        else:
            ans = max(ans, len(t))
print(ans)
Problem p03126 (python)

Fixed submission:
x,y = map(int,input().split())
a = list(map(int,input().split()))
b = set(a[1:])
for i in range(x-1):
    a = list(map(int,input().split()))
    b = b & set(a[1:])
print(len(b))

Buggy submission (verdict: Runtime Error):
X,Y = map(int,input().split())
A = list(map(int,input().split()))
A = set(A[1:])
for i in range(X-1):
    A = list(map(int,input().split()))
    B = B & set(A[1:])
print(len(B))
Problem p03251 (python)

Fixed submission:
N,M,X,Y = map(int,input().split())
lx = list(map(int,input().split()))
lx.append(X)
ly = list(map(int,input().split()))
ly.append(Y)
if max(lx) < min(ly):
    print('No War')
else:
    print('War')

Buggy submission (verdict: Runtime Error):
N,M,X,Y = map(int,input().split())
li_x = list(map(int,input().split()))
li_y = list(map(int,input().split()))

li_x.append(X)
li_y.append(Y)

li_x = set(li_x)
li_y = set(li_y)

if max(x1)>min(y1):
    print("War")
elif max(x1)<min(y1):
    print("No war")
elif max(x1)==min(y1):
    print("War")
Problem p03324 (python)

Fixed submission:
D, N = map(int, input().split())
print(100 ** D * (N + N // 100))

Buggy submission (verdict: Runtime Error):
D, N =  map(int,input().split())
if D == 0:
    li = [int(i) for i in range(1,100)]
    print(li[N-1])
if D == 1:
    li = [int(i) for i in range(int(100),int(1e4),int(100))]
    print(li[N-1])
if D == 2:
    li = [int(i) for i in range(int(1e4),int(1e9),int(1e4))]
    print(li[N-1])

Buggy submission (verdict: Runtime Error):
D, N =  map(int,input().split())
if D == 0:
    li = [int(i) for i in range(1,99)]
    print(li[N-1])
if D == 1:
    li = [int(i) for i in range(int(100),int(1e4),int(100))]
    print(li[N-1])
if D == 2:
    li = [int(i) for i in  range(int(1e4),int(1e9),int(1e4))]
    print(li[N-1])
Problem p03423 (python)

Fixed submission:
N = int(input())
ans = N//3
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=[input() for _ in range(N)]

MARCH=[0]*5
for i in range(N):
  if S[i][0]=="M":
    MARCH[0]+=1
  elif S[i][0]=="A":
    MARCH[1]+=1
  elif S[i][0]=="R":
    MARCH[2]+=1
  elif S[i][0]=="C":
    MARCH[3]+=1
  elif S[i][0]=="H":
    MARCH[4]+=1

ans=0
for i in range(3):
  for j in range(i+1,4):
    for k in range(j+1,5):
      ans+=MARCH[i]*MARCH[j]*MARCH[k]
print(ans)
Problem p03493 (python)

Fixed submission:
li=list(input())
t = 0
for i in li:
    if i == "1":
        t+=1
    else:
        pass
print(t)

Buggy submission (verdict: Runtime Error):
def how_many_times_divisible(n):
	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans
 
N = int(input())
a = map(int, input().split())
ans = min(map(how_many_times_divisible, a))
 
print(ans)
Problem p03494 (python)

Fixed submission:
def how_many_times_divisible(n):
	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans
 
N = int(input())
a = map(int, input().split())
ans = min(map(how_many_times_divisible, a))
 
print(ans)

Buggy submission (verdict: Runtime Error):
def how_many_times_divisible(n):
	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans
 
n = int(input())
a = map(int, input().split())
ans = min(map(how_many_times_divisible, a))
 
print ans
Problem p03796 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
div = 1e9+7
ans = 1
for i in range(1,N+1):
    ans*=i
print(ans%div)
Problem p02675 (python)

Fixed submission:
n = int(input())

if(n%10==3):
    print("bon")
elif(n%10 in [0, 1, 6, 8]):
    print("pon")
else:
    print("hon")

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

if(n%10==3):
    print("bon")
else if(n%10 in [0, 1, 6, 8]):
    print("pon")
else:
    print("hon")
Problem p02719 (python)

Fixed submission:
n, k = [int(x) for x in input().split()]
print(min(n%k,k-n%k))

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

n, k = [int(x) for x in input().split()]
print(min(gcd(n,k),k-gcd(n,k))
Problem p03478 (python)

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

Buggy submission (verdict: Runtime Error):
n,a,b = map(int, input().split())
ans = 0
for i in range(1,n+1):
    if a <= sum([int(c) for c in str(i)]) => b:
        ans += i
print(ans)
Problem p03854 (python)

Fixed submission:
import re

s = input()
s = re.sub("eraser","",s)
s = re.sub("erase","",s)
s = re.sub("dreamer","",s)
s = re.sub("dream","",s)

if len(s) == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import re

s = input()
s = re.sub("dreamer","",s)
s = re.sub("dream","",s)
s = re.sub("eraser","",s)
s = re.sub("erase","",s)

if int(s) == 0:
    print("YES")
else:
    print("NO")
Problem p02843 (python)

Fixed submission:
X = int(input())
p = X//100
q = X-p*100
ret = q <= p*5
print(int(ret))

Buggy submission (verdict: Runtime Error):
import math

def solve():
    N = int(input())
    ABCDE = []
    for _ in range(5):
        ABCDE.append(int(input()))
        
    min_ = min(ABCDE)
    
    print(math.ceil(N/min_)+4)
    
solve()