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

Fixed submission:
waitTime = []
_time = 0
for i in range(0,5):
    t, mod = divmod(int(input()), 10)
    _time += (t * 10)
    if mod != 0:
        waitTime.append(mod)
if len(waitTime) > 0:
    waitTime = sorted(waitTime, reverse= True)
    _time += (len(waitTime) - 1) * 10
    _time += min(waitTime)
print(_time)

Buggy submission (verdict: Runtime Error):
waitTime = []
_time = 0
for i in range(0,5):
    t, mod = divmod(int(input()), 10)
    _time += (t * 10)
    if mod != 0:
        waitTime.append(mod)
waitTime = sorted(waitTime, reverse= True)
_time += (len(waitTime) - 1) * 10
_time += min(waitTime)
print(_time)
Problem p03109 (python)

Fixed submission:
print('Heisei' if input()<'2019/05/01' else 'TBD')

Buggy submission (verdict: Runtime Error):
import datetime

base_date = datetime.date(2019, 4, 30)
y, m, d = map(int, input().split('/'))
if (base_date < datetime.date(y, m, d)):
    return ("TBD")
else:
    return ("Heisei")

Buggy submission (verdict: Runtime Error):
import datetime

y, m, d = map(int, input().split('/'))
y, m, d = map(int, dam.split('/'))
if (base_date < datetime.date(y, m, d)):
    return ("TBD")
else:
    return ("Heisei")
Problem p03125 (python)

Fixed submission:
x, y = map(int, input().split(' '))
if y % x == 0:
    print(x+y)
else:
    print(y-x)

Buggy submission (verdict: Runtime Error):
num = int(input())
num_ls = sorted([x for x in map(int, input().split(' '))])
while True:
    dam = []
    searchMin = [ x for x in num_ls if x != 1 ]
    for x in num_ls:
        div = x % min(searchMin)
        if div == 0:
            dam.append(x)
        else:
            dam.append(div)

    if num_ls == dam:
        break
    else:
        num_ls = dam

print(min(num_ls))
Problem p03408 (python)

Fixed submission:
dic_words = {}
for i in range(0, int(input())):
    word = input()
    if word in dic_words.keys():
        dic_words[word] += 1
    else:
        dic_words[word] = 1

for i in range(0, int(input())):
    word = input()
    if word in dic_words.keys():
        dic_words[word] -= 1
    else:
        dic_words[word] = -1

if (max(dic_words.values()) >= 0):
    print(max(dic_words.values()))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
num = int(input())
dic = { "JPY": 0, "BTC": 0 }
for i in range(0, num):
    val, coin = input().split(' ')
    dic[coin] += float(val)
print(dic["JPY"] + (dic["BTC"] * 380000.0))

def two_colors_card_game():
dic_words = {}
for i in range(0, int(input())):
    word = input()
    if word in dic_words.keys():
        dic_words[word] += 1
    else:
        dic_words[word] = 1

for i in range(0, int(input())):
    word = input()
    if word in dic_words.keys():
        dic_words[word] -= 1
    else:
        dic_words[word] = -1

if (max(dic_words.values()) >= 0):
    print(max(dic_words.values()))
else:
    print(0)
Problem p02837 (python)

Fixed submission:
import itertools
N = int(input())
item = []
for i in range(N):
    A = int(input())
    s = []
    for ii in range(A):
        x, y = map(int, input().split())
        s.append((x, y))
    item.append(s)

Ps = itertools.product([0, 1], repeat=N)
ans = 0
for P in Ps:
    right = True
    for i, p in enumerate(P):
        if p == 1:
            for x, y in item[i]:
                if (y == 1 and P[x - 1] == 0) or (y == 0 and P[x - 1] == 1):
                    right = False
    if right:
        ans = max(ans, sum(P))

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
N = int(input())
item = []
for i in range(N):
    A = int(input())
    s = []
    for ii in range(A):
        x, y = map(int, input().split())
        s.append((x, y))
        item.append(s)

Ps = itertools.product([0, 1], repeat=N)
ans = 0
for P in Ps:
    right = True
    for i, p in enumerate(P):
        if p == 1:
            for x, y in item[i]:
                if (y == 1 and P[x - 1] == 0) or (y == 0 and P[x - 1] == 1):
                    right = False
    if right:
        ans = max(ans, sum(P))

print(ans)
Problem p02952 (python)

Fixed submission:
result = 0
for n in range(int(input())):
    result += len(str(n+1))%2
print(result)

Buggy submission (verdict: Runtime Error):
result = 0
for n in range(int(input())):
    result += len(n+1)%2
print(result)
Problem p02898 (python)

Fixed submission:
n, k = map(int,input().split())
h = list(map(int,input().split()))
c = 0
 
for i in range(n):
  if h[i] >= k:
    c += 1
  
print(c)

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

for i in len(h):
  if h[i] >= K:
    c += 1
  
print(c)
Problem p02921 (python)

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

c = 0
 
for i, j in zip(s,t):
  if i == j:
    c += 1
 
print(c)

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

c = 0

for i in range(3):
  if s[i]==t[i]:
    c += 1

print(c)
Problem p02924 (python)

Fixed submission:
n = int(input())
sum = n * (n - 1) // 2
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = list(range(n))
print(sum(lst))
Problem p02971 (python)

Fixed submission:
n = int(input())
A = []
for i in range(n):
  a = int(input())
  A.append(a)
m = max(A)
c = A.count(m)

if len(set(A)) > 1:
	m2 = sorted(set(A))[-2]

bool = False
if c == 1:
  bool = True

for i in A:
  if bool and i==m:
    print(m2)
  else:
    print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = []
for i in range(n):
  a = int(input())
  A.append(a)
m = max(A)
m2 = sorted(set(A))[-2]
c = A.count(m)

bool = False
if c == 1:
  bool = True

for i in A:
  if bool and i==m:
    print(m2)
  else:
    print(m)
Problem p02982 (python)

Fixed submission:
n , D =map(int,input().split())
import math
 
a = [input().split() for l in range(n)]
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      x = []
      for c in range(D):
        x.append((int(a[i][c]) - int(a[j][c])) ** 2)
      d = math.sqrt(sum(x))
      d = float(d)
      if d.is_integer():
        count += 1
print(int(count/2))

Buggy submission (verdict: Runtime Error):
n , d =map(int,input().split())
import sys
import math
 
a = [map(int,input().split()) for l in range(n)]
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      d = math.sqrt((a[i][0] - a[j][0]) ** 2 + (a[i][1] - a[j][1]) ** 2 +(a[i][2] - a[j][2]) ** 2  +(a[i][3] - a[j][3]) ** 2  + (a[i][4] - a[j][4]) ** 2)
      d = float(d)
      if d.is_integer():
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n , d =map(int,input().split())
import sys
import math
 
a = [[int(c) for c in l.strip()] for l in sys.stdin]
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      d = math.sqrt((a[i][0] - a[j][0]) ** 2 + (a[i][1] - a[j][1]) ** 2 +(a[i][2] - a[j][2]) ** 2  +(a[i][3] - a[j][3]) ** 2  + (a[i][4] - a[j][4]) ** 2)
      d = float(d)
      if d.is_integer():
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n , d =map(int,input().split())
import sys
import numpy as np
 
a = [[int(c) for c in l.strip()] for l in sys.stdin]
a_ = np.array(a)
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      u = a[i] - a[j]
      norm = numpy.linalg.norm(u)
      if norm.is_integer():
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n , d =map(int,input().split())
import sys
import numpy

a = [[int(c) for c in l.strip()] for l in sys.stdin]
a_ = np.array(a)
count = 0

for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      u = a[i] - a[j]
      norm = numpy.linalg.norm(u)
      if norm.is_integer():
        count += 1
print(count)
Problem p02983 (python)

Fixed submission:
l, r = map(int, input().split())
x = []

if l <= 2019 <= r:
  print(0)
elif r - l > 2018:
  print(0)
else:
  x = []
  for i in range(l, r):
    for j in range(i+1, r+1):
      m = i * j % 2019
      x.append(m) 
  print(min(x))

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())
x = []

if l =< 2019 =< r:
  print(0)
elif r - l > 2018:
  print(0)
else:
  x = []
  for i in range(l, r):
    for j in range(i+1, r+1):
      m = i * j % 2019
      x.append(m) 
  print(min(x))
Problem p02988 (python)

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

count = 0

for i in range(N-2):
  if num[i]>num[i+1]>num[i+2] or num[i]<num[i+1]<num[i+2]:
    count += 1

print(count)

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

count = 0

for i in range(N-3):
  if num[i] < num[i+1] < num[i+2]:
    count += 1
  elif num[i] > num[i+1] > num[i+2]:
    count += 1

print(count)
Problem p02994 (python)

Fixed submission:
N, L = map(int, input().split())
 
if L > 0: print(sum([i for i in range(L+1, L+N)]))
elif L+N-1 < 0: print(sum([i for i in range(L, L+N-1)]))
else: print(sum([i for i in range(L, L+N)]))

Buggy submission (verdict: Runtime Error):
nl=list(map((int,input().split())))
a=[i+nl[1] for i in range(nl[0])]
 
a_sum = sum(a)
abs_ = []
for i in range(nl[0]):
  abs_.append(abs(a_sum - a[i]))
idx=abs_.index(min(abs_))
print(a_sum-a[idx])

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

a_sum = sum(a)
abs_ = []
for i in range(nl[0]):
  abs_.append(abs(a_sum - a[i]))
idx=abs_.index(min(abs_))
print(a_sum-a[idx])
Problem p02936 (python)

Fixed submission:
n, q = map(int, input().split())
parents = [set() for _ in range(n)]
nodes = [0 for _ in range(n)]

for _ in range(n - 1):
    a, b = map(int, input().split())
    parents[b - 1].add(a - 1)

for _ in range(q):
    i, k = map(int, input().split())
    nodes[i - 1] += k

for i, p in enumerate(parents):
    nodes[i] += sum([nodes[j] for j in p])

print(*nodes)

Buggy submission (verdict: Runtime Error):
n, q = list(map(int, input().split()))
childs = [set() for _ in range(n)]
nodes = [0 for _ in range(n)]
for _ in range(n - 1):
    line = input().split()
    a, b = int(line[0]), int(line[1])
    childs[a - 1].add(b - 1)


def add(i, k):
    global childs
    nodes[i] += k
    for j in childs[i]:
        add(j, k)


for _ in range(q):
    line = input().split()
    i, k = int(line[0]), int(line[1])
    add(i - 1, k)

print(' '.join(map(str, nodes)))

Buggy submission (verdict: Runtime Error):
n, q = list(map(int, input().split()))
childs = [set() for _ in range(n)]
nodes = [0 for _ in range(n)]
for _ in range(n - 1):
    line = input().split()
    a, b = int(line[0]), int(line[1])
    childs[a - 1].add(b - 1)


def add(i, k):
    global childs
    nodes[i] += k
    for j in childs[i]:
        add(j, k)


for _ in range(q):
    line = input().split()
    i, k = int(line[0]), int(line[1])
    add(i - 1, k)

print(' '.join(map(str, nodes)))
Problem p03328 (python)

Fixed submission:
def Gauss_sum(n):
  return n*(n+1)//2
a,b=map(int,input().split())
for i in range(999):
  if Gauss_sum(i+1)-a == Gauss_sum(i+2)-b:
    print(Gauss_sum(i+1)-a)
    break

Buggy submission (verdict: Runtime Error):
def Gauss_sum(n):
  return n*(n+1)//2
a,b=map(int,input())
for i in range(999):
  if Gauss_sum(i+1)-a == Gauss_sum(i+2)-b:
    print(Gauss_sum(i+1)-a)
    break
Problem p03387 (python)

Fixed submission:
A,B,C=map(int,input().split())
odd = A%2+B%2+C%2
answer = 0
if odd == 1:
  answer = 1
  if not A%2:
    A += 1
  if not B%2:
    B += 1
  if not C%2:
    C += 1
elif odd == 2:
  answer = 1
  if A%2:
    A += 1
  if B%2:
    B += 1
  if C%2:
    C += 1
D = sorted([A,B,C])
answer += (D[2]-D[0])//2+(D[2]-D[1])//2
print(answer)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
even += A%2+B%2+C%2
answer = 0
if even == 1:
  answer = 1
  if A%2:
    A += 1
  if B%2:
    B += 1
  if C%2:
    C += 1
elif even == 2:
  answer = 1
  if not A%2:
    A += 1
  if not B%2:
    B += 1
  if not C%2:
    C += 1
D = sorted([A,B,C])
answer += (D[2]-D[0])//2+(D[2]-D[1])//2
Problem p03434 (python)

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
answer = 0
for i in range(0,N,2):
  answer += a[i]
for i in range(1,N,2):
  answer -= a[i]
print(answer)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split())).sort(reverse=True)
answer = 0
for i in range(0,N,2):
  answer += a[i]
for i in range(1,N,2):
  answer -= a[i]
print(answer)
Problem p03599 (python)

Fixed submission:
A,B,C,D,E,F=map(int,input().split(' '))
water = set()
for a in range(0,F,100*A):
  for b in range(0,F,100*B):
    if a+b <= F:
      water.add(a+b)
    else:
      break
sugars = set()
for c in range(0,F,C):
  for d in range(0,F,D):
    if c+d <= F:
      sugars.add(c+d)
    else:
      break
density = 0
sugar = 0
content = 100*A
for x in water:
  for y in sugars:
    if x+y != 0 and x+y <= F and E*x >= 100*y and density < y/(x+y):
      density = y/(x+y)
      sugar = y
      content = x+y
print(content,sugar)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F=map(int,input().split(' '))
water = set()
for a in range(0,F,100*A):
  for b in range(0,F,100*B):
    if a+b <= F:
      water.add(a+b)
    else:
      break
sugars = set()
for c in range(0,F,C):
  for d in range(0,F,D):
    if c+d <= F:
      sugars.add(c+d)
    else:
      break
density = 0
for x in water:
  for y in sugars:
    if x+y != 0 and x+y <= F and E*x >= 100*y and density < y/(x+y):
      density = y/(x+y)
      sugar = y
      content = x+y
print(content,sugar)
Problem p03671 (python)

Fixed submission:
a,b,c=map(int,input().split(' '))
print(a+b+c-max(a,max(b,c)))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().pslit(' '))
print(a+b+c-max(a,max(b,c)))
Problem p03737 (python)

Fixed submission:
for s in input().split():
  print(s[0].upper(),end='')

Buggy submission (verdict: Runtime Error):
for s in input().split():
  print(upper(s[0]),end='')
Problem p03738 (python)

Fixed submission:
from sys import exit
A = input()
B = input()
if len(A) > len(B):
  print("GREATER")
elif len(A) < len(B):
  print("LESS")
else:
  for a,b in zip(A,B):
    if a > b:
      print("GREATER")
      exit()
    elif a < b:
      print("LESS")
      exit()
  print("EQUAL")

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
if A.length() > B.length():
  print("GREATER")
elif A.length() < B.length():
  print("LESS")
else:
  for a,b in zip(A,B):
    if a > b:
      print("GREATER")
    elif a < b:
      print("LESS")
print("EQUAL")
Problem p02885 (python)

Fixed submission:
a,b=map(int,input().split())
if b*2<=a:
  print(a-b*2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(),split())
if a<=b*2:
  print(0)
else:
  print((a-b*2)*0.5)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(),split())
if a<=b*2:
  print(0)
else:
  print((a-b*2)*0.5)
Problem p02885 (python)

Fixed submission:
A,B=map(int,input().split())
if A<=2*B:
  print(0)
else :
  print(A-(2*B))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A<=2*B:
  print(0)
else A>2*B:
  print(A-(2*B))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A<=2*B:
  print(0)
else A>2*B
  print(A-(2*B))
Problem p02885 (python)

Fixed submission:
a,b=map(int,input().split())
if a-2*b>=0:
  print(a-2*b)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a-2*b>=0:
  print(a-2*b)
else a-2*b<0:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(),split())
if a-2*b>=0:
  print(a-2*b)
else a-2*b<0:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(),split())
if a-2b>=0:
  print(a-2b)
else a-2b<0:
  print(0)
Problem p02945 (python)

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

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

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

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

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

Fixed submission:
import numpy as np
 
 
def solve(string):
    n, *a = map(int, string.split())
    # a = ["{:060b}".format(_a) for _a in a]
    a = np.asarray(a, dtype=np.int64)
    m = 10**9 + 7
    ans = 0
    for i in range(60):
        s = int((a & 1).sum())
        a >>= 1
        # ans += s * (n - s) * pow(2, 59 - i, m)
        ans += s * (n - s) * pow(2, i, m) % m
        ans %= m
    return str(ans)
 
 
if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
n = int(input())
A = np.fromstring(input(),dtype=np.int64,sep=" ")
rng = int(math.log2(np.max(A)))+1
sum = 0
d = 10**9+7
for bit in range(64):
    c = int((A & 1).sum())
    sum += c *(n-c)*pow(2,bit,d)%d
    A >>= 1

print(sum %(d))

Buggy submission (verdict: Runtime Error):

import numpy as np
import math
n = int(input())
A = np.fromstring(input(),dtype=np.int64,sep=" ")
rng = int(math.log2(np.max(A)))+1
sum = 0
d = 10**9+7
for bit in range(64):
    c = int((A & 1).sum())
    sum += c *(n-c)*(1<<bit)%d
    A = A>>1

print(sum %(d))

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
n = int(input())
A = np.fromstring(input(),dtype=np.int64,sep=" ")
rng = int(math.log2(np.max(A)))+1
sum = 0
for bit in range(64):
    c = int((A & 1).sum())
    sum += c *(n-c)*(1<<bit)
    A = A>>1

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

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(200000)

import numpy as np
import math
n = int(input())
A = np.fromstring(input(),dtype=np.int64,sep=" ")
rng = int(math.log2(np.max(A)))+1
sum = 0
for bit in range(rng):
    c = int((A & 1).sum())
    sum += c *(n-c)*(1<<bit)
    A = A>>1

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

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
n = int(input())
A = np.fromstring(input(),dtype=np.int64,sep=" ")
rng = int(math.log2(np.max(A)))+1
sum = 0
for bit in range(rng):
    c = int((A & 1).sum())
    sum += c *(n-c)*(1<<bit)
    A = A>>1

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

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
n = int(input())
A = np.fromstring(input(),dtype=np.int64,sep=" ")
rng = int(math.log2(np.max(A)))+1
sum = 0
for bit in range(60):
    c = int((A & 1).sum())
    sum += c *(n-c)*(1<<bit)
    A = A>>1

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

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
n = int(input())
A = np.fromstring(input(),dtype=np.int64,sep=" ")
rng = int(math.log2(np.max(A)))+1
sum = 0
for bit in range(rng):
    c = (A & 1).sum()
    sum += c *(n-c)*(2**bit)
    A = A>>1

print(sum %(10**9+7))
Problem p02839 (python)

Fixed submission:
import numpy as np

H,W = map(int,input().split())
A = np.zeros((H,W))
for c in [1,-1]:
    for i in range(H):
        num = list(map(int,input().split()))
        A[i,:] += np.array(num) * c

M = 160*80
dp = [[0]*W for _ in range(H)]
dp[0][0] = 1 << M
for i in range(H):
    for j in range(W):
        if i > 0:
            dp[i][j] |= dp[i-1][j]
        if j > 0:
            dp[i][j] |= dp[i][j-1]
        a = abs(A[i,j])
        dp[i][j] = (dp[i][j] << int(a)) | (dp[i][j] >> int(a))
i = M
while True:
    if (dp[H-1][W-1] >> i) & 1:
        print(i-M)
        break
    i += 1

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
A = np.zeros((H,W))
for c in [1,-1]:
    for i in range(H):
        num = list(map(int,input().split()))
        A[i,:] += np.array(num) * c

M = 160*80
dp = [[0]*W for _ in range(H)]
dp[0][0] = 1 << M
for i in range(H):
    for j in range(W):
        if i > 0:
            dp[i][j] |= dp[i-1][j]
        if j > 0:
            dp[i][j] |= dp[i][j-1]
        a = abs(A[i,j])
        dp[i][j] = (dp[i][j] << int(a)) | (dp[i][j] >> int(a))
i = M
while True:
    if (dp[H-1][W-1] >> i) & 1:
        print(i-M)
        break
    i += 1
Problem p02900 (python)

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

def gcd(a,b):
    if a>b:
        a,b = b,a
    if b%a == 0:
        return a
    return gcd(a,b%a)

n = gcd(a,b)
m = n
ans = 1

if m%2==0:
    ans += 1
    while m%2==0:
        m //= 2
f = 3

while f*f <= n:
    if m%f==0:
        ans += 1
        while m%f==0:
            m //= f
    f+=2

if m!=1:
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

n = math.gcd(a,b)
m = n
x = 2
ans = 1

while m!=1:
    if m%x !=0:
        if x==2:
            x += 1
        else:
            x += 2
        continue
    ans += 1
    while m%x == 0:
        m /= x
    if x==2:
        x += 1
    else:
        x += 2

print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

'''
def gcd(a,b):
    if a>b:
        a,b = b,a
    if b%a == 0:
        return a
    return gcd(a,b%a)
'''

n = math.gcd(a,b)
m = n
x = 2
ans = 1

while m!=1:
    if m%x !=0:
        if x==2:
            x += 1
        else:
            x += 2
        continue
    ans += 1
    while m%x == 0:
        m /= x
    if x==2:
        x += 1
    else:
        x += 2

print(ans)
Problem p02921 (python)

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

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

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [list(map(int,input().split())) for _ in range(n)]

total = [0]*n

i = 0
count = 0
day = 0
while count < (n*(n-1))//2:
    while total[i] < n-1:
        game = [0] * n
        flag = False
        for j in range(i,n):
            if total[j] == n-1 or game[j] == 0:
                continue
            tmp = a[j][total[j]]
            if game[tmp-1] == 0 and a[tmp-1][total[tmp-1]] == j+1:
                total[j] += 1
                total[tmp-1] += 1
                game[j] += 1
                game[tmp-1] += 1
                count += 1
                flag = True
        if flag == False:
            break
        day += 1
    if flag == False:
        break
    i += 1

if flag == False:
    print(-1)
else:
    print(day)
Problem p03455 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a,b = map(int, input().split())
N = a * b
if N % 2 != 0:
    print("Odd")
else:
    print("Even")

Buggy submission (verdict: Runtime Error):
n = int(input())
Flg = True
for _ in range(n):
    t, x, y = map(int, input().split())
    xy = x+y
    if t >= (xy):
        if ((t % 2 != 0) & (xy % 2 == 0)) or (t % 2 == 0 & xy % 2 != 0):
            Flg = False
    else:
        Flg = False
if Flg == True:
    print("Yes")
else:
    print("No")
Problem p02983 (python)

Fixed submission:
import sys
input = sys.stdin.readline

l, r = map(int, input().split())
if r - l >= 2019:
	print(0)
else:
	ans = 2020
	for i in range(l, r):
		for j in range(i + 1, r + 1):
			ans = min(ans, (i * j) % 2019)
	print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

l, r = map(int, input().split())
if r - l >= 2019:
	print(0)
else:
	ans = 2010
	for i in range(l, r):
		for j in range(i + 1, r + 1):
			ans = min(ans, i * j % 2019)
print(ans)
Problem p02909 (python)

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

Buggy submission (verdict: Runtime Error):
today = input()
if today == Sunny:
  print ("Cloudy")
if today == Cloudy:
  print ("Rainy")
if today == Rainy:
  print ("Sunny")
Problem p03471 (python)

Fixed submission:
n, y = list(map(int, input().split()))
ans = 0
 
for i in range(n+1):
    a1 = 10000 * i
    for j in range(n+1-i):
        a2 = 5000 * j
        k = n- (i+j)
        a3 = k*1000
        if a1 + a2 + a3  == y and i + j + k == n:
            print(i, j , k)
            ans += 1
            exit(0)
    if ans == 1:
        break
if ans == 0:
    print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
n, y = list(map(int, input().split()))
for a in range(n):
    for b in range(n):
        for c in range(n):
            q = a*10000 + b*5000 + c*1000
            if q == y:
                answer = [a, b, c]

print(answer)