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

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


def gcd(x, y):
    while y != 0:
        x, y = y, x % y

    return x


ret = gcd(a[0], a[1])

for e in a[2:]:
    ret = gcd(ret, e)

print(ret)

Buggy submission (verdict: Runtime Error):
from math import gcd

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

ret = gcd(a[0], a[1])
for e in a[2:]:
    ret = gcd(ret, e)

print(ret)

Buggy submission (verdict: Runtime Error):
from functools import reduce
from math import gcd

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

print(reduce(gcd, a))
Problem p02711 (python)

Fixed submission:
n=input()
if "7" in n:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=input()
if "7" in s:
  print("Yes")
else:
  print("No")
Problem p02879 (python)

Fixed submission:
a,b=map(int,input().split())
if max(a,b)>9:
  print('-1')
else:
  print(a*b)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if max(a,b)>9:
  print(-1)
else:
  print(a＊b)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if max(a,b)>9:
  print('-1')
else:
  print(a＊b)
Problem p02881 (python)

Fixed submission:
import numpy as np
n=int(input())
ans = n-1
for i in range(1,int(np.sqrt(n))+1):
  if n % i == 0:
    ans = min(ans, i + n/i -2)
print(int(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
ans = n-1
for i in range(int(np.sqrt(n))+1):
  if n % i == 0:
    ans = min(ans, i + n/i -2)
print(ans)
Problem p02897 (python)

Fixed submission:
N=int(input())
if N%2==0:
    print(0.5)
else:
    print((N+1)/(2*N))

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

for i in range(N):
    for j in range(N):
        if A[j]==i+1:
            print(j+1)

Buggy submission (verdict: Runtime Error):
N,K = [int(input()) for i in range(2)]
h = list(map(int, input().split()))
 
num =0
for i in range(N):
    if h[i]>K or h[i] == K:
        num =num+ 1
print(num)
Problem p02915 (python)

Fixed submission:
n=int(input())
print(n**3)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=sum(b)
for i in range(n-1):
  if a[i]+1==a[i+1]:
    ans+=c[i]
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
print(N**3)
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(min(c-a+b,0)
Problem p03011 (python)

Fixed submission:
a=list(map(int,input().split()))
a.sort()
print(a[0]+a[1])

Buggy submission (verdict: Runtime Error):
from math import factorial
from operator import mul
from functools import reduce
from math import sqrt

def c(n,r):
  r = min(n-r,r)
  if r == 0 or r == n:
    return 1
  else:
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
def num(k): # k段昇る場合の数
  return int((((1+sqrt(5))/2) ** k - ((1-sqrt(5))/2) ** k) / sqrt(5))
  """
  l,r = k // 2, 0
  for i in range(l+1):
    r += c(k-i,i)
    r %= mod
  return r
  """

n,m=map(int,input().split())
mod = 10 ** 9 + 7

if m == 0:
  print(num(n) % mod)
  exit()

a=[int(input()) for i in range(m)] # 壊れてる段

# ここから先 m > 0
a = [-1] + a + [n+1] # len(a)=m+2
sa = [a[i+1]-a[i]-2 for i in range(len(a)-1)]
ans = 1
#print(sa)
for i in sa:
  ans *= num(i)
  ans %= mod
print(ans)
Problem p03041 (python)

Fixed submission:
n,k=map(int,input().split())
s=input()
if s[k-1]=='A':
  s = s[:k-1] + "a" + s[k:]
elif s[k-1]=='B':
  s=s[:k-1] + "b" + s[k:]
else:
  s=s[:k-1] + "c" + s[k:]
print(s)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=input()
if s[k-1]==A:
  s[k-1]=a
elif s[k-1]==B:
  s[k-1]=b
else:
  s[k-1]=c
print(s)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=input()
if s[k-1]=='A':
  s[k-1]='a'
elif s[k-1]=='B':
  s[k-1]='b'
else:
  s[k-1]='c'
print(s)
Problem p03042 (python)

Fixed submission:
s=input()
s1=int(s[:2])
s2=int(s[2:])
if 0<s1<13 and 0<s2<13:
  print("AMBIGUOUS")
elif (12<s1 or s1==0) and 0<s2<13:
  print("YYMM")
elif (12<s2 or s2==0) and 0<s1<13:
  print("MMYY")
else:
  print("NA")

Buggy submission (verdict: Runtime Error):
s=input()
s1=int(s[:2])
s2=int(s[2:])
if 0<s1<13 and 0<s2<13:
  print("AMBIGUOUS")
if (12<s1 or s1=0) and 0<s2<13:
  print("YYMM")
if (12<s2 or s2=0) and 0<s1<13:
  print("MMYY")
else:
  print("NA")
Problem p03835 (python)

Fixed submission:
k,s=map(int,input().split())
from math import factorial
def c(n,r):
  return factorial(n)//factorial(n-r)//factorial(r)
ans=0
for x in range(k+1):
  for y in range(k+1):
    if 0<=s-x-y<=k:
      ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
k,s=map(int,input().split())
from math import factorial
def c(n,k):
  return factorial(n)//factorial(n-k)//factorial(k)
if s<k:
  print(c(s+2,2))
elif 3*k < s:
  print(0)
else:
  # k<=s<=3k の場合
  くっそ～わかんねぇ～
Problem p02577 (python)

Fixed submission:
n = input()
rem = 0
for d in n:
  rem += int(d)
if rem % 9 == 0:
  print ("Yes")
else:
  print ("No")

Buggy submission (verdict: Runtime Error):
n = input()
rem = 0
for d in n:
  rem += int(d)
if d % 9 == 0:
  print ("Yes")
else:
  print ("No")
Problem p02685 (python)

Fixed submission:
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

def solve():
    n, m, k = rl()
    mod = 998244353
    ans = 0
    C = 1
    for d in range(k + 1):
        # print (d)
        ans += m * pow(m - 1, n - 1 - d, mod) * C
        ans %= mod
        C = (C * (n - 1 - d) * modinv(d + 1, mod)) % mod
    print (ans)





mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()

Buggy submission (verdict: Runtime Error):
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))


def solve():
    n, k = rl()
    A = rl()
    # leaps = [A]
    # leap_size = 2
    # while leap_size <= k:
        # new_leap = []
        # for i in range(n):
    curr = 1
    seen = {1:0}

    for i in range(1, k + 1):
        curr = A[curr - 1]
        if i == k:
            print (curr)
            return
        elif curr in seen:
            break
        seen[curr] = i

    cycle_len = i - seen[curr]
    # print (cycle_len)

    while 1:
        if i % cycle_len == k % cycle_len:
            print (curr)
            return
        i += 1
        curr = A[curr - 1]






mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()
Problem p02723 (python)

Fixed submission:
s = input()
if s[2] == s[3] and s[4] == s[5]:
  print ("Yes")
else:
  print ("No")

Buggy submission (verdict: Runtime Error):
s = input()
if s[2] == s[3] and s[4] == s[5]:
  return "Yes"
else:
  return "No"
Problem p03075 (python)

Fixed submission:
a,*_,e,k=[int(input())for x in' '*6];print([':(','Yay!'][e-a<=k])

Buggy submission (verdict: Runtime Error):
a,*_,e,k=map(int,input(input().split()));print([':(','Yey!'][e-a<=k])
Problem p03705 (python)

Fixed submission:
#! /usr/bin/env python3
import itertools
N, A, B = map(int, input().split())
if B <= A or N < 2:
    if A == B:
        print(1)
    else:
        print(0)
else:
    print((B - A) * (N - 2) + 1)

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python3
import itertools
N, A, B = map(int, input().split())
t = B - A + 1
if B <= A or N < 2:
    if A == B:
        print(1)
    else:
        print(0)
else:
    s = set()
    print(len({sum(i) for i in itertools.product(range(t), repeat = N - 2)}))

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python3
import itertools
N, A, B = map(int, input().split())
t = B - A + 1
s = set()
if B <= A or N < 3:
    if A == B:
        print(1)
    else:
        print(0)
else:
    print(len({sum(i) for i in itertools.product(range(t), repeat = N - 2)}))
Problem p03767 (python)

Fixed submission:
N = int(input())
print(sum(sorted(map(int, input().split()))[::-1][1:2*N:2]))

Buggy submission (verdict: Runtime Error):
print(sum(sorted(map(int,input().split()))[::-1][1:2*int(input()):2]))
Problem p03821 (python)

Fixed submission:
N = int(input())
cnt = 0
L = [list(map(int, input().split())) for x in range(N)]
for a, b in L[::-1]:
    a += cnt
    if a < b and a != 0 : cnt += b - a
    if a > b: 
        if a % b:
            cnt += b - a % b
        else:
            cnt += a % b
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
cnt = 0
L = [list(map(int, input().split())) for x in range(N)]
for a, b in L[::-1]:
    a += cnt
    if a < b && a != 0 : cnt += b - a
    if a > b: 
        if a % b:
            cnt += b - a % b
        else:
            cnt += a % b
print(cnt)
Problem p03834 (python)

Fixed submission:
print(*input().split(','))

Buggy submission (verdict: Runtime Error):
import itertools
K, S = map(int, input().split())
s = set([x for x in itertools.combinations_with_replacement(range(K+1), 3) if sum(x) == S]) 
print(len(s) * 3 - (S % 3 == 0) * 2)
Problem p02577 (python)

Fixed submission:
if(sum([int(i) for i in input()]) % 9 == 0):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if(sum([int(i) for i in input()]) % 9 == 0):
  print("Yes")
else:
  print("No"
Problem p02578 (python)

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


if len(a_L) == 1:
    print(0)
    exit()

ans = 0
for i in range(0,len(a_L)-1):
    if a_L[i] > a_L[i+1]:
        ans += abs(a_L[i+1] - a_L[i])
        a_L[i+1] = a_L[i]


if a_L[-2] > a_L[-1]:
    ans += abs(a_L[-1]-a_L[-2])
print(ans)

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


ans = 0
for i in range(0,len(a_L)-1):
    if a_L[i] > a_L[i+1]:
        ans += abs(a_L[i+1] - a_L[i])
        a_L[i+1] = a_L[i]

if a_L[-1] > a_L[-2]:
    ans += abs(a_L[-1]-a_L[-2])
print(ans)
Problem p02785 (python)

Fixed submission:
n,k = map(int,input().split())
h_L = list(map(int,input().split()))
h_L.sort(reverse=True)
if k ==0:
    print(sum(h_L))
else:
    print(sum(h_L[k:]))

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
H = list(input().split())
 
if K >= N:
    print(0)
elif N > K:
    if K == 0:
        print(sum(int(i) for i in H))
    else:
      	# ここを追加
      	for i in range(k):
        	H.remove(max(H))
        print(sum(int(i) for i in H))
Problem p02836 (python)

Fixed submission:
s = list(input())
ans = 0
n = len(s)-1
for i in range(len(s)):
  if s[i] != s[n-i]:
    ans += 1
print(int(ans/2))

Buggy submission (verdict: Runtime Error):
s = list(input())
ans = 0
n = len(s)
for i in range(len(s)):
  if s[i] != s[n-i]:
    ans += 1
print(ans)
Problem p02897 (python)

Fixed submission:
n = int(input())

L = []

import sys
if n ==0:
    print(0.0)
    sys.exit()

for val in range(n+1):
    if val % 2 ==1:
        L.append(val)
print(len(L)/n)

Buggy submission (verdict: Runtime Error):
import itertools
import math 

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

def divisor(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
"""
if is_prime(a) and is_prime(b):
    print(1)
    import sys
    sys.exit()
"""

a_L = divisor(a)
b_L = divisor(b)

kouyaku = set(a_L) & set(b_L)

new_L = []


for val in kouyaku:
    if is_prime(val):
        new_L.append(val)


new_L.append(1)
print(len(new_L))

Buggy submission (verdict: Runtime Error):
import itertools
import math 

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

def divisor(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
"""
if is_prime(a) and is_prime(b):
    print(1)
    import sys
    sys.exit()
"""

a_L = divisor(a)
b_L = divisor(b)

kouyaku = set(a_L) & set(b_L)

new_L = []


for val in kouyaku:
    if is_prime(val):
        new_L.append(val)


new_L.append(1)
print(len(new_L))
Problem p02912 (python)

Fixed submission:
import heapq

n,m = map(int,input().split())
a_L = list(map(lambda x:int(x) * -1,input().split()))

heapq.heapify(a_L)
#a_L = list(sorted(a_L))
#max_num = a_L[0]
#a_L.append(max_num)

for val in range(0,m):
    a_min = heapq.heappop(a_L)
    a_min = (-1 * a_min)//2 * -1
    heapq.heappush(a_L,a_min)

print(-sum(a_L))

Buggy submission (verdict: Runtime Error):
import heapq

n,m = map(int,input().split())
a_L = list(map(lambda x:int(x) * -1,input().split()))

q = heapq.heapify(a_L)


for val in range(0,m):
    a_min = heapq.heappop(q)
    a_min = (-1 * a_min)//2 * -1
    heapq.heappush(q,a_min)
    print(a_L)

print(-sum(q))
Problem p03041 (python)

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

s = [val for val in s]

s[k-1]=s[k-1].lower()

print("".join(s))

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

s = [val for val in s]

s[k]=s[k].lower()

print("".join(s))
Problem p03207 (python)

Fixed submission:
n = int(input())
a_L = []
for val in range(n):
    a_L.append(int(input()))

a_L = sorted(a_L,reverse=True)
a_L[0] /=2
print(int(sum(a_L)))

Buggy submission (verdict: Runtime Error):
import fractions
n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = fractions.gcd(ans, a[i])
print(ans)
Problem p03208 (python)

Fixed submission:
n,k = map(int,input().split())
L = []
for val in range(n):
    val = int(input())
    L.append(val)

L = sorted(L)
ans_L = []
for i in range(n-k+1):
    ans = L[i+k-1] - L[i]
    ans_L.append(ans)
print(min(ans_L))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
L = []
for val in rnage(n):
    L.append(val)

L = sorted(L)
ans_L = []
for i in range(n-k+1):
    ans = L[i+k-1] - L[i]
    ans_L.append(ans)
print(min(ans_L))

Buggy submission (verdict: Runtime Error):
n.k = map(int,input().split())
L = []
for val in rnage(n):
    L.append(val)

L = sorted(L)
ans_L = []
for i in range(n-k+1):
    ans = L[i+k-1] - L[i]
    ans_L.append(ans)
print(min(ans_L))
Problem p03221 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()
 
def main():
    N,M=map(int,input().split())
    city=[[] for _ in range(N)]
    s=set()
    for i in range(M):
        P,Y=map(lambda x:int(x)-1,input().split())
        s.add(P)
        city[P].append((Y,i))
    city=list(map(sorted,city))
    ans=[0]*M
    for x in s:
        for i,c in enumerate(city[x]):
            ans[c[1]]=str(x+1).zfill(6)+str(i+1).zfill(6)
    for i in range(M):
        print(ans[i])
main()

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

dic = {}
for i in range(m):
    c,y = map(int,input().split())
    dic[y] = c
#print(dic)

dic2 = copy.deepcopy(dic)
#print(dic)
dic2 = sorted(dic2.items(),key=lambda x:x[1],reverse=True)
dic2 = sorted(dic2.items(),key=lambda x:x[0])#,reverse=True)
#print(dic2)
#[(32, 1), (12, 1), (63, 2)]

ken = dic2[0][1]
counter = 0
ans = {}

for y,k in dic2:
    if ken == k:
        counter +=1
    else:
        counter = 1
    tmp = str(k).zfill(6) + str(counter).zfill(6)
    ans[y] = tmp

for i in dic.keys():
    print(ans[i])
Problem p03265 (python)

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

x = c - a
y = d - b
print(c-y,d+x,a-y,b+x)

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

x = c − a
y = d - b
print(c-y,d+x,a-y,b+x)
Problem p02688 (python)

Fixed submission:
N,M=list(map(int,input().split()))
si=[0]*N
ans=0
for i in range(M):
    S=int(input())
    who=list(map(int,input().split()))
    for k in range(S):
        si[who[k]-1]+=1
for h in range(N):
  if si[h]==0:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=list(map(int,input().split()))
    si=[0]*N
    ans=0
    for i in range(M):
        S=int(input())
        who=list(map(int(input())))
        for k in range(S):
            si[who[k]]+=1
    for h in range(N):
        if si[h]==0:
          ans+=1
print(ans)
Problem p02712 (python)

Fixed submission:
N = int(input())
total = 0
for i in range(1, N+1):
    if i % 3 != 0 and i % 5 != 0:
        total += i
print(total)

Buggy submission (verdict: Runtime Error):
N=int(input())
  total=0
  for i in range (1,N+1):
if i%3!=0 and i%5=0
  total+=i
  print(total)

Buggy submission (verdict: Runtime Error):
N=int(input())
  total=0
  for i in range (1,N+1):
if i%3!=0 and i%5=0
  total+i
  print(total)
Problem p02723 (python)

Fixed submission:
N=input()
if N[2]==N[3] and N[4]==N[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=input()
if N[2]==N[3]: and N[4]==N[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=input()
for i in range(6):
  if N[i]==N[i+1]:
    print("Yes")
    exit()
  else:
    print("No")
Problem p03135 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=int(input().split())
print(a/b)
Problem p03834 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
print(a,b,c,="")
Problem p02577 (python)

Fixed submission:
N = str(input())
if int(N)%9 != 0: print("No")
else:
    if int(N) == 0 :print("Yes")
    else:
        sum = 0
        for i in range(0,len(N)):
           sum += int(N[i])
        if sum%9 == 0: print("Yes")
        else: print("No")

Buggy submission (verdict: Runtime Error):
N = str(input())
if int(N)%9 != 0: print("No")
else:
    if int(N) == 0 :print("Yes")
    else:
        sum = 0
        for i in N:
           sum += i
        if sum%9 == 0: print("Yes")
        else: print("No")
Problem p02659 (python)

Fixed submission:
A, B = input().split()
A = int(A)
B1 ,B2 = B.split('.') 
B1 = int(B1)
B2 = int(B2)
B1 = B1 *100 + B2
print((A*B1)//100)

Buggy submission (verdict: Runtime Error):
A, B = map(str, input().split())
B *= 100
A = int(A)
B = int(B)
print((A*B)//100)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
print(A*round(B))
Problem p02580 (python)

Fixed submission:
x,y,m = map(int,input().split())
row = {}
ch = set()
column = {}
for i in range(m):
	h,k = map(int,input().split())
	ch.add((h,k))
	if h in row:
		row[h] += 1
	else:
		row[h] = 1

	if k in column:
		column[k] += 1
	else:
		column[k] = 1


r_max = 0
c_max = 0

for i in row:
	r_max = max(r_max,row[i])
for j in column:
	c_max = max(c_max,column[j])

r_inx = []
w_inx = []

for i in row:
	if row[i] == r_max:
		r_inx.append(i)
for j in column:
	if column[j] == c_max:
		w_inx.append(j)

flag = 0
for i in r_inx:
	for j in w_inx:
		if (i,j) not in ch:
			flag = 1
			break
if flag == 0:
	print(r_max+c_max-1)
else:
	print(r_max+c_max)

Buggy submission (verdict: Runtime Error):
x,y,m = map(int,input().split())
row = {}
ch = set()
column = {}
for i in range(m):
	h,k = map(int,input().split())
	ch.add((h,k))
	if h in row:
		row[h] += 1
	else:
		row[h] = 1
 
	if k in column:
		column[k] += 1
	else:
		column[k] = 1
 
 
r_max = 0
c_max = 0
 
for i in row:
	r_max = max(r_max,row[i])
for j in column:
	c_max = max(c_max,column[j])
 
r_inx = []
w_inx = []
 
for i in row:
	if row[i] == r_max:
		r_inx.append(i)
for j in column:
	if column[j] == c_max:
		w_inx.append(j)
 
flag = 0
for i in r_inx:
	for j in w_inx:
		if (i,j) not in ch:
			flag = 1
			break
if flag == 0:
	print(r_max+c_max-1)
else:
	print(r_max+c_max)
x,y,m = map(int,input().split())
row = {}
ch = set()
column = {}
for i in range(m):
	h,k = map(int,input().split())
	ch.add((h,k))
	if h in row:
		row[h] += 1
	else:
		row[h] = 1

	if k in column:
		column[k] += 1
	else:
		column[k] = 1


r_max = 0
c_max = 0

for i in row:
	r_max = max(r_max,row[i])
for j in column:
	c_max = max(c_max,column[j])

r_inx = []
w_inx = []

for i in row:
	if row[i] == r_max:
		r_inx.append(i)
for j in column:
	if column[j] == c_max:
		w_inx.append(j)

flag = 0
Problem p02622 (python)

Fixed submission:
s = input()
t = input()
print(sum([s[i] != t[i] for i in range(len(s))]))

Buggy submission (verdict: Runtime Error):
print(sum([s != t for s, t in zip(input().split())]))
Problem p03127 (python)

Fixed submission:
def f(a, b):
    if a < b:
        d = a
        a = b
        b = d
    if a % b == 0:
        return b
    else:
        return f(b, a % b)

def main():
    n = int(input())
    A = list(map(int, input().split()))
    ans = int(1e9)
    for i in range(1, n):
        ans = min(ans, f(A[i], A[i - 1]))
    print(ans)

main()

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
A = list(map(int, input().split()))
ans = 1e9
for i in range(1, n):
    ans = min(ans, math.gcd(A[i], A[i - 1]))
print(ans)
Problem p03307 (python)

Fixed submission:
n=int(input())
print(n if not n%2 else n*2)

Buggy submission (verdict: Runtime Error):
a=input()
if a % 2 == 0:
  print(a)
else:
  print(a * 2)
Problem p03072 (python)

Fixed submission:
# coding: utf-8
n = int(input())

high = list(map(int, input().split()))
max_high = []
count =1

for i in range(1,n):
    x = high[:i]
    if(max(x) <= high[i]):
        count = count +1
        
print(count)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
minutes = [int(input()) for _ in range(5)]
time=0
l=[]
 
for i in minutes:
    time = time + i
    if(i%10==0):
        l.append(0)
    else:
        l.append(10-i%10)
 
l.sort()
time += sum(l[:-1])
print(time)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
minutes = [int(input()) for _ in range(5)]
time=0
l=[]

for i in minutes:
    time = time + i
    if(i%10==0):
        l.append(0)
    else:
        l.append(10-i%10)

l.sort()
time = time + sum(l[:-1])
print(time)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
n = int(input())

high = list(map(int, input().split()))
max_high = []
count =1

for i in range(1,n):
    x = high[:i]
    if(max(x) <= high[i]):
        count++
        
print(count)