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

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(0,A+1):
    for j in range(0,B+1):
        for k in range(0,C+1):
            sum = 500 * i + 100 * j + 50 * k
            if sum == X:
                ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
A, B, C, X = int(input())
ans = 0
for i in range(0,A+1):
    for j in range(0,B+1):
        for k in range(0,C+1):
            sum = 500 * i + 100 * j + 50 * k
            if sum == X:
                ans += 1

print(ans)
Problem p03845 (python)

Fixed submission:
N = int(input())
T = list(map(int,input().split()))
M = int(input())

s = sum(T)
for i in range(M):
    P,X = map(int, input().split())
    print(s-T[P-1]+X)

Buggy submission (verdict: Runtime Error):
N = int(input().split())
T = list(map(int,input().split()))
M = int(input().split())
P_X = [list(map(int, input().split())) for i in range(M)]

s = sum(T)
for i in range(M):
    print(s-T[i-1][0]+T[i-1][1])
Problem p03006 (python)

Fixed submission:
n = int(input())
xy = [tuple(map(int, input().split())) for _ in range(n)]
pq = {}

if n==1:
    print(1)
    exit(0)

for (x, y) in xy:
    for (a, b) in xy:
        if (x, y) != (a, b):
            if (x-a, y-b) in pq.keys():
                pq[(x-a, y-b)] = pq[(x-a, y-b)] + 1
            else:
                pq[(x-a, y-b)] = 1

print(n - max(pq.values()))

Buggy submission (verdict: Runtime Error):
n = int(input())
xy = []
pq = {}

for i in range(n):
    (x, y) = list(map(int, input().split()))
    xy = xy + [(x, y)]
    for (x_p, y_p) in xy:
        if (x-x_p, y-y_p) != (0, 0):
            if (x-x_p, y-y_p) in pq.keys():
                pq[(x-x_p, y-y_p)] = pq[(x-x_p, y-y_p)] + 1
            else:
                pq[(x-x_p, y-y_p)] = 1
print(n - max([1, max(pq.values())]))

Buggy submission (verdict: Runtime Error):
n = int(input())
list = []
submap = {}
scmap = {}
for i in range(n):
    a, b = map(int, input().split())
    list = list + [(a,b)]
    for (x, y) in list:
        if (a-x, b-y) != (0, 0):
            if (a-x, b-y) in submap.keys():
                submap[(a-x, b-y)] = submap[(a-x, b-y)] + 1
            else:
                submap[(a-x, b-y)] = 1
(k, l) = max(submap, key=submap.get)

c = 0
while len(list) > 0:
    (x, y) = list[0]
    c = c + 1
    list.remove((x, y))
    while (x + k, y + l) in list:
        list.remove((x + k, y + l))
        (x, y) = (x + k, y + l)
print(c)
Problem p02658 (python)

Fixed submission:
n = int(input())
a_list = [int(x) for x in input().split()]

if 0 in a_list:
  print(0)
  
else:
  flg = True
  num = 1
  for a in a_list:
    num *= a
    if num > 1E18:
      print(-1)
      flg = False
      break

  if flg:
    print(num)

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

if 0 in a_list:
  print(0)
  

else:
  flg = True
  num = 1
  for a in a_list:
    num *= a
    if num > 1E18:
      print(-1)
      flg = False
      break

if flg:
  print(num)
Problem p02665 (python)

Fixed submission:
n = int(input())
a_list = [int(x) for x in input().split()]

node = 1
flg = False
node_list = [node]

for i in range(len(a_list)-1):
  num = a_list[i]
  next = node-num
  if next < 0:
    flg = True
    break
  node = next*2
  node_list.append(node)

if node - a_list[-1] < 0:
  flg = True
else:
  diff = a_list[-1]
  res_list = [a_list[-1]]
  for i in range(len(a_list)-2,-1,-1):
    v = node_list[i] - a_list[i] # 枝の数
    diff = min(diff,v) + a_list[i]
    res_list.append(diff)

if flg:
  print(-1)
else:
  print(sum(res_list))

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

node = 1
flg = False
node_list = [node]

for i in range(len(a_list)-1):
  num = a_list[i]
  next = node-num
  if next < 0:
    flg = True
    break
  node = next*2
  node_list.append(node)

if node - a_list[-1] < 0:
  flg = True

diff = a_list[-1]
res_list = [a_list[-1]]
for i in range(len(a_list)-2,-1,-1):
  v = node_list[i] - a_list[i] # 枝の数
  diff = min(diff,v) + a_list[i]
  res_list.append(diff)

if flg:
  print(-1)
else:
  print(sum(res_list))

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

node = 1
sum_node = 1
flg = False
node_list = [node]

for i in range(len(a_list)-1):
  num = a_list[i]
  next = node-num
  if next < 0:
    flg = True
    break
  node = next*2
  node_list.append(node)
  sum_node += node
  
diff = node - a_list[-1]
if diff < 0:
  flg = True

diff = a_list[-1]
res_list = [a_list[-1]]
for i in range(len(a_list)-2,-1,-1):
  v = node_list[i] - a_list[i] # 枝の数
  diff = min(diff,v) 
  res_list.append(diff+a_list[i])
  diff = diff + a_list[i]

if flg:
  print(-1)
else:
  print(sum(res_list))
Problem p02678 (python)

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

road = {k:[] for k in range(1,n+1)}
for _ in range(m):
  a,b = map(int,input().split())
  road[a].append(b)
  road[b].append(a)


next_visited = [1]
visited = {1:None}
temp_next = []

visit_num = {}
count = 0

while True:
  temp_next = []
  for room in next_visited:
    ava_room = road[room]
    for r in ava_room:
      try:
        visited[r]
      except:
        visit_num[r] = room
        temp_next.append(r)
        visited[r] = None
        
  if temp_next == []:
    break
  next_visited = temp_next

if len(visit_num) != n-1:
  print('No')

else:
  print('Yes')
  for v in sorted(visit_num.items()):
    print(v[1])

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

road = {k:[] for k in range(1,n+1)}
for _ in range(m):
  a,b = map(int,input().split())
  road[a].append(b)
  road[b].append(a)

def check_num(road_set):
  num = 0
  for i in list(road_set.keys()):
    visited = [i]
    next_room = road_set[i]
    num += 1
    while True:
      
      if next_room in visited:
        return -1
      
      if next_room == 1:
        break
        
      visited.append(next_room)
      next_room = road_set[next_room]
      num += 1
  return num


def rec(i,road_set):
  if i == n+1:
    num = check_num(road_set)
    global min_num,min_road
    if num > 0 and (min_num == None or min_num>num):
      min_num = num
      min_road = road_set.copy()
    return
     
  if 1 in road[1]:
    road_set[i] = 1
    rec(i+1,road_set)
  else:
    for r in road[i]:
      road_set[i] = r
      rec(i+1,road_set)
    
min_num = None
min_road = None

rec(2,{})
if min_num == None:
  print('No')
else:
  print('Yes')
  for v in min_road.values():
    print(v)

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

road = {k:[] for k in range(1,n+1)}
for _ in range(m):
  a,b = map(int,input().split())
  road[a].append(b)
  road[b].append(a)
  


def check_num(road_set):
  num = 0
  for i in list(road_set.keys()):
    visited = [i]
    next_room = road_set[i]
    num += 1
    while True:
      
      if next_room in visited:
        return -1
      
      if next_room == 1:
        break
        
      visited.append(next_room)
      next_room = road_set[next_room]
      num += 1
  return num


def rec(i,road_set):
  if i == n+1:
    num = check_num(road_set)
    global min_num,min_road
    if num > 0 and (min_num == None or min_num>num):
      min_num = num
      min_road = road_set.copy()
    return
      
  for r in road[i]:
    road_set[i] = r
    rec(i+1,road_set)
    
min_num = None
min_road = None

rec(2,{})
if min_num == None:
  print('No')
else:
  print('Yes')
  for v in min_road.values():
    print(v)
Problem p03047 (python)

Fixed submission:
N, K = map(int,input().split())
print(N - K + 1)

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

    print(N - K + 1)

Buggy submission (verdict: Runtime Error):
import sys

def main():
    data = input()
    flds = data.split(" ")
    N = int(flds[0])
    K = int(flds[1])

    count = 0
    for i in range(1, N):
        if i + K - 1 <= N:
#           print("%d -  %d" %(i, i + K - 1))
            count += 1

#   print("resut = " %count)
   print(count)

if __name__ == "__main__":
    main()
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())

if (R - L) // 2019 > 0:
    print(0)
elif (R - L) != (R % 2019 - L % 2019):
    print(0)
else:
    answer = 2019
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            tmp = i * j % 2019
            if tmp < answer:
                answer = tmp
    print(answer)

Buggy submission (verdict: Runtime Error):
if (R - L) // 2019 > 0:
    print(0)
elif (R - L) != (R % 2019 - L % 2019):
    print(0)
else:
    print(min(L * (L + 1) % 2019, R * (R - 1) % 2019, L * R % 2019))
Problem p02657 (python)

Fixed submission:

tmp=input().split(" ")
A=int(tmp[0])
B=int(tmp[1])

print(A*B)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())

print(A*B)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = input()
print(a*b)

Buggy submission (verdict: Runtime Error):
a,b = input()
return a*b
Problem p02658 (python)

Fixed submission:
n = input()
ans = 1
s = list(map(int, input().strip().split()))
if 0 in s:
    print(0)
    exit()
for i in s:
    if ans>10**18:
        print(-1)
        exit()
    ans = ans*i

if ans>10**18:
        print(-1)
        exit()
        
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
ans = 1
s = list(map(int, input().strip().split()))
if 0 in s:
    print(0)
    exit()
for i in s:
    if if ans>10**18:
        print(-1)
        exit()
    ans = ans*i

print(ans)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b　= map(int, input().split())
print(a*b)
Problem p02706 (python)

Fixed submission:
n, m = map(int, input().split())
li = input().split()
b = 0
for a in li:
    b = b + int(a)
if n >= b:
    print(n-b)
else:
    print("-1")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
li = input().split()
b = 0
for a in li:
    b = b + a
if n >= b:
    print(n-b)
else:
    print("-1")
Problem p03071 (python)

Fixed submission:
a, b = map(int, input().split())
if a>b:
    print(a+(a-1))
elif a==b:
    print(a*2)
elif a<b:
    print(b+(b-1))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a>b:
    print(a+(a-1))
elif a=b:
    print(a*2)
elif a<b:
    print(b+(b-1))
Problem p03109 (python)

Fixed submission:
s = input()
y = int(s[0:4])
m = int(s[5:7])
d = int(s[8:10])
if y > 2019:
    print("TBD")
elif y==2019 and	m>4:
    print("TBD")
else:
    print("Heisei")

Buggy submission (verdict: Runtime Error):
s = input()
y = int(s[0:4])
m = int(s[5:7])
d = int(s[8:10])
if y > 2019:
    print("TBD")
elif y=2019 and	m>4:
    print("TBD")
else:
    print("Heisei")
Problem p02658 (python)

Fixed submission:
import sys

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

if 0 in l:
	print(0)
	sys.exit()

flg=False
a = 1
for i in l:
	a *= i
	if a>10e17:
		flg=True
		break
 
if flg:
	print(-1)
else:
	print(a)

Buggy submission (verdict: Runtime Error):
from math import floor
 
a,b = list(map(float,input().split()))
print(floor(a*b))
Problem p02921 (python)

Fixed submission:
s = list(input())
t = list(input())
ans = 0
for i in range (3):
    if s[i] == t[i]:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
ans = 0
for i in range (3):
    if S[i] == T[i]:
        ans += 1
print(ans)
Problem p02657 (python)

Fixed submission:
import math;print(math.prod(map(int,input().split())))

Buggy submission (verdict: Runtime Error):
print(int(input())*int(input()))
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

print(A*B)
Problem p02690 (python)

Fixed submission:
X = int(input())

for a in range(-1000, 1000):
  for b in range(-1000, 1000):
    #print(a,b)
    if a**5 - b**5 == X:
      print(a, b)
      exit()

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

for a in range(-3, 3):
  for b in range(-3, 3):
    #print(a,b)
    if a**5 - b**5 == X:
      print(a, b)
      return()
Problem p02742 (python)

Fixed submission:
import math
H, W = map(int, input().split())

w1 = math.ceil(W/2)*math.ceil(H/2)
w2 = math.floor(W/2)*math.floor(H/2)

if H == 1:
    print(1)
elif W==1:
    print(1)
elif W != 1:
    print(w1+w2)

Buggy submission (verdict: Runtime Error):
import math
H, W = map(int, input().split())

w1 = math.ceil(W/2)*math.ceil(H/2)
w2 = math.floor(W/2)*math.floor(H/2)

if: H == 1:
    print(1)
elif W==1:
    print(1)
elif W != 1:
    print(w1+w2)
Problem p02789 (python)

Fixed submission:
N, M = map(int, input().split())

if N==M:
    print("Yes")
else:
    print("No")

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

if N==M:
    print("Yes")
else:
    print("No")
Problem p02796 (python)

Fixed submission:
N = int(input())
robots = [tuple(map(int,input().split())) for _ in range(N)]

#print(robots)
# 最大値と最小値を計算する
robots = [(x+l,x-l) for x,l in robots]
#print(robots)
# ソートする
robots.sort()
#print(robots)

cnt = 0
last = -float('inf')
for r,l in robots:
    #print(last, l, r)
    # 1個前の最大値を、今回の最小値が上回っていたらOK
    if last <= l:
        cnt += 1
        # 次の最大値を更新する
        last = r

print(cnt)

Buggy submission (verdict: Runtime Error):
# N個のロボット
N = int(input())

# 1個前
rem = 0
bx = 0
bl = 0
for i in range(N):
    x,l = map(int, input().split())
    
    #print(x,l, bx,bl)
    
    # 1個前と重複確認
    if i != 0:
        rn = list(range(x+l-1, x-l, -1 ))
        before = list(range(bx+bl-1, bx-bl, -1 ))
        #print(rn)
        #print(before)
        if len(set(rn) & set(before)) != 0:
            #print("rem")
            rem +=1
            # 1個前は変えないで次へ
            continue
        else:
            # 1個前を更新
            bx = x
            bl = l
    else:
        # 1個前を更新
        bx = x
        bl = l
    

print(N-rem)

Buggy submission (verdict: Runtime Error):
# N個のロボット
N = int(input())

X = []
L = []
for n in range(N):
    x,l = map(int, input().split())
    X.append(x)
    L.append(l)
    
rem = 0
flg = False
for i in range(0, N-1):
    # アームの行動範囲
    if flg == True:
        flg = False
        continue
    if i !=0:
        rn = list(range(X[i]+L[i]-1, X[i]-L[i], -1 ))
        before = list(range(X[i-1]+L[i-1]-1, X[i-1]-L[i-1], -1 ))
        next = list(range(X[i+1]+L[i+1]-1, X[i+1]-L[i+1], -1 ))
        #print(rn)
        #print(before)
        #print(next)
        
        # アームの可動範囲が被る
        if len(set(rn) & set(before)) != 0 or len(set(rn) & set(next)) != 0:
            rem +=1
            flg = True
    else:
        rn = list(range(X[i]+L[i]-1, X[i]-L[i], -1 ))
        next = list(range(X[i+1]+L[i+1]-1, X[i+1]-L[i+1], -1 ))
        #print(rn)
        #print(next)
        # アームの可動範囲が被る
        if len(set(rn) & set(next)) != 0:
            rem +=1
            flg = True

print(N-rem)
Problem p02802 (python)

Fixed submission:
import sys
from collections import defaultdict

n, m = map(int, input().split())
ac = 0
# 初期化
wa = defaultdict(lambda: 0)
already = set()
for line in sys.stdin:
    p, s = line.strip().split()
    p = int(p)
    # すでに正解していたらスキップ
    if p in already:
        continue
    # 初正解ならAC+1, 失敗回数を追加
    if s == 'AC':
        ac += 1
        already.add(p)
    # 失敗なら失敗回数を増やす
    else:
        wa[p] += 1

print(ac, sum(wa[i] for i in already))

Buggy submission (verdict: Runtime Error):
# N問出題
# M回提出
N, M = map(int, input().split())

AC = []
WC = []
ansAC
ansRC

for i in range(0, M):
    AC[i] = False
    WA[i] = 0

for m in range(0, M):
    p, s = input().split()
    # 正解
    if s == "AC" and int(p) <= N:
        AC[p] = True
        ansAC +=1
        ansWC += WA[p]
    # WAかつ未正解
    elif s == "WA" and (p not in ans):
        WA[p] +=1
    else:
        continue

print(len(set(ans)), pena)
Problem p02814 (python)

Fixed submission:
import fractions
n,m=map(int,input().split())
lis  = list(map(int,input().split()))
#aそれぞれを2で割ったものを持っておく
div = []
for i in range(n):
    div.append(lis[i]//2)
#lisそれぞれの要素を2で割り切れる回数をすべて数える
L = []
for i in range(n):
    cnt = 0
    while lis[i] %2 ==0:
        lis[i] //= 2
        cnt += 1
    L.append(cnt)

bl = True
#重複要素を削除して要素数でLがすべて一緒か判断
def set_list(es):
    return len(list(set(es))) == 1

if set_list(L) != 1:
    print(0)
    exit()

#div内の最小子公倍数ansを求める

ans = div[0]
for i in range(1,n):
    ans =ans*div[i]//fractions.gcd(ans,div[i])

S = m//ans
if S %2 ==0:
    print(S//2)
else:
    print(S//2 +1)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
# 長さN
# 整数M
N, M = map(int, input().split())

# 長さNからなる偶数列: a
a = list(set(map(int, input().split())))
print(a)

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

if M//(lcm_list(a)) == 0:
    print(0)
else:
    print(M//(lcm_list(a))+1)
Problem p03737 (python)

Fixed submission:
s = list(input().split())


ans = "".join([s[0][0],s[1][0],s[2][0]]).upper()
print(ans)

Buggy submission (verdict: Runtime Error):
#(1,0)と(1,1)が敗戦の最終状態。そこから遷移する状態を考える。
#(2,0),(3,0)は勝利状態。
#(2,1),(2,2)はどう遷移しても上記勝利状態に遷移してしまうので、敗北状態。
#(3,1),(4,0),(4,1),(5,0)...などが上記敗北状態に遷移できる状態なので勝利状態。
#実験を重ねると|X-Y|<=1が敗戦状態ではないか、という仮説が立つ。
#少し考えると、|X-Y|<=1からの遷移は必ず|X'-Y'|>1にならざるを得なくて
#|X-Y|>1からは必ず|X'-Y'|<=1となる遷移が存在することが分かる。
#最終的には|X-Y|<=1の状態は2N手後に(1,0)と(1,1)へと収斂するので、勝利条件が確定する。

X,Y=map(int,input().split())
if abs(X-Y)<=1:
    print("Brown")
else:
    print("Alice")
Problem p03761 (python)

Fixed submission:
N = int(input())

# 二次元配列の初期化
# 0番目をaの出現回数、
# 1番目をbの出現回数とする
x = [[0 for i in range(26)] for j in range(N)]
#print(x)

for n in range(N):
    tmp=list(input())
    # 文字列をソートする
    tmp.sort()

    # 重複排除して、それぞれの文字が何回出現したかを数える
    tmp2 = set(tmp)
    for l in tmp2:
        #print(n, ord(l)-97,l,  tmp.count(l))
        x[n][ord(l)-97]= tmp.count(l)

ans  =[]
# a~zまで調べていき、全員最低1回以上出していれば、
# その文字は出力する。最低出現回数分連続させる。
for i in range(26):
    tmp3 = [row[i] for row in x]
    tmp4 = chr(97+i)* min(tmp3) if min(tmp3) != 0 else ""
    ans.append(tmp4)

print("".join(ans))

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

# 二次元配列の初期化
# 0番目をaの出現回数、
# 1番目をbの出現回数とする
x = [[0 for i in range(24)] for j in range(N)]
#print(x)

for n in range(N):
    tmp=list(input())
    # 文字列をソートする
    tmp.sort()

    # 重複排除して、それぞれの文字が何回出現したかを数える
    tmp2 = set(tmp)
    for l in tmp2:
        #print(n, ord(l)-97,l,  tmp.count(l))
        x[n][ord(l)-97]= tmp.count(l)

ans  =[]
# a~zまで調べていき、全員最低1回以上出していれば、
# その文字は出力する。最低出現回数分連続させる。
for i in range(24):
    tmp3 = [row[i] for row in x]
    tmp4 = chr(97+i)* min(tmp3) if min(tmp3) != 0 else ""
    ans.append(tmp4)

print("".join(ans))

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

s=[]
x = [[0 for i in range(24)] for j in range(N)]
#print(x)


for n in range(N):
    tmp=list(input())
    tmp.sort()
    s.append(tmp)

    tmp2 = set(tmp)
    for l in tmp2:
        #print(n, ord(l)-97,l,  tmp.count(l))
        x[n][ord(l)-97]= tmp.count(l)

ans  =[]
for i in range(len(x)):
    tmp3 = [row[i] for row in x]
    tmp4 = chr(97+i)* min(tmp3) if min(tmp3) != 0 else ""
    ans.append(tmp4)

print("".join(ans))
Problem p03777 (python)

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

if a=="H" and b=="H":
    print("H")
elif a=="H" and b=="D":
    print("D")
elif a=="D" and b=="H":
    print("D")
elif a=="D" and b=="D":
    print("H")

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

if a=="H" and b=="H":
    print("H")
elif a=="H" and b=="D":
    print("D")
elif a=="D" and b=="H":
    print("D")
elif a=="D" and b=="D":
    print("H")
Problem p03816 (python)

Fixed submission:
N=int(input())

A = list(map(int, input().split()))
if len(A)==3:
  print(1)
elif (len(A)-len(set(A)))%2==1:
  print(len(set(A))-1)
else:
  print(len(set(A)))

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

A = set(map(int, input().split()))
print(Len(A))
Problem p03828 (python)

Fixed submission:
import math

n=int(input())
mod = 10**9+7

def get_sieve_of_eratosthenes(n):
    if n==1:
        return []
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

# エラトステネスの篩を使い、素数のリストを作る
E=get_sieve_of_eratosthenes(n)
# 素数の数を数える
l=len(E)
#print("len(e): ",l)

# カウンタ
co=1
# 0から素数までの値で、nを何回割れるかを数える
for e in E:
    co_sub=1
    # 対数。n=25,e=5の時,2を返す(5**"2"==25)
    l_sub=int(math.log(n,e))
    # 対数の数だけ繰り返す
    for j in range(1,l_sub+1):
        # 割れる回数をカウンタに追加
        co_sub+=n//(e**j)
    co*=co_sub
    # 大きすぎるのでmodのあまりにする
    co%=mod
    #print(co_sub)
print(co)

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

# Nの階乗を計算する
factorial = [1] * (N+1)
mod = 10 ** 9 + 7
for i in range(1, N+1):
    factorial[i] = i * factorial[i - 1]
    
#print(factorial)

n = factorial[-1]
#print(n)

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
arr = []
temp = n
for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
        cnt=0
        while temp%i==0:
            cnt+=1
            temp //= i
        arr.append([i, cnt])

if temp!=1:
    arr.append([temp, 1])

if arr==[]:
    arr.append([n, 1])

#print(arr)
# 素因数の出現回数をカウントする
ans = 0
for i,j in arr:
    #print(i**j)
    ans += i**j
    
print(ans)
Problem p03853 (python)

Fixed submission:
H, W = map(int, input().split())

# 絵を入力
C = [input() for _ in range(H)]
 
# 2回出力
for i in range(H):
    for j in range(2):
        print(C[i])

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())

# キャンバスを初期化
pixel = [["."] * H for i in range(W)]

# 入力
for h in range(H):
    pixel[h] = list(input())

# 同じ行を2回繰り返して表示する
for h in range(H):
    print("".join(pixel[h]))
    print("".join(pixel[h]))

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())

# キャンバスを初期化
#pixel = [["."] * H for i in range(W)]
pixel = []

# 入力
for h in range(H):
    pixel[h] = list(input())

# 同じ行を2回繰り返して表示する
for h in range(H):
    print("".join(pixel[h]))
    print("".join(pixel[h]))

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())

pixel = [["."] * H for i in range(W)]

# 入力
for h in range(H):
    pixel[h] = list(input())

# 同じ行を2回繰り返して表示する
for h in range(H):
    print("".join(pixel[h]))
    print("".join(pixel[h]))

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())

pixel = [["."] * H for i in range(W)]

# 入力
for h in range(H):
    pixel[h] = list(input())

# 同じ行を2回繰り返して表示する
for h in range(H):
    print("".join(pixel[h]))

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())

pixel = [["."] * H for i in range(W)]

# 入力
for h in range(H):
    pixel[h] = list(input())

# 同じ行を2回繰り返して表示する
for h in range(H):
    print(pixel[h])
    print(pixel[h])

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())

pixel = [["."] * H for i in range(W)]

# 入力
for h in range(H):
    pixel[h] = list(input())

# 同じ行を2回繰り返して表示する
for h in range(H):
    print(pixel[h])
    print(pixel[h])