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

Fixed submission:
N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)

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

ans = "b"*a
count = len(ans)
switch = 0
while count < n:
    if switch == 0:
        count += b
        ans += "r"*b
        switch = 1
    else:
        count+= a
        ans += "b" *a
        switch = 0
print(ans[:n].count("b"))
Problem p02759 (python)

Fixed submission:
n = int(input())
if n <=2:
    print(1)
elif n%2 == 0:
    print(n//2)
else:
    print((n//2)+1)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
req = [list(map(int, input().split())) for i in range(m)]
for i in range(10000):
    st = str(i)
    if len(st) != n:
        continue
    ok = True
    for s, c in req:
        if int(st[s-1]) != int(c):
            ok = False
    if ok:
        print(st)
        exit(0)

print(-1)
Problem p02831 (python)

Fixed submission:
import fractions
a,b = list(map(int,input().split()))
print((a*b)//(fractions.gcd(a,b)))

Buggy submission (verdict: Runtime Error):
import math
a,b = list(map(int,input().split()))
print((a*b)//(math.gcd(a,b)))
Problem p02989 (python)

Fixed submission:
n=int(input())//2
d=sorted(list(map(int,input().split())))
print(d[n]-d[n-1])

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

i = [int(input()) for d in range(n)]

i.sort()

l = i[n//2]
k = i[n//2-1]

print(l-k)
Problem p03073 (python)

Fixed submission:
s = [int(i) for i in input()]
count = 0
l = len(s)
for i in range(l):
    if (i % 2 == 0 and s[i] ==0) or (i % 2 ==1 and s[i] == 1):
        pass
    else:
        count += 1
print(min([count,l - count]))

Buggy submission (verdict: Runtime Error):
s = int(input())
count = 0
for i in ragen(len(s)):
    if (i % 2 == 0 and s[i] ==0) or (i % 2 ==1 and s[i] == 1):
        pass
    else:
        count += 1
print(min[count,len(s) - count])

Buggy submission (verdict: Runtime Error):
s = int(input())
count = 0
for i in ragen(len(s)):
    if (i % 2 == 0 and s[i] ==0) or (i % 2 ==1 and s[i] == 1):
        pass
    else:
        count += 1
print(min[c,len(s) - c])
Problem p03209 (python)

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

a, p = [1], [1]
for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)

def f(N, X): 
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 1 + a[N-1]:
        return f(N-1, X-1)
    else:
        return p[N-1] + 1 + f(N-1, X-2-a[N-1])

print(f(N, X))

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

a, p = [1], [1]
for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)

def f(N, X): 
if N == 0:
    return 0 if X <= 0 else 1
elif X <= 1 + a[N-1]:
    return f(N-1, X-1)
else:
    return p[N-1] + 1 + f(N-1, X-2-a[N-1])

print(f(N, X))
Problem p02711 (python)

Fixed submission:
N = input()
s = str(N)

if s[0] == '7' or s[1] == '7' or s[2] == '7':
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = str(N)

if s[0] == '7' or s[1] == '7' or s[2] == '7':
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = N

if s[0] == '7' or s[1] == '7' or s[2] == '7':
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
str = N

if(str[0] == '7' || str[1] == '7' || str[2] == '7'):
  print('Yes')
else:
  print('No')
Problem p03272 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
print(int(a-b+1))
Problem p02891 (python)

Fixed submission:
def main():
    s=list(input())
    k=int(input())
    n=len(s)

    ans=cnt=key=0
    for i in range(n-1):
        if key==0 and s[i]==s[i+1]:
            cnt+=1
            key=1
        elif key==1 and s[i]==s[i+1]:
            key=0
        else:
            key=0
    ans=cnt*k
    a=b=1
    for i in range(n-1):
        if s[i]==s[i+1]:
            a+=1
        else:
            break
    for i in range(n-1):
        if s[n-1-i]==s[n-2-i]:
            b+=1
        else:
            break
    if a!=n and s[0]==s[n-1]:
        ans+=(((a+b)//2)-(a//2)-(b//2))*(k-1)
    if a==n:
        if n%2==0:
            print(cnt*k)
            return
        else:
            print((n*k)//2)
            return
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
#import math
#import copy
#import sys
#import bisect
#input = sys.stdin.readline
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
def lcm(a, b):
    return((a*b)//gcd(a,b))
def div(x):#約数配列
    div=[1]
    check=2
    while(x!=1 and check <= int(x**0.5)+2):
        if(x%check==0):
            div.append(check)
            while(x%check==0):
                x=x//check
        check+=1
    if x != 1:
      div.append(x)
    return div
def div2(x):#素因数分解配列
    div2=[]
    check=2
    while(x!=1 and check <= int(x**0.5)+2):
        while x%check==0:
            div2.append(check)
            x/=check
        check+=1
    if x != 1:
      div2.append(x)
    return div2

def main():
    #x,y = map(int,input().split())           x=1,y=2
    #a = input().split()                      a=['1','2','3',...,'n']
    #a = list(map(int,input().split()))       a=[1,2,3,4,5,...,n]
    #li = input().split('T')	              FFFTFTTFF => li=['FFF', 'F', '', 'FF']
    #複数行の「1 2 3 4」型の入力を一配列に
    #x = sorted([list(map(int, input().split())) for _ in range(n)])
    #ソート x.sort(key=lambda y:y[1])
    # print("Yes")  print("No")  x=[[0 for _ in range(n)] for _ in range(n)]
    s=list(input())
    k=int(input())
    index=cnt=key=0
    while index<len(s)-1:
        if s[index]==s[index+1]:
            cnt+=1
            index+=2
        else:
            index+=1
    if s[0]==s[len(s)-1]:
        if s[0]==s[1] or s[len(s)-2]==s[len(s)-1]:
            key=0
        else:
            key=1
    print(cnt*k+key*(k-1))



main()
Problem p02987 (python)

Fixed submission:
s=list(input())
 
if( s[0] == s[1] and s[1] == s[2] and s[2] == s[3] ):
  print('No')
elif(( s[0]==s[1] and s[2]==s[3] )or( s[0]==s[2] and s[1]==s[3] )or( s[0]==s[3] and s[1]==s[2] )):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s=list(input())
 
if( s[0] == s[1] and s[1] == s[2] and s[2] == s[3] ):
  print('No')
else if(( s[0]==s[1] and s[2]==s[3] )or( s[0]==s[2] and s[1]==s[3] )or( s[0]==s[3] and s[1]==s[2] )):
    print('Yes')
else:
    print('No')
Problem p02990 (python)

Fixed submission:
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
 
def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return [list(map(int, input().split())) for _ in range(n)]

def main():
    n,k = map(int,input().split())
    dp = [[0 for _ in range(k+1)] for _ in range(k+1)]
    dp[0][0] = 1
    for i in range(1,k+1):
        for j in range(1,i+1):
            dp[i][j] = (dp[i-1][j]*(i+j-1)+dp[i-1][j-1]*(n-k-j+2))//i
    for i in range(1,k+1):
        print(dp[-1][i]%mod)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def combi(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
def b(k,i):
  if(i==k-1):
    return 1
  else:
    return combi(k-1,i)

def r(n,k,i,j):
  if(n-k-1<=0):
    return r(n,k,i,j+1)
  else:
    return combi(n-k+1,i+1)
  
def main():
  n,k = map(int,input().split())	
  
  for i in range(k):
    j=0
    ans=b(k,i)*r(n,k,i,j)%(1000000000+7)
    print(ans)
  

import sys
input = sys.stdin.readline
import math  
main()

Buggy submission (verdict: Runtime Error):
def combi(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
def b(k,i):
  if(i==k-1):
    return 1
  else:
    return combi(k-1,i)

def r(n,k,i):
  if(n-k-1<=0):
    return 1
  else:
    return combi(n-k+1,i+1)
  
def main():
  n,k = map(int,input().split())	
  
  for i in range(k):
    ans=b(k,i)*r(n,k,i)%(1000000000+7)
    print(ans)
  

import sys
input = sys.stdin.readline
import math  
main()

Buggy submission (verdict: Runtime Error):
def combi(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
def b(k,i):
  return combi(k-1,i)

def r(n,k,i):
  return combi(n-k+1,i+1)
  
def main():
  n,k = map(int,input().split())	
  
  
  for i in range(k):
    print(b(k,i)*r(n,k,i)%(10**9+7))
  

import sys
input = sys.stdin.readline
import math  
main()
Problem p03017 (python)

Fixed submission:
def main():
    n,a,b,c,d = map(int,input().split()) 
    s=list(input())
    for i in range(max(c,d)-a-1):
        if s[a+i-1]=="#" and s[a+i]=="#":
            print("No")
            return
    if c<d:
        print("Yes")
        return
    else:
        for i in range(d-b+1):
            if s[b+i-2]==s[b+i-1] and s[b+i-1] == s[b+i] and s[b+i]==".":
                print("Yes")
                return
        print("No")
main()

Buggy submission (verdict: Runtime Error):
def main():
    n,a,b,c,d = map(int,input().split()) 
    s=list(input())
    for i in range(max(c,d)-a-1):
        if s[a+i-1]=="#" and s[a+i]=="#":
            print("No")
            return
    if c<d:
        print("Yes")
        return
    else:
        for i in range(c-b+1):
            if s[b+i-2]==s[b+i-1] and s[b+i-1] == s[b+i] and s[b+i]==".":
                print("Yes")
                return
        print("No")
main()

Buggy submission (verdict: Runtime Error):
def main():
    n,a,b,c,d = map(int,input().split()) 
    s=list(input())
    for i in range(max(c,d)-a-1):
        if s[a+i-1]=="#" and s[a+i]=="#":
            print("No")
            return
    if c<d:
        print("Yes")
        return
    else:
        for i in range(c-b-2):
            if s[b+i]==s[b+i+1] and s[b+i]==".":
                print("Yes")
                return
        if s[b]=="." and s[b-2]==".":
            print("Yes")
            return
        if s[d]=="." and s[d+2]==".":
            print("Yes")
            return
        print("No")
main()

Buggy submission (verdict: Runtime Error):
def main():
    n,a,b,c,d = map(int,input().split()) 
    s=list(input())
    for i in range(max(c,d)-a-1):
        if s[a+i-1]=="#" and s[a+i]=="#":
            print("No")
            return
    if c<d:
        print("Yes")
        return
    else:
        for i in range(c-b-2):
            if s[b+i]==s[b+i+1] and s[b+i]==".":
                print("Yes")
                return
        if s[b]=="." and s[b-2]==".":
            print("Yes")
            return
        if s[c]=="." and s[c+2]==".":
            print("Yes")
            return
        print("No")
main()
Problem p03326 (python)

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
def main():
    n,m = map(int,input().split())
    xyz = [[] for _ in range(8)]
    pm = [[ 1, 1, 1],
          [ 1, 1,-1],
          [ 1,-1, 1],
          [-1, 1, 1],
          [ 1,-1,-1],
          [-1, 1,-1],
          [-1,-1, 1],
          [-1,-1,-1]]
    pm = np.array(pm)
    for _ in range(n):
        x,y,z = map(int,input().split())
        for i in range(8):
            k = np.array([x,y,z])
            xyz[i].append(sum(pm[i]*k))
    ans = -10**20
    for i in range(8):
        X = xyz[i]
        X.sort(reverse=True)
        cnt = 0
        for j in range(m):
            cnt += X[j]
        ans = max(ans,cnt)
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
input = sys.stdin.readline
def main():
    n,m = map(int,input().split())
    xyz = [[] for _ in range(8)]
    pm = [[ 1, 1, 1],
          [ 1, 1,-1],
          [ 1,-1, 1],
          [-1, 1, 1],
          [ 1,-1,-1],
          [-1, 1,-1],
          [-1,-1, 1],
          [-1,-1,-1]]
    pm = np.array(pm)
    for _ in range(n):
        x,y,z = map(int,input().split())
        for i in range(8):
            k = np.array([x,y,z])
            xyz[i].append(sum(pm[i]*k))
    ans = -10**20
    for i in range(8):
        X = xyz[i]
        X.sort(reverse=True)
        cnt = 0
        for j in range(m):
            cnt += X[j]
        ans = max(ans,cnt)
    print(ans)

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

Fixed submission:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input()) # n=1
def inpm(): return map(int,input().split()) # x=1,y=2
def inpl(): return list(map(int, input().split())) # a=[1,2,3,4,5,...,n]
def inpls(): return list(input().split())  # a=['1','2','3',...,'n']
def inplm(n): return list(int(input()) for _ in range(n)) # x=[] 複数行
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return sorted([list(map(int, input().split())) for _ in range(n)]) # [[1,1,1,1],[2,2,2,2],[3,3,3,3]] 
def graph():
    n=inp()
    g=[[] for _ in range(n)]
    for i in range(n):
        a = inp()
        a -= 1
        g[i].append(a)
        g[a].append(i)
    return n,g

def main():
    n,m = inpm()
    cnt = [0 for _ in range(n)]
    for _ in range(m):
        a,b = inpm()
        a -= 1
        b -= 1
        cnt[a] += 1
        cnt[b] += 1
    for i in range(n):
        if cnt[i]%2 == 1:
            print('NO')
            return
    print('YES')
 
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input()) # n=1
def inpm(): return map(int,input().split()) # x=1,y=2
def inpl(): return list(map(int, input().split())) # a=[1,2,3,4,5,...,n]
def inpls(): return list(input().split())  # a=['1','2','3',...,'n']
def inplm(n): return list(int(input()) for _ in range(n)) # x=[] 複数行
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return sorted([list(map(int, input().split())) for _ in range(n)]) # [[1,1,1,1],[2,2,2,2],[3,3,3,3]] 
def graph():
    n=inp()
    g=[[] for _ in range(n)]
    for i in range(n):
        a = inp()
        a -= 1
        g[i].append(a)
        g[a].append(i)
    return n,g

def main():
    n,m = inp()
    cnt = [0 for _ in range(n)]
    for _ in range(m):
        a,b = inpm()
        a -= 1
        b -= 1
        cnt[a] += 1
        cnt[b] += 1
    for i in range(n):
        if cnt[i]%2 == 1:
            print('NO')
            return
    print('YES')
 
if __name__ == "__main__":
    main()
Problem p02622 (python)

Fixed submission:
def b172(slist, tlist):

    ans = 0

    for s, t in zip(slist, tlist):
        if s != t:
            ans += 1

    return ans

def main():
    slist = list(str(input()))
    tlist = list(str(input()))
    print(b172(slist, tlist))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def b172(slist, tlist):

    ans = 0

    for s, t in slist, tlist:
        if s != t:
            ans += 1

    return ans

def main():
    slist = list(str(input()))
    tlist = list(str(input()))
    print(b172(slist, tlist))

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

Fixed submission:
import itertools

def c165(n, m, q, adli):

    ans = 0
    li = list(itertools.combinations_with_replacement(range(1,m+1), n))
    for i in li:
        count = 0
        for a, b, c, d in adli:
            if i[b-1] - i[a-1] == c:
                count += d
        ans = max(ans, count)

    return ans

def main():
    n, m, q = map(int, input().split())
    adli = [list(map(int, input().split()))for i in range(q)]
    print(c165(n, m, q, adli))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import itertools

def c165(n, m, q, adli):

    ans = 0
    li = list(itertools.combinations_with_replacement(range(1,M+1), n))
    for i in li:
        count = 0
        for a, b, c, d in adli:
            if i[b-1] - i[a-1] == c:
                count += d
        ans = max(ans, count)

    return ans

def main():
    n, m, q = map(int, input().split())
    adli = [list(map(int, input().split()))for i in range(q)]
    print(c165(n, m, q, adli))

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

Fixed submission:

def a(n):

    return -(-n // 2)

def main():
    n = int(input())
    print(a(n))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

def a(n):

    return -(-n // 2)

def main():
    n = int(input())¥
    print(a(n))

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

Fixed submission:
def make_divisors(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)

    return divisors

def walk_on_multiplication_table(n):

    ans = 10**13
    yaku = make_divisors(n)
    yaku.sort()
    count = len(yaku)
    for i in range(int(count//2)):
        ans = min(ans, (yaku[i]+yaku[count-i-1]-2))

    if count % 2 == 0:
        return ans
    return min(ans, (yaku[int(count//2)]*2)-2)

def main():
    n = int(input())
    print(walk_on_multiplication_table(n))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def make_divisors(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 walk_on_multiplication_table(n):

    ans = 10**13
    yaku = make_divisors(n)
    yaku.sort()
    count = len(yaku)

    for i in range(int(count//2)):
        ans = min(ans, (yaku[i]+yaku[count-i-1]-2))

    if count % 2 == 0:
        return ans

    return min(ans, (yaku[int((count+1)**2)]-2))

def main():
    n = int(input())
    print(walk_on_multiplication_table(n))

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

Fixed submission:
def password(n):

    return n**3
def main():
    n = int(input())
    print(password(n))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def password(n):

    return n**3
def main():
    n = list(str(input()))
    print(password(n))

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

Fixed submission:
def integerCards(n, m, alist, bclist):

    count = 0
    alist.sort()
    bclist.sort(key=lambda x: x[1], reverse=True)

    for b, c in bclist:
        for _ in range(b):
            if alist[count] < c:
                alist[count] = c
                count += 1
            else:
                break
            if count == n:
                break
        if count == n:
            break

    return sum(alist)

def main():
    n, m = map(int, input().split())
    alist = list(map(int, input().split()))
    bclist = [list(map(int, input().split()))for i in range(m)]
    print(integerCards(n, m, alist, bclist))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def integerCards(n, m, alist, bclist):

    count = 0
    alist.sort()
    bclist.sort(key=lambda x: x[1], reverse=True)

    for b, c in bclist:
        for _ in range(b):
            if alist[count] < c:
                alist[count] = c
                count += 1
            if count == n - 1:
                break

    return sum(alist)

def main():
    n, m = map(int, input().split())
    alist = list(map(int, input().split()))
    bclist = [list(map(int, input().split()))for i in range(m)]
    print(integerCards(n, m, alist, bclist))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def integerCards(n, m, alist, bclist):

    count = 0
    alist.sort()
    bclist.sort(key=lambda x: x[1], reverse=True)

    for b, c in bclist:
        for _ in range(b):
            if alist[count] < c:
                alist[count] = c
                count += 1
            if count == n:
                break

    return sum(alist)

def main():
    n, m = map(int, input().split())
    alist = list(map(int, input().split()))
    bclist = [list(map(int, input().split()))for i in range(m)]
    print(integerCards(n, m, alist, bclist))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def integerCards(n, m, alist, bclist):

    count = 0
    alist.sort()
    bclist.sort(key=lambda x: x[1], reverse=True)

    for b, c in bclist:
        for _ in range(b):
            if alist[count] < c:
                alist[count] = c
                count += 1
            if count == n:
                break

    return sum(alist[:n])

def main():
    n, m = map(int, input().split())
    alist = list(map(int, input().split()))
    bclist = [list(map(int, input().split()))for i in range(m)]
    print(integerCards(n, m, alist, bclist))

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

Fixed submission:
from fractions import gcd
from functools import reduce

def gcdli(xl):
    #xlはlist
    return reduce(gcd , xl)

def monsters_battle_royale(n, al):

    ans = gcdli(al)

    return ans

def main():
    n = int(input())
    al = list(map(int, input().split()))
    print(monsters_battle_royale(n, al))

if __name__ == '__main__':
    main()

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

def gcdli(xl):
    #xlはlist
    return reduce(gcd , xl)

def monsters_battle_royale(n, al):

    ans = gcdli(al)

    return ans

def main():
    n = int(input())
    al = list(map(int, input().split()))
    print(monsters_battle_royale(n, al))

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

Fixed submission:
def StringTransformation(s , t):

    taious = {}
    taiout = {}
    ans = "Yes"

    for i in range(len(s)):
        if t[i] in taiout.keys() and taiout[t[i]] != s[i]:
            ans = "No"
            break
        elif s[i] in taious.keys() and taious[s[i]] != t[i]:
            ans = "No"
            break
        else:
            taiout[t[i]] = s[i]
            taious[s[i]] = t[i]

    return ans

def main():
    s = str(input())
    t = str(input())
    print(StringTransformation(s , t))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def StringTransformation(s , t):

    taious = {}
    taiout = {}
    ans = "Yes"

    for i in range(len(s)):
        if t[i] in taiout.keys() or s[i] in taious.keys():
            if taiout[t[i]] != s[i] or taious[s[i]] != t[i]:
                ans = "No"
                break
        else:
            taiout[t[i]] = s[i]
            taious[s[i]] = t[i]

    return ans

def main():
    s = str(input())
    t = str(input())
    print(StringTransformation(s , t))

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

Fixed submission:
a = [int(x) for x in input().split()]
a.sort()
if a[0] == a[1] == a[2]: print("No")
elif a[0] == a[1] or a[1] == a[2]: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
if a[0] == a[1] == a[2]: print("No")
elif a[0] == a[1] or a[1] == a[2]: print("Yes")
else: print("No")