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

Fixed submission:
n, k = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
a = sorted(a)
fact = [1]
for i in range(1, n + 1):
    fact.append(fact[-1] * i % 1000000007)
max_a = 0
for i in range(k - 1, n):
    max_a += a[i] * fact[i] * pow(fact[i - k + 1], 1000000005, 1000000007) * pow(fact[k - 1], 1000000005, 1000000007) % 1000000007
a = a[::-1]
min_a = 0
for i in range(k - 1, n):
    min_a += a[i] * fact[i] * pow(fact[i - k + 1], 1000000005, 1000000007) * pow(fact[k - 1], 1000000005, 1000000007) % 1000000007
print(int((max_a - min_a) % 1000000007))

Buggy submission (verdict: Runtime Error):
# from scipy.special import comb
from scipy.misc import comb
n, k = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
a = sorted(a)
max_a = 0
for i in range(k - 1, n):
    max_a += a[i] * comb(i, k - 1)
min_a = 0
for i in range(n - k + 1):
    min_a += a[i] * comb(n - i - 1, k - 1)
print(int((max_a - min_a) % 1000000007))

Buggy submission (verdict: Runtime Error):
# from scipy.special import comb
from scipy.misc import comb
n, k = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
a = sorted(a)
print(a)
max_a = 0
for i in range(k - 1, n):
    max_a += a[i] * comb(i, k - 1)
min_a = 0
for i in range(n - k + 1):
    min_a += a[i] * comb(n - i - 1, k - 1)
print(int((max_a - min_a) % 1000000007))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
n, k = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
a = sorted(a)
print(a)
max_a = 0
for i in range(k - 1, n):
    max_a += a[i] * comb(i, k - 1)
min_a = 0
for i in range(n - k + 1):
    min_a += a[i] * comb(n - i - 1, k - 1)
print(int((max_a - min_a) % 1000000007))
Problem p02731 (python)

Fixed submission:
L = int(input())

print((L/3)**(3))

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

print((l/3)**(3))
Problem p02743 (python)

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

if a*a+b*b+c*c > 2*a*b+2*b*c+2*c*a and c-a-b > 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b, c = [int(x) for x in input().split(" ")]

if a + b + (a*B)**(1/2) < c:
  print(Yes)
else:
  print(No)
Problem p02789 (python)

Fixed submission:
test = input().split(" ")
if int(test[0])== int(test[1]):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
N = input().split("")
if N[0] == N[1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = input()
lis = input().split(" ")
cnt = 1
for i in range(int(N)+1):
    for j in range(i-1,-1,-1):
        if int(lis[i])>int(lis[j]):
            break
        else:
            cnt +=1
        break
print(cnt)

Buggy submission (verdict: Runtime Error):
test = input().split(" ")
if int(test[0])== int(test[1]):
  print("Yes")
else
 print("No")
Problem p02791 (python)

Fixed submission:
N = int(input())
lst = list(map(int,input().split()))
 
cnt = 0
m = lst[0]
 
for i in lst:
  if i <= m:
    cnt +=1
    m = i
print(cnt)

Buggy submission (verdict: Runtime Error):
N = input()
lis = input().split(" ")
cnt = 1
for i in range(int(N+1)):
    for j in range(i-1,-1,-1):
        if int(lis[i])>int(lis[j]):
            break
        else:
            cnt +=1
        break
print(cnt)

Buggy submission (verdict: Runtime Error):
N = input()
lis = input().split(" ")
cnt = 0
for i in range(int(N)):
  for j in range(int(N),-1,-1)
  if lis[i]>lis[j]
    cnt += 1
    break
print(cnt)
Problem p02801 (python)

Fixed submission:
char = ord(input())
char += 1
print(chr(char))

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

alpha_bete = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}

for cnt, charct in enumerate(alpha_bete):
	if charact == in_char
  		print(alpha_bete[cnt+1])
Problem p02811 (python)

Fixed submission:
char = input().split(" ")
if int(char[0])*500 >= int(char[1]):
    print("Yes")
else: 
    print("No")

Buggy submission (verdict: Runtime Error):
char = input().split(" ")
if int(char[0])*500 >= (char[1]):
    print("Yes")
else: 
    print("No")

Buggy submission (verdict: Runtime Error):
char = input().split(" ")
if char[0]*500 >= char[1]:
    print("Yes")
else 
    print("No")
Problem p02812 (python)

Fixed submission:
N = int(input())
S = list(input())

cnt = 0

for i in range(0,N-2):
  if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
    cnt += 1
    
print(cnt)

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

cnt = 0

for i in range(0,4):
  if S[i] == "A" and S[i+1] == "C" and S[i+2] == "C":
    cnt += 1
    
print(cnt)
Problem p02817 (python)

Fixed submission:
chars = input().split(" ")
print(chars[1]+chars[0])

Buggy submission (verdict: Runtime Error):
chars = input.split(" ")
print(chars[1]+chars[0])

Buggy submission (verdict: Runtime Error):
chars = input.split(" ")
print(chars[1]+char[0])
Problem p02818 (python)

Fixed submission:
A, B, K = [int(x) for x in input().split(" ")]

if A >= K:
  print("{} {}".format(A-K, B))
elif A < K and A+B >= K:
  print("{} {}".format(0, int(A-K/2+B-K/2)))
else:
  print(0, 0)

Buggy submission (verdict: Runtime Error):
A, B, K = [int(x) for x in input().split(" ")]

if A >= K:
  print("{} {}".format(A-K, B))
elif A < K and A+B >= K:
  print("{} {}".format(0, (A-K/2)+(B-K/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A, B, K = [int(x) for x in input().split(" ")]

if A >= K:
  print("{} {}".format(A-K, B))
elif A < K and A+B => K:
  print("{} {}".format(0, A+B-K))
else:
  print(0)
Problem p02887 (python)

Fixed submission:
N = input()
S = input()
temp = ""
lst = ""
for cnt in S:
    if temp != cnt:
        temp = cnt
        lst += cnt
print(len(lst))

Buggy submission (verdict: Runtime Error):
N = input()
S = input()
temp = ""
for cnt in S
	if temp != cnt:
    	temp = cnt
        lst += cnt
n = len(lst)
print("n")

Buggy submission (verdict: Runtime Error):
N = input()
S = input()
temp = ""
for cnt in N
	if temp != cnt:
    	temp = cnt
        lst += cnt
n = len(lst)
print("n")
Problem p02909 (python)

Fixed submission:
S = input()

if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

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

Fixed submission:
S = list(input())
T = list(input())

cnt = 0

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

print(cnt)

Buggy submission (verdict: Runtime Error):
S = list(input())
T = list(input())

cnt = 0

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

pirn(cnt)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

cnt = 0

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

pirn(cnt)

Buggy submission (verdict: Runtime Error):
S = list(input())
T = list(input())

cnt = 0

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

pirn(cnt)
Problem p02922 (python)

Fixed submission:
lst = list(map(int,input().split(" ")))
socket_n = 1
tap = 0
while socket_n < lst[1]:
  tap += 1
  socket_n = socket_n-1+lst[0]
print("%d" % tap)

Buggy submission (verdict: Runtime Error):
lst = list(map(int,input().split("")))
n = (list[1]-1)/list[0]
print("n")
Problem p02957 (python)

Fixed submission:
A, B = [int(x) for x in input().split(" ")]

if (A+B)%2 == 0:
  print(int((A+B)/2))
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
A, B = [int(x) for x in input().split(" ")]

for k in range(0,10**9):
  if abs(A-k) == abs(B-k):
    print(k)
  else:
    print(IMPOSSIBLE)
Problem p02993 (python)

Fixed submission:
S = list(input())

out = "Good"

for i in range(0,3):
  if S[i] == S[i+1]:
    out = "Bad"
    
print(out)

Buggy submission (verdict: Runtime Error):
S = list(input())

out = "Good"

for i in range(0,4):
  if S[i] == S[i+1]:
    out = "Bad"
    
print(out)

Buggy submission (verdict: Runtime Error):
S = list(input())

out = Good

for i in range(0,4):
  if S[i] == S[i+1]:
    out = "Bad"
    
print(out)
Problem p03220 (python)

Fixed submission:
N = int(input())
T, A = [int(i) for i in input().split(" ")]
temp = [T-0.006*int(h) for h in input().split(" ")]

place = 1
diff_min = abs(temp[0]-A)

for cnt, t in enumerate(temp,1):
  if abs(A-t) < diff_min:
    diff_min = abs(A-t)
    place = cnt

print(place)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = [int(i) for i in input().split(" ")]
temp = [int(T-0.006*h) for h in int(input().split(" "))]

place = 0
diff_min = 0

for cnt, t in enumerate(temp):
  if abs(T-t) < diff_min:
    diff_min = abs(T-t)
    place = cnt

print(place)
Problem p03254 (python)

Fixed submission:
N, x = [int(i) for i in input().split(" ")]
lst = [int(i) for i in input().split(" ")]
 
lst.sort()
cnt = 0
 
for i in range(0,N-1):
  if x >= lst[i]:
    x -= lst[i]
    cnt += 1
  else:
    break

if x == lst[N-1]:
    cnt +=1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
N, x = [int(i) for i in input().split(" ")]
lst = [int(i) for i in input().split(" ")]

lst.sort(reverse = True)
cnt = 0

while x > lst[cnt]:
  x -= lst[cnt]
  cnt += 1
  
print(cnt)
Problem p03285 (python)

Fixed submission:
N = int(input())

flag = 0

for i in range(26):
    for j in range(16):
      if i*4+j*7 == N:
        flag = 1

if flag == 1:
    print("Yes")
else:
    print("No")

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

flag = 0

for i in range(26):
    for j in range(16):
      if j*4+j*7 == N:
        flag = 1

if flag == 1:
    print("Yes")
else
    print("No")

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

for i in (26):
	for j in(16):
  		if j*4+J*7 == N:
      		print("Yes")
        else:
          print("No")

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

for i in (26)
	for j in(16)
  		if j*4+J*7 == N:
      		print("Yes")
        else:
          print("No")
Problem p03308 (python)

Fixed submission:
N = int(input())
lst = [int(n) for n in input().split(" ")]
   
print(max(lst)-min(lst))

Buggy submission (verdict: Runtime Error):
N = int(input())
lst = [int(n) for n in input().split(" ")]
val_max = 0
val_min = 0
for i in range(0,N):
  if val_max < i:
    val_max = i
  elseif val_min > i:
    val_min = i
print(val_max-val_min)
Problem p03408 (python)

Fixed submission:
lst_blue = []
lst_red = []
dic = {}

N = int(input())
for i in range(0,N):
  lst_blue.append(input())
M = int(input())
for i in range(0,M):
  lst_red.append(input())

for i in list(set(lst_blue)):
  dic[i] = int(lst_blue.count(i))

for i in lst_red:
  if i in dic:
    dic[i] -= 1
    
print(max(0,max(dic.values())))

Buggy submission (verdict: Runtime Error):
lst_blue = []
lst_red = []

N = int(input())
for i in range(0,N):
  lst_blue.append(input())
M = int(input())
for i in range(0,M):
  lst_red.append(input())

for i in list(set(lst_blue)):
  dic = {lst_bule[i]:int(lst_blue.count(i))}
for i in list(set(lst_red)):
  if i in dic:
    dic[i] -= 1

print(max(dic.values()))
Problem p03485 (python)

Fixed submission:
a, b = map(int,input().split(" "))
print("{}".format(int((a+b+2-1)/2)))

Buggy submission (verdict: Runtime Error):
a, b = map(int,iput().split(" "))
print("{}".format((a+b-1)/b))
Problem p03486 (python)

Fixed submission:
s = sorted(input())
t = sorted(input(),reverse = True)

if "".join(s) < "".join(t):
  print("Yes")
else:
  print("No")

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

if s < t
  print("Yes")
else:
  print("No")
Problem p03495 (python)

Fixed submission:
N, K = [int(x) for x in input().split(" ")]
lst = [int(x) for x in input().split(" ")]

dic= {}
cnt = 0 
swap = 0
prep = len(set(lst))-K

for i in range(1,N+1):
	dic["{}".format(i)] = 0

for i in range(0,N):
	dic["{}".format(lst[i])] += 1

sorted_dic = sorted(dic.items(), key = lambda x : x[1])
    
for i in range(0,N):
  swap += sorted_dic[i][1]
  if sorted_dic[i][1] != 0:
    cnt +=1
  if cnt >= prep:
    break
      
print(swap)

Buggy submission (verdict: Runtime Error):
N, K = [int(x) for x in input().split(" ")]
lst = [int(x) for x in input().split(" ")]

dic= {}
cnt = 0 
swap = 0
prep = len(set(lst))-K

for i in range(1,N+1):
	dic["{}".format(i)] = 0
	dic["{}".format(lst[i-1])] += 1

sorted_dic = sorted(dic.items(), key = lambda x : x[1])
    
for i in range(0,N):
  swap += sorted_dic[i][1]
  if sorted_dic[i][1] != 0:
    cnt +=1
  if cnt >= prep:
    break
      
print(swap)
Problem p03610 (python)

Fixed submission:
s = list(input())
out = []

cnt =0

for i in s:
    if cnt%2 == 0:
        out.append(i)
    cnt += 1
 
print("".join(out))

Buggy submission (verdict: Runtime Error):
s = list(input())
out = []

i=0
while s[i]:
  out.append(s[i])
  i +=2

print(out)
Problem p03624 (python)

Fixed submission:
S = input()

if len(set(S)) == 26:
  print("None")
else:
  for dam in ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]:
    if not dam in list(set(S)):
           break
  print(dam)

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

if len(set(S)) == 26:
  print("None")
else:
  for dam in ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]:
    if not dam in list(set(S)):
           break
print(dam)
Problem p03720 (python)

Fixed submission:
N, M = [int(i) for i in input().split(" ")]
lst = []

for i in range(0,M):
	lst.extend(input().split(" "))
for i in range(1,N+1):
	print(lst.count("{}".format(i)))

Buggy submission (verdict: Runtime Error):
N, M = [int(i) for i in input().split(" ")]

for i in range(0,N):
	lst.append(input().split(" "))

for i in range(1,N+1):
	print(lst.count(i)

Buggy submission (verdict: Runtime Error):
N, M = [int(i) for i in input().split(" ")]

for i in range(0,N)
	lst.append(input().split(" "))

for i in range(1,N+1)
	print(lst.count(i))
Problem p03814 (python)

Fixed submission:
s= input()
print(s.rindex("Z")-s.index("A")+1)

Buggy submission (verdict: Runtime Error):
s = list(input())
print(len(s[s.index("A"):s.index("Z",-1)]+1))
Problem p03854 (python)

Fixed submission:
S = input()

if S.replace("eraser","").replace("erase","").replace("dreamer","").replace("dream",""):
  print("NO")
else:
  print("YES")

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

if S.replace("dream"," ").replace("dreamer"," ").replace("erase"," ").replace("eraser"," "):
  print("NO")
else:
  print("YES

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

if S.replace("dream"," ").replace("dreamer"," ").replace.("erase"," ").replace("eraser"," "):
  print("YES")
else:
  print("NO")

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

if S.replace("dream",).replace("dreamer",).replace.("erase",).replace("eraser",):
  print("NO")
else:
  print("YES")
Problem p03944 (python)

Fixed submission:
W, H, N = [int(i) for i in input().split(" ")]

a1 = [0,0]
a2 = [W,0]
a3 = [0,0]
a4 = [0,H]

for i in range(0,N):
  lst = [int(i) for i in input().split(" ")]
  if lst[2] == 1 and lst[0] > a1[0]:
    a1[0] = lst[0]
  elif lst[2] == 2 and lst[0] < a2[0]:
    a2[0] = lst[0]
  elif lst[2] == 3 and lst[1] > a3[1]:
    a3[1] = lst[1]
  elif lst[2] == 4 and lst[1] < a4[1]:
    a4[1] = lst[1]

if (a2[0]-a1[0])<0 or (a4[1]-a3[1])<0:
    print(0)
else:
    print((a2[0]-a1[0])*(a4[1]-a3[1]))

Buggy submission (verdict: Runtime Error):
W, H, N = [int(i) for i in input().split(" ")]

a1 = [0,0]
a2 = [W,0]
a3 = [0,0]
a4 = [0,H]

for i in range(0,N):
  lst = [int(i) for i in input().split(" ")]
  if lst[2] == 1:
    a1[0] = max(a1[0],lst[0])
  elif lst[2] == 2:
    a2[0] = max(a2[0],lst[0])
  elif lst[2] == 3:
    a3[1] = max(a3[1],lst[1])
  elif lst[2] == 4:
    a4[1] = max(a4[1],lst[1])

print(max(0,a2[0]-a1[0])*max(0,(a4[1]-a3[1]))

Buggy submission (verdict: Runtime Error):
W, H, N = [int(i) for i in input().split(" ")]

a1 = [0,0]
a2 = [W,0]
a3 = [0,0]
a4 = [0,H]

for i in range(0,N):
  lst = [int(i) for i in input().split(" ")]
  if lst[2] == 1:
    a1[0] = max(a1[0],lst[0])
  elif lst[2] == 2:
    a2[0] = max(a2[0],lst[0])
  elif lst[2] == 3:
    a3[1] = max(a3[1],lst[1])
  elif lst[2] == 4:
    a4[1] = max(a4[1]1,lst[1])

print(max(0,a2[0]-a1[0])*max(0,(a4[1]-a3[1]))

Buggy submission (verdict: Runtime Error):
W, H, N = [int(i) for i in input().split(" ")]

a1 = [0,0]
a2 = [W,0]
a3 = [0,0]
a4 = [0,H]

for i in range(0,N):
  lst = [int(i) for i in input().split(" ")]
  if lst[2] == 1:
    a1[0] = max(a1[0],lst[0])
  elif lst[2] == 2:
    a2[0] = max(a2[0],lst[0])
  elif lst[2] == 3:
    a3[1] = max(a3[1],lst[1])
  elif lst[2] == 4:
    a4[1] = max(a4[]1,lst[1])

print(max(0,a2[0]-a1[0])*max(0,(a4[1]-a3[1]))
Problem p03059 (python)

Fixed submission:
#Biscuit Generator

A, B, T = map(int, input().split())

def answer():
    ans = T // A * B
    return ans

def main():
    print(answer())


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# GCD on Blackboard
"""
リストのどの要素を抜いた時に最大公約数が最大値をとるか調べて、
その時の最大公約数を出力する。
"""

from functools import reduce

N = int(input())
A = list(map(int, input().split()))


def get_gcd(a, b):
    """
    ユークリッド互除法により最大公約数を求める。
    """
    if a < b:
        a, b = b, a

    elif a % b == 0:
        return b

    return get_gcd(b, a % b)


def get_gcd_l(l):
    """
    リストの要素の最大公約数を求める。
    """
    return reduce(get_gcd, l)


def answer(l):
    """
    どの要素を抜いた時に最大公約数が最大値をとるか調べる。
    """
    len_l = len(l)
    answers = []  # 答えの案

    for i in range(len_l): # 要素を1個ずつ消してみる。
        temp_l = []
        temp_l += l[0 : i]
        temp_l += l[i+1 : len_l]
        answers.append(get_gcd_l(temp_l))
    ans = max(answers)
    return ans


def main():
    """
    答えを出力する。
    """
    print(answer(A))


if __name__ == '__main__':
    main()
Problem p03730 (python)

Fixed submission:
#!/usr/bin/python3
# abc060_b
"""
Choose Integers
"""

test = False


def answer():
    """
    Aの倍数の中に条件を満たすものがあるか調べる。
    """
    A, B, C = map(int, input().split())

    for i in range(1, A*B+1):
        if (A * i) % B == C:
            if test:
                print(A * i)
            return 'YES'
    return 'NO'


def main():
    """
    main関数
    """
    print(answer())


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# abc060_b
"""
Choose Integers
"""

import math  # greatest common divisor, 最大公約数
test = False

def lcm(x, y):
    """
    最小公倍数 least common multiple
    """
    return (x * y) // math.gcd(x, y)

def answer():
    """
    Aの倍数の中に条件を満たすものがあるか調べる。
    """
    A, B, C = map(int, input().split())
    upper_limit = int(lcm(A, B) / A)
    if test:
        print(lcm(A, B), upper_limit)

    for i in range(1, upper_limit+1):
        if (A * i) % B == C:
            if test:
                print(A * i)
            return 'YES'
    return 'NO'


def main():
    """
    main関数
    """
    print(answer())


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# abc060_b
"""
Choose Integers
"""

from math import gcd  # greatest common divisor, 最大公約数
test = False

def lcm(x, y):
    """
    最小公倍数 least common multiple
    """
    return (x * y) // gcd(x, y)

def answer():
    """
    Aの倍数の中に条件を満たすものがあるか調べる。
    """
    A, B, C = map(int, input().split())
    upper_limit = int(lcm(A, B) / A)
    if test:
        print(lcm(A, B), upper_limit)

    for i in range(1, upper_limit+1):
        if (A * i) % B == C:
            if test:
                print(A * i)
            return 'YES'
    return 'NO'


def main():
    """
    main関数
    """
    print(answer())


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# abc060_b
"""
Choose Integers
"""

from math import gcd  # greatest common divisor, 最大公約数
test = False

def lcm(x, y):
    """
    最小公倍数 least common multiple
    """
    return (x * y) // gcd(x, y)

def answer():
    """
    Aの倍数の中に条件を満たすものがあるか調べる。
    """
    A, B, C = map(int, input().split())
    upper_limit = int(lcm(A, B) / A)
    if test:
        print(lcm(A, B), upper_limit)

    for i in range(1, upper_limit+1):
        if (A * i) % B == C:
            print(A * i)
            return 'YES'
    return 'NO'


def main():
    """
    main関数
    """
    print(answer())


if __name__ == '__main__':
    main()
Problem p03828 (python)

Fixed submission:
#! /usr/bin/python3
# Factors of Factorial

"""
1≦N≦103
"""

import math
import collections
# import sympy

test = False

N = int(input())


def prime_factors(n):
    """
    自然数 n の素因数のリスト
    """
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            # n = n // i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors


def yakusu_no_kosu(n):
    """
    n! の約数の個数
    """

    l = prime_factors(math.factorial(n))
    c = collections.Counter(l)
    l_c = list(c.values())
    if test:
        print('l =', l)
        print('c =', c)
        print('l_c =', l_c)


    kosu = 1
    # 約数の数
    for v in l_c:
        kosu *= v + 1
    # 各素因数(key)の個数v(value)から約数の個数を算出

    """
    d = sympy.factorint(math.factorial(n))
    # n!を素因数分解 {素因数1: 個数, 素因数2: 個数, …}
    l_d = list(d.values())
    # 各素因数(key)の個数(value)のみリストにする

    if test:
        print('l_d =', l_d)

    kosu = 1
    # 約数の数

    for v in l_d:
        kosu *= v + 1
    # 各素因数(key)の個数v(value)から約数の個数を算出
    """

    return kosu


def main():
    """
    N! の約数の個数を 10^9+7 で割った余りを出力
    """
    print(yakusu_no_kosu(N) % (10**9 + 7))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#! /usr/bin/python3
# Factors of Factorial

"""
1≦N≦103
"""

import math
import sympy

test = False

N = int(input())


def yakusu_no_kosu(n):
    """
    n! の約数の個数
    """
    d = sympy.factorint(math.factorial(n))
    # n!を素因数分解 {素因数1: 個数, 素因数2: 個数, …}
    l_d = list(d.values())
    # 各素因数(key)の個数(value)のみリストにする

    if test:
        print('l_d =', l_d)

    kosu = 1
    # 約数の数

    for v in l_d:
        kosu *= v + 1
    # 各素因数(key)の個数v(value)から約数の個数を算出

    return kosu


def main():
    """
    N! の約数の個数を 10^9+7 で割った余りを出力
    """
    print(yakusu_no_kosu(N) % (10**9 + 7))


if __name__ == '__main__':
    main()
Problem p03860 (python)

Fixed submission:
#! /usr/bin/python3
# AtCoder *** Contest

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

print('A{}C'.format(s[0]))

Buggy submission (verdict: Runtime Error):
#! /usr/bin/python3
# Between a and b ...

"""
非負の整数 a, b (a≤b) と、正の整数 x が与えられます。
a 以上 b 以下の整数のうち、x で割り切れるものの個数を求めてください。
"""

test_mode = False

a, b, x = map(int, input().split())
counter = 0
limit = b // x

for n in range(1, limit+1):
    if a <= x*n <= b:
        counter += 1

print(counter)