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

Fixed submission:
a = raw_input()
b = raw_input()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
	print 'YES' 
else:
	print 'NO'

Buggy submission (verdict: Runtime Error):
a,b,c = map(str,raw_input().split())
d,e,f = map(str,raw_input().split())
if a==f and b==e and c==d:
	print 'YES' 
else:
	print 'NO'

Buggy submission (verdict: Runtime Error):
a,b,c = map(str,raw_input().split())
d,e,f = map(str,raw_input().split())
if a==f and b==e and c==d :
	print "YES" 
else :
	print "NO"

Buggy submission (verdict: Runtime Error):
a,b,c = map(raw_input().split())
d,e,f = map(raw_input().split())
if a==f and b==e and c==d:
	print 'YES'
else:
	print 'NO'

Buggy submission (verdict: Runtime Error):
a,b,c = map(raw_input().split())
d,e,f = map(raw_input().split())
if a==f and b==e and c==d :
	print "YES" 
else :
	print "NO"
Problem p03643 (python)

Fixed submission:
n = raw_input()
print "ABC" + n

Buggy submission (verdict: Runtime Error):
n = (int)raw_input()
print "ABC" + (str)n
Problem p03731 (python)

Fixed submission:
num,time = map(int, raw_input().split())
t = raw_input().split()
ans = time
for i in range(0,num-1):
	if int(t[i+1])-int(t[i]) < time:
		ans += int(t[i+1])-int(t[i])
	else:
		ans += time
print ans

Buggy submission (verdict: Runtime Error):
num,time = map(int, raw_input().split())
t = raw_input().split()
ans = time
for i in range(0,num-1):
  a = int(t[i+1])-int(t[i]) 
	if a < time:
		ans += a
	else:
		ans += time
print ans

Buggy submission (verdict: Runtime Error):
num,time = map(int, raw_input().split())
t = raw_input().split()
ans = 0
for i in t:
	if i<time:
		ans += i
	else:
	ans += time
ans += time
ans -= t[len(t)]
print ans

Buggy submission (verdict: Runtime Error):
num,time = map(int, raw_input().split())
t = raw_input().split()
ans = 0
for i in t:
	if i<time:
		ans += i
	else:
	ans += time
ans += time
ans -= t[len(t)-1]
print ans

Buggy submission (verdict: Runtime Error):
num,time = map(int,raw_input().split())
t = map(int, raw_input().split())
ans = 0
for i in range(len(t)-1):
	if t(i)<time:
		ans += t(i)
	else:
	ans += time
ans += time
print ans

Buggy submission (verdict: Runtime Error):
num,time = map(int,raw_input().split())
t = map(int, raw_input().split())
ans = 0
for i in range(len(t)-1):
	if t[i]<time:
		ans += t[i]
	else:
	ans += time
ans += time
print ans
Problem p03760 (python)

Fixed submission:
o = raw_input()
e = raw_input()
s = ""
l = len(o)
if len(e)>l:
	l = len(e)
for i in range(l):
	if i<len(o):
		s = s+o[i]
	if i<len(e):
		s = s+e[i]
print s

Buggy submission (verdict: Runtime Error):
o,e = map(str, raw_input().split())
s = ""
for i in range(len(o)):
	s += o[i]+e[i]
print s

Buggy submission (verdict: Runtime Error):
o,e = map(str, raw_input().split())
s = ""
for i,j in o,e:
	s += i
	s += j
print s
Problem p03860 (python)

Fixed submission:
a,b,c = map(str, raw_input().split())
print a[0] + b[0] + c[0]

Buggy submission (verdict: Runtime Error):
a,b,c = map(str, raw_input().split())
print b[1]
Problem p02900 (python)

Fixed submission:
# from math import factorial
# from collections import defaultdict, deque
#  from heapq import heappush, heappop, heapify

# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
# As = [int(i) for i in input().split(" ")]
# Ss = ["".join(sorted(input())) for _ in range(N)]
# edges = defaultdict(list)
# for _ in range(N - 1):
#     a, b = [int(i) for i in input().split(" ")]
#     edges[a-1].append(b-1)
import math

A, B = [int(i) for i in input().split(" ")]

def solve(n):
    ans, i = [], 1
    while i * i <= n:
        div, mod = divmod(n, i)
        if mod == 0:
            ans.append(i)
            if i != div:
                ans.append(div)
        i += 1
    return list(sorted(ans))  # 順番気にしないならソートせずにより高速

a = solve(A)
b = solve(B)
c = list(sorted(set(a) & set(b)))
# print(c)

ans = []
for i in c:
   for a in ans:
       if a == 1: continue
       if i % a == 0:
          break
   else:
      ans.append(i) 
# print(ans)
print(len(ans))

Buggy submission (verdict: Runtime Error):
# from math import factorial
# from collections import defaultdict, deque
#  from heapq import heappush, heappop, heapify

# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
# As = [int(i) for i in input().split(" ")]
# Ss = ["".join(sorted(input())) for _ in range(N)]
# edges = defaultdict(list)
# for _ in range(N - 1):
#     a, b = [int(i) for i in input().split(" ")]
#     edges[a-1].append(b-1)
import math

A, B = [int(i) for i in input().split(" ")]
a, b = [], []
m = math.gcd(A, B)
# print(m)
i = 1
while i <= m:
  if A % i == 0:
     a.append(i)
  if B % i == 0:
     b.append(i)
  i += 1
c = list(sorted(set(a) & set(b)))
ans = []
# print(c)
for i in c:
   for a in ans:
       if a == 1: continue
       if i % a == 0:
          break
   else:
      ans.append(i) 
print(len(ans))
Problem p02922 (python)

Fixed submission:
# from math import factorial
# from collections import defaultdict, deque
#  from heapq import heappush, heappop

# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
# As = [int(i) for i in input().split(" ")]
# Ss = ["".join(sorted(input())) for _ in range(N)]
# A = int(input())

A, B = [int(i) for i in input().split(" ")]
total = A
ans = 1
while True:
   if B <= total: break
   ans += 1
   total += A  -1
if B == 1:  print(0)
else: print(ans)

Buggy submission (verdict: Runtime Error):
# from math import factorial
# from collections import defaultdict, deque
#  from heapq import heappush, heappop

# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
# As = [int(i) for i in input().split(" ")]
# Ss = ["".join(sorted(input())) for _ in range(N)]
# A = int(input())

A, B = [int(i) for i in input().split(" ")]
total = A
ans = 1
if B == 1: return 0
while True:
   if B <= total: break
   ans += 1
   total += A  -1
print(ans)
Problem p02957 (python)

Fixed submission:
A, B = [int(i) for i in input().split(" ")]
if (A + B) % 2 == 0: print((A + B) // 2)
else: print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
package main

import (
	"fmt"
)

func main() {
	var A, B int
	fmt.Scan(&A)
	fmt.Scan(&B)
	if (A + B) % 2 == 0 {
		fmt.Println((A + B) / 2)
	} else {
		fmt.Println("IMPOSSIBLE")
	}
}

Buggy submission (verdict: Runtime Error):
package main

import (
	"fmt"
	"math"
)

func main() {
	var A, B int
	fmt.Scan(&A)
	fmt.Scan(&B)
	if (A + B) % 2 == 0 {
		fmt.Println((A + B) / 2)
	} else {
		fmt.Println("IMPOSSIBLE")
	}
}
Problem p03023 (python)

Fixed submission:
print((int(input())-2) * 180)

Buggy submission (verdict: Runtime Error):
print(3 * N)

Buggy submission (verdict: Runtime Error):
90 * N
Problem p03024 (python)

Fixed submission:
n = len([s for s in input() if s == "x"])
if n < 8: print("YES")
else: print("NO")

Buggy submission (verdict: Runtime Error):
n = len([s for s in S if s == "x"])
if n >= 8: print("NO") 
else: print("YES")
Problem p02917 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline

N = int(input())
b_arr = list(map(lambda b: int(b), input().split()))
a_arr = list(range(N))

for n in range(N-1, -1, -1):
    if (n == N-1) or (n == N-2):
        a_arr[N-1] = b_arr[N-2]
        a_arr[N-2] = b_arr[N-2]
    elif b_arr[n+1] >= b_arr[n]:
        a_arr[n+1] = b_arr[n]
        a_arr[n] = b_arr[n]
    else:
        a_arr[n] = b_arr[n]

print(sum(a_arr))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline

N = int(input())
b_arr = list(map(lambda b: int(b), input().split()))
a_arr = list(range(N))

for n in range(N-1, -1, -1):
    if (n == N-1) or (n == N-2):
        a_arr[N-1] = b_arr[N-2]
        a_arr[N-2] = b_arr[N-2]
    elif b_arr[n+1] >= b_arr[n]:
        a_arr[n+1] = b_arr[n]
        a_arr[n] = b_arr[n]
    else:
        a_arr[n] = b_arr[n]

print(sum(a_arr)
Problem p02936 (python)

Fixed submission:
import sys
from heapq import *
sys.setrecursionlimit(10**8)

input = sys.stdin.readline

tree = [[] for _ in range(200001)]
res = [0]*200001

def dfs(p, pre):
    for child in tree[p]:
        if child == pre: continue
        res[child] += res[p]
        dfs(child, p)

def main():
    """ main """
    N, Q = map(int, input().split())
    for _ in range(N-1):
        a,b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)
    for _ in range(Q):
        p,x = map(int, input().split())
        res[p] += x
    dfs(1, 0)

    print(*res[1:N+1])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
tree = [[] for _ in range(200001)]
res = [0]*200001
 
def dfs(p, pre):
    for child in tree[p]:
        if child == pre: continue
        res[child] += res[p]
        dfs(child, p)
 
def main():
    """ main """
    N, Q = map(int, input().split())
    for _ in range(N-1):
        a,b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)
    for _ in range(Q):
        p,x = map(int, input().split())
        res[p] += x
    dfs(1, 0)
 
    print(*res[1:N+1])
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
tree = [[] for i in range(200001)]
scores = [0 for i in range(200001)]

def dfs(pre, p):
    for child in tree[p]:
        if child == pre: continue
        scores[child] += scores[p]
        dfs(p, child)

def main():
    for _ in range(N-1):
        a, b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)

    for _ in range(Q):
        p, x = map(int, input().split())
        scores[p] += x
    dfs(0, 1)
    print(' '.join(map(str, scores[1:N+1])))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
tree = [[] for i in range(N+1)]
scores = [0 for i in range(N+1)]

def dfs(pre, p):
    for child in tree[p]:
        if child == pre: continue
        scores[child] += scores[p]
        dfs(p, child)

def main():
    for _ in range(N-1):
        a, b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)

    for _ in range(Q):
        p, x = map(int, input().split())
        scores[p] += x
    dfs(0, 1)
    print(' '.join(map(str, scores[1:])))

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

Fixed submission:
inputs = input().split()
a, b = int(inputs[0]), int(inputs[1])
prod = a*b

if prod % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
inputs = input().split()
a, b = inputs[0], inputs[1]
prod = a*b

if prod % 2 == 0:
    print('Even')
else:
    print('Odd')
Problem p02909 (python)

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


def solve(S: str):
    if S == "Sunny":
        print("Cloudy")
    elif S == "Cloudy":
        print("Rainy")
    else:
        print("Sunny")
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import collections
import itertools


def solve(N: int, S: str):
    dp = [[0 for _ in range(N)] for _ in range(N)]

    for i in range(N):
        if S[i] == S[-1]:
            dp[i][N-1] = 1

    res = 0
    for i in range(N-2,-1,-1):
        for j in range(N-2,i,-1):
            if S[i] == S[j]:
                dp[i][j] = dp[i+1][j+1] + 1
                l = dp[i][j]
                if j >= i+l:
                    res = max(res,l)

    print(res)



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, S)

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

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

MOD = 2  # type: int

def solve(N: int, A: "List[int]"):
    ans = set()
    for i in range(N,0,-1):
        c = 0
        for j in range(2,N + 1):
            if i * j <= N:
                if i*j in ans:
                    c += 1
            else:
                break

        if A[i-1] == 0:
            if c % 2 == 1:
                ans.add(i)
        else:
            if c % 2 == 0:
                ans.add(i)

    print(len(ans))
    if len(ans):
        print(" ".join([str(i) for i in ans]))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

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

MOD = 2  # type: int

def solve(N: int, A: "List[int]"):
    ans = []
    for i in range(N,0,-1):
        c = 0
        for j in range(2,N + 1):
            if i * j <= N:
                if A[i*j-1] == 1:
                    c += 1
        if A[i-1] == 0:
            if c % 2 == 1:
                ans.append(i)
        else:
            if c % 2 == 0:
                ans.append(i)

    print(len(ans))
    for i in ans:
        print(f"{i} ",end="")

    print("")

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

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

Fixed submission:
#!/usr/bin/env python3
import sys
import itertools
import operator
import collections

def solve(N: int, x: "List[int]", y: "List[int]"):
    if N == 1:
        print(1)
        return

    PL = list(zip(x,y))
    PL.sort(key = operator.itemgetter(0,1))

    pqdic = collections.defaultdict(list)
    for i in range(N-1):
        for j in range(i+1,N):
            p = PL[j][0] - PL[i][0]
            q = PL[j][1] - PL[i][1]
            pqdic[p,q].append((i,j))

    max_pqlen = 0
    for k,v in pqdic.items():
        max_pqlen = max(max_pqlen,len(v))

    print(N - max_pqlen)




# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]" 
    y = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, x, y)

if __name__ == '__main__':
    main()

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

def solve(N: int, x: "List[int]", y: "List[int]"):
    PL = list(zip(x,y))

    mincost = float('inf')
    for seq in itertools.permutations(PL):
        cost = 1
        p = seq[1][0] - seq[0][0]
        q = seq[1][1] - seq[0][1]
        #print(seq)
        for i in range(1,len(seq)):
            p2 = seq[i][0] - seq[i-1][0] 
            q2 = seq[i][1] - seq[i-1][1] 
            #print(p,p2,q,q2)
            if p != p2 or  q != q2:
                cost += 1
        mincost = min(mincost,cost)

    print(mincost)
            


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]" 
    y = [int()] * (N)  # type: "List[int]" 
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, x, y)

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

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


def solve(S: str, K: int):
    for i,s in enumerate(S):
        if s != "1":
            print(s)
            return
        elif i == (K - 1):
            print(s)
            return
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: int
    K = int(next(tokens))  # type: int
    solve(S, K)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
from itertools import *


def solve(S: str, K: int):
    onelen = len(list(takewhile(lambda x:x=="1",S)))
    res = "1" if onelen > K else S[onelen]
    print(res)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: int
    K = int(next(tokens))  # type: int
    solve(S, K)

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

Fixed submission:
#!/usr/bin/env python3
import sys
import operator
import itertools

def op(op_str):
    funcs = {
            "+":operator.add,
            "-":operator.sub
            }
    return funcs[op_str]

def solve(A,B,C,D):
    for o in itertools.product(["+","-"], repeat = 3):
        ret = op(o[0])(A,B)
        ret = op(o[1])(ret,C)
        ret = op(o[2])(ret,D)
        if ret == 7:
            print("{0}{1}{2}{3}{4}{5}{6}=7".format(A,o[0],B,o[1],C,o[2],D))
            return


    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    S = input()
    L = [int(c) for c in S]
    
    solve(*L)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import operator
import itertools

def op(op_str):
    funcs = {
            "+":operator.add,
            "-":operator.sub
            }
    return funcs[op_str]

def solve(A,B,C,D):
    for o in itertools.product(["+","-"], repeat = 3):
        ret = op(o[0])(A,B)
        ret = op(o[1])(C,ret)
        ret = op(o[2])(D,ret)
        if ret == 7:
            print(f"{A}{o[0]}{B}{o[1]}{C}{o[2]}{D}=7")
            return


    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    S = input()
    L = [int(c) for c in S]
    
    solve(*L)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import operator
import itertools

def op(op_str):
    funcs = {
            "+":operator.add,
            "-":operator.sub
            }
    return funcs[op_str]

def solve(A,B,C,D):
    for o in itertools.product(["+","-"], repeat = 3):
        ret = op(o[0])(A,B)
        ret = op(o[1])(C,ret)
        ret = op(o[2])(D,ret)
        if ret == 7:
            print(f"{A}{o[0]}{B}{o[1]}{C}{o[2]}{D}=7")


    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    S = input()
    L = [int(c) for c in S]
    
    solve(*L)

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

Fixed submission:
N = int(input())
D = {}
for _ in range(N):
    S = "".join(sorted(input()))
    if S in D:
        D[S] += 1
    else:
        D[S] = 1
 
out = 0
for i in D.values():
    out += i * (i-1) //2
print(out)

Buggy submission (verdict: Runtime Error):
N = int(input())
D = {}
for _ in range(N):
    S = "".join(sorted(input()))
    if S in D:
        D[S] += 1
    else:
        D[S] = 1
 
ans = 0
for i in D.values():
    out += i-1
print(out)
Problem p03000 (python)

Fixed submission:
N, X = map(int, input().split())
L = [x for x in map(int, input().split())]

D, count = 0, 1
for i in range(0, N):
    D = D+L[i]
    if D > X:
        break
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = [x for x in map(int, input().split())]

D, count = 0, 0
while D<=X:
    D = D+L[count]
    count += 1
print(count)
Problem p02900 (python)

Fixed submission:
#D
import fractions

a, b = map(int, input().split())

kouyaku = fractions.gcd(a, b)

def prime_factorize(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 //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
import collections
c = collections.Counter(prime_factorize(kouyaku))
d =list(c.values())
print(len(d) +1)

Buggy submission (verdict: Runtime Error):
#D
import math

a, b = map(int, input().split())

kouyaku = math.gcd(a, b)
#ruto = round(math.sqrt(kouyaku))
ans = 1

if kouyaku%2 == 0:
    ans +=1

pn=[2];A=kouyaku
for L in range(3,A):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:
        pn.append(L)
        if kouyaku%L == 0:
            ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
#D
import math

a, b = map(int, input().split())

kouyaku = math.gcd(a, b)
#ruto = round(math.sqrt(kouyaku))
ans = 1

pn=[2];A=kouyaku
for L in range(3,A):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:pn.append(L)

for i in pn:
    if kouyaku % i == 0:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
#D
import math

a, b = map(int, input().split())

kouyaku = math.gcd(a, b)
#ruto = round(math.sqrt(kouyaku))
ans = 1

pn=[2];A=kouyaku
for L in range(3,A):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:pn.append(L)

for i in pn:
    if kouyaku % i == 0:
        ans += 1
print(ans)
Problem p03493 (python)

Fixed submission:
def resolve():
    S = input()
    ans = 0
    if S[0] == "1":
        ans += 1
    if S[1] == "1":
        ans += 1
    if S[2] == "1":
        ans += 1
    print(ans)
resolve()

Buggy submission (verdict: Runtime Error):
    S = input()
    ans = 0
    if S[0] == "1":
        ans += 1
    if S[1] == "1":
        ans += 1
    if S[2] == "1":
        ans += 1
    print(ans)

Buggy submission (verdict: Runtime Error):
    S = input()
    ans = 0
    if S[0] == "1":
        ans += 1
    if S[1] == "1":
        ans += 1
    if S[2] == "1":
        ans += 1
    print(ans)