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

Fixed submission:
#!/usr/bin/env python

nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]

a = list()
b = list()
c = list()
d = list()

for i in range(n):
    ab = [int(tmp) for tmp in input().split()]
    a.append(ab[0])
    b.append(ab[1])

for j in range(m):
    cd = [int(tmp) for tmp in input().split()]
    c.append(cd[0])
    d.append(cd[1])

for i in range(n):
    min_dist = abs(a[i]-c[0]) + abs(b[i]-d[0])
    checkpoint = 1
    for j in range(m):
        cur_dist = abs(a[i]-c[j]) + abs(b[i]-d[j])
        if min_dist > cur_dist:
            min_dist = cur_dist
            checkpoint = j + 1
    print(checkpoint)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]

student = list()
point = list()

for i in range(n):
    student.append([int(a) for a in input().split()])

for j in range(m):
    point.append([int(b) for b in input().split()])


mat = [[abs(student[i][0]-point[j][0]) + abs(student[i][1]-point[j][1]) for i in range(n)] for j in range(m)]

for i in range(n):
    print(mat[i].index(min(mat[i]))+1)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]

student = list()
point = list()

for i in range(n):
    student.append([int(a) for a in input().split()])

for j in range(m):
    point.append([int(b) for b in input().split()])


mat = [[abs(student[i][0]-point[j][0]) + abs(student[i][1]-point[j][1]) for j in range(m)] for i in range(m)]

for i in range(n):
    print(mat[i].index(min(mat[i]))+1)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]

student = list()
point = list()

for i in range(n):
    student.append([int(i) for i in input().split()])

for j in range(m):
    point.append([int(j) for j in input().split()])


mat = [[abs(student[i][0]-point[j][0]) + abs(student[i][1]-point[j][1]) for j in range(m)] for i in range(m)]

for i in range(n):
    print(mat[i].index(min(mat[i]))+1)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]

student = list()
point = list()

for i in range(n):
    student.append([int(i) for i in input().split()])

for j in range(m):
    point.append([int(i) for i in input().split()])


mat = [[abs(student[i][0]-point[j][0]) + abs(student[i][1]-point[j][1]) for j in range(m)] for i in range(m)]

for i in range(n):
    print(mat[i].index(min(mat[i]))+1)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]

student = list()
point = list()

for i in range(n):
    student.append([int(i) for i in input().split()])

for j in range(m):
    point.append([int(i) for i in input().split()])


mat = [[0 for j in range(m)] for i in range(m)]

for j in range(m):
    for i in range(n):
        mat[i][j] = abs(student[i][0]-point[j][0]) + abs(student[i][1]-point[j][1])

for i in range(n):
    print(mat[i].index(min(mat[i]))+1)
Problem p02659 (python)

Fixed submission:
import decimal
import math


a, b = map(str, input().split())
print(math.floor(int(a) * decimal.Decimal(b)))

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

print(int(a * b))
Problem p02701 (python)

Fixed submission:
n=int(input())
s=list()
for i in range(n):
 s.append(input())
print(len(set(s)))

Buggy submission (verdict: Runtime Error):
n=iinput())
s=list()
for i in range(n):
 s.append(input())
print(len(set(s)))
Problem p02753 (python)

Fixed submission:
S=input()
if S=="AAA" or S=="BBB":
	print("No")
else:
	print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
if S==AAA or S==BBB:
	print("No")
else:
	print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
if S==AAA or S==BBB:
	print("No")
else:
	print("Yes")
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):
import queue

def push(n, dist, dist_list):
	if dist_list[n] > dist:
		dist_list[n] = dist
		q.put(n)



q = queue.Queue()
n, x, y = [int(i) for i in input().split()]
result = [0] * (n-1)

for p in range(n):
	dist_list = [111111] * n
	dist = 0
	q.put(p)
	dist_list[p] = dist 
	while not q.empty():
		p = q.get()
		dist = dist_list[p]
		if p+1 < n: push(p+1, dist+1, dist_list)
		if p-1 >= 0: push(p-1, dist+1, dist_list)
		if p == (x-1): push(y-1, dist+1, dist_list)
		if p == (y-1): push(x-1, dist+1, dist_list)
	
	for i in dist_list:
		if i != 0:
			result[i-1] += 1

for ans in result:
	print(ans//2)
Problem p02759 (python)

Fixed submission:
N = int(input())
print((N+1)//2)

Buggy submission (verdict: Runtime Error):
number = []
result = "No"

for i in range(3):
	for n in input().split():
		n = int(n)
		number.append(n)

bingo = [None for _ in range(9)]

N  = int(input())
for i in range(N):
	b = int(input())
	for j in range(9):
		if b == number[j]:
			bingo[j] = True


for i in range(3):
	if bingo[3*i] == bingo[3*i+1] and bingo[3*i+1] == bingo[3*i+2] and bingo[3*i] == True:
		result = "Yes"

for i in range(3):
	if bingo[i] == bingo[3+i] and bingo[3+i] == bingo[6+i] and bingo[i] == True:
		result = "Yes"

if bingo[0] == bingo[4] and bingo[4] == bingo[8] and bingo[0] == True:
	result = "Yes"

if bingo[2] == bingo[4] and bingo[4] == bingo[6] and bingo[2] == True:
	result = "Yes"

print(result)
Problem p02659 (python)

Fixed submission:
import math
from decimal import Decimal, getcontext


A, B = input().split()
print(math.floor(Decimal(A) * Decimal(B)))

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

import math


if __name__ == "__main__":
    A, B = input().split()
    print(math.floor(Decimal(A) * Decimal(B)))
Problem p02831 (python)

Fixed submission:
import fractions


def main():
    A, B = map(int, input().split())

    print(A * B // fractions.gcd(A, B))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math


def main():
    A, B = map(int, input().split())

    print(A * B // math.gcd(A, B))


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

Fixed submission:
def main():
    S = input()
    K = int(input())
    ans = 0

    if len(set(S)) is 1:
        print(len(S) * K // 2)
        return

    i = 0
    cnt = [1]
    while i < len(S) - 1:
        if S[i] is S[i + 1]:
            cnt[-1] += 1
        else:
            cnt.append(1)
        i += 1

    for v in cnt:
        ans += (v // 2) * K

    if S[0] is S[-1]:
        if cnt[0] % 2 == cnt[-1] % 2 == 1:
            ans += K - 1

    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    S = input()
    K = int(input())
    ans = 0

    if S[0] is S[-1]:
        length = len(S)
    else:
        length = len(S) - 1

    i = 0
    while i < length:
        if S[i] is S[i + 1]:
            ans += 1
            i += 1
        i += 1

    print(ans * K)


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

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

blue = N // (A + B) * A
rem = N % (A + B)
blue = blue + min(rem, A)

print(blue)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
s = ''
while len(s) < N:
    s += (A * 'b' + B * 'r') 

print(s[:N].count('b'))
Problem p02831 (python)

Fixed submission:
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
A, B = map(int , input().split())
print(lcm(A, B))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
a,b=map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

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

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

Fixed submission:
n = input()
print(n.replace("1", "x").replace("9", "1").replace("x", "9"))

Buggy submission (verdict: Runtime Error):
.replace('1','9')
Problem p03250 (python)

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

Buggy submission (verdict: Runtime Error):
Not found
Problem p03767 (python)

Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())),reverse=True)
ans=sum(a[1::2][:n])
print(ans)

Buggy submission (verdict: Runtime Error):
Not
Problem p03775 (python)

Fixed submission:
from math import sqrt
n = int(input())
m = 1
for i in range(2,int(sqrt(n)+1)):
    if n%i == 0:
        m = i
        
print(len(str(n//m)))

Buggy submission (verdict: Runtime Error):
n=int(input())
m=(n+1)//2
l=[]
for i in range(m):
    for j in range(m):
        if i*j==n:
            l.append(max(len(str(i)),len(str(j))))
print(min(l))
Problem p02754 (python)

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

s = 0
s = int(N / (A+B))*A
if N % (A+B) > A:
    s += A
else:
    s += N % (A+B)
print(s)

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

r = ''
for i in range(10**100):
    r += "b"* A
    if len(r) >= N:
        break
    r += "r"* B
    if len(r) >= N:
        break
print(r[:N].count('b'))

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

r = ''
while True:
    r += "b"* int(A)
    if len(r) >= int(N):
        break
    r += "r"* int(B)
    if len(r) >= int(N):
        break
print(r[:int(N)].count('b'))

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

r = ''
while True:
    r += "b"*A
    if len(r) >= N:
        break
    r += "r"*B
    if len(r) >= N:
        break
print(r[:N].count('b'))

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

r = ''
while True:
    r += "b"*A
    r += "r"*B
    if len(r) >= N:
        break
print(r[:N].count('b'))

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

r = ''
while True:
    r += "b"*A
    r += "r"*B
    if len(r) >= N:
        break
print(r[:N].count('b'))
Problem p02891 (python)

Fixed submission:
word = list(input())
num = int(input())
if len(word) == 1:
  print(num//2)
else:
  p = []
  count = 1
  for i in range(len(word)-1):
    if word[i] == word[i+1]:
      count += 1
      if i == len(word)-2:
        p.append(count)
    else:
      p.append(count)
      count = 1

  point = 0
  
  for i in p:
    point += i // 2
  if len(p) == 1:
    print(p[0]*num//2)
  elif word[0] == word[-1]:
    print((p[0] + p[-1])//2 * (num-1) + p[0]//2 + p[-1]//2 + (point - p[0]//2 - p[-1]//2)*num)
  else:
    print(point * num)

Buggy submission (verdict: Runtime Error):
word = list(input())
num = int(input())
p = []
count = 1
for i in range(len(word)-1):
  if word[i] == word[i+1]:
    count += 1
    if i == len(word)-2:
      p.append(count)
  else:
    p.append(count)
    count = 1

point = 0
for i in p:
  point += i // 2
if word[0] == word[-1] and p[-1] % 2 == 1:
  point += 1
  
print(point * num)
Problem p02916 (python)

Fixed submission:
num = int(input())
order = [int(s) for s in input().split()]
utility = [int(s) for s in input().split()]
add = [int(s) for s in input().split()]
point = 0
for i in range(num - 1):
  if order[i] + 1 == order[i + 1]:
    point += add[order[i] - 1]
    
print(sum(utility) + point)

Buggy submission (verdict: Runtime Error):
num = int(input())
order = [int(s) for s in input().split()]
utility = [int(s) for s in input().split()]
add = [int(s) for s in input().split()]
point = 0
for i in range(num - 1):
  if order[i] + 1 == order[i + 1]:
    point += add[order[i]]
    
print(sum(utility) + point)
Problem p02951 (python)

Fixed submission:
a = input().split( )
num = int(a[2]) - (int(a[0]) - int(a[1]))

if num <= 0:
  print(0)
else:
  print(num)

Buggy submission (verdict: Runtime Error):
num = int(input())
row = [int(s) for s in input().split()]
row[0] -= 1
for i in range(num - 1):
  if row[i + 1] > row[i]:
    row[i + 1] -= 1

p = 0
for i in range(num - 1):
  if row[i] <= row[i + 1]:
    p += 1
    
if p == num - 1:
  print("Yes")
else:
  print("No")
Problem p03835 (python)

Fixed submission:
K, S = map(int, input().split())
count = 0
for x in range(K + 1):
    for y in range(K + 1):
        z = S - x - y
        if 0 <= z <= K:
            count = count + 1

print(count)

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

X = []


def dfs(A):
    if len(A) == 3:
        if A[0] + A[1] + A[2] == S:
            X.append(A.copy())
        return
    for i in range(K + 1):
        A.append(i)
        dfs(A)
        A.pop()


dfs([])
print(len(X))
Problem p02699 (python)

Fixed submission:
S = list(map(int, input().split()))
if S[0] <= S[1]:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if S <= W:
  print('unsafe')
else:
  print('safe')
Problem p02701 (python)

Fixed submission:
N = int(input())
S = [input() for i in range(N)]
S.sort()
c = 1
for i in range(N-1):
  if S[i] == S[i+1]:
    continue
  else:
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]
S.sort()
c = 1
for i in range(N-1):
  if S[i] == S[i+1]:
    continue
  else: 
    c++
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]
S.sort()
c = 1
for i in range(N-1):
  if S[i] == S[i+1]:
    continue
  else c++:
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]
S.sort()
c = 1
for i in range(N-1):
  if S[i] == S[i+1]:
  else c++:
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]
S.sort()
c = 1
for i in range(N-1):
  if S[i] == S[i+1]
  else c++
print(c)
Problem p02711 (python)

Fixed submission:
n = int(input())

a = list(map(int, list(str(n))))

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

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

a = 0

for i in range(n):
  if s[i]=='R':
    for j in range(n):
      if s[j]=='G':
        for k in range(n):
          if s[k]=='B':
            if i<j<k:
              if (j-i)!=(k-j):
                a = a + 1
            elif i<k<j:
              if (k-i)!=(j-k):
                a = a + 1
            elif j<i<k:
              if (i-j)!=(k-i):
                a = a + 1
            elif j<k<i:
              if (k-j)!=(i-k):
                a = a + 1
            elif k<i<j:
              if (i-k)!=(j-i):
                a = a + 1
            elif k<j<i:
              if (j-k)!=(i-j):
                a = a + 1
          
print(a)
Problem p02726 (python)

Fixed submission:
N, X, Y = map(int, input().split())
X -= 1
Y -= 1
 
def dist(a, b):
  return min(abs(b-a), abs(X-a) + 1 + abs(b-Y), abs(Y-a) + 1 + abs(b-X))

ANS = [0] * N
for i in range(N):
  for j in range(i):
    ANS[dist(i, j)] += 1

        
for a in ANS[1:]:
  print(a)

Buggy submission (verdict: Runtime Error):
N, X, Y = map(int, input().split())
X -= 1
Y -= 1　　#１のところを０にするなど一つずつずらす
 
def dist(a, b):
  return min(abs(b-a), abs(X-a) + 1 + abs(b-Y), abs(Y-a) + 1 + abs(b-X))
 #＋１は間の一つ繋がっている分

ANS = [0] * N  　　　#0がN個のリストを作成。一つ目はk=0の時（同じところ）
for i in range(N):
  for j in range(i):
    ANS[dist(i, j)] += 1　　#0にずらしたことで０から始まるi,jに対応できている
        
        #i,jの最小値のindexに１ずつ足していく
        
for a in ANS[1:]:　#indexが１以降（数字の差が１以上）のものを一つづつ出力
  print(a)

Buggy submission (verdict: Runtime Error):
N, X, Y = map(int, input().split())
X -= 1
Y -= 1　　#１のところを０にするなど一つずつずらす
 
def dist(a, b):
    return min(abs(b-a), abs(X-a) + 1 + abs(b-Y), abs(Y-a) + 1 + abs(b-X))
 #＋１は間の一つ繋がっている分
 
ANS = [0] * N  　　　#0がN個のリストを作成。一つ目はk=0の時（同じところ）
for i in range(N):
    for j in range(i):
        ANS[dist(i, j)] += 1　　#0にずらしたことで０から始まるi,jに対応できている
        
        #i,jの最小値のindexに１ずつ足していく
        
for a in ANS[1:]:　#indexが１以降（数字の差が１以上）のものを一つづつ出力
  print(a)

Buggy submission (verdict: Runtime Error):
N, X, Y = map(int, input().split())
X -= 1
Y -= 1　　#１のところを０にするなど一つずつずらす
 
def dist(a, b):
    return min(abs(b-a), abs(X-a) + 1 + abs(b-Y), abs(Y-a) + 1 + abs(b-X))
 #＋１は間の一つ繋がっている分

ANS = [0] * N  　　　#0がN個のリストを作成。一つ目はk=0の時（同じところ）
for i in range(N):
    for j in range(i):
        ANS[dist(i, j)] += 1　　#0にずらしたことで０から始まるi,jに対応できている
        
        #i,jの最小値のindexに１ずつ足していく
 
for a in ANS[1:]:　#indexが１以降（数字の差が１以上）のものを一つづつ出力
    print(a)
Problem p02753 (python)

Fixed submission:
c = sorted(input())
 
if c[0]=='A' and c[2]=='B':
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
c = sorted(list(map(int, input())))

if c[0]==A and c[2]==B:
  print('Yes')
else:
  print('No')
Problem p03108 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**5)
n, m = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(m)]

ans = n * (n - 1) // 2
result = [ans]
leader = [-1] * n
size = [1] * n


def leader_check(i):
    if leader[i] == -1:
        return i
    ln = leader_check(leader[i])
    leader[i] = ln
    return ln

for a, b in ab[:0:-1]:
    a, b = a - 1, b - 1
    la = leader_check(a)
    lb = leader_check(b)
    if la != lb:
        leader[la] = lb
        ans -= size[la] * size[lb]
        size[lb] += size[la]
    result.append(ans)

for i in result[::-1]:
    print(i)

Buggy submission (verdict: Runtime Error):
import sys
n, m = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(m)]
sys.setrecursionlimit(m)
ans = n * (n - 1) // 2
result = [ans]
leader = [-1] * n
size = [1] * n


def leader_check(i):
    if leader[i] == -1:
        return i
    ln = leader_check(leader[i])
    leader[i] = ln
    return ln

for a, b in ab[:0:-1]:
    a, b = a - 1, b - 1
    la = leader_check(a)
    lb = leader_check(b)
    if la != lb:
        leader[la] = lb
        ans -= size[la] * size[lb]
        size[lb] += size[la]
    result.append(ans)

for i in result[::-1]:
    print(i)

Buggy submission (verdict: Runtime Error):
n, m = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(m)]
ans = n * (n - 1) // 2
result = [ans]
leader = [-1] * n
size = [1] * n
def leader_check(i):
    if leader[i]==-1:
        return i
    ln=leader_check(leader[i])
    leader[i]=ln
    return ln

for a, b in ab[:0:-1]:
    a, b = a - 1, b - 1
    la=leader_check(a)
    lb=leader_check(b)
    if la!=lb:
        leader[la]=lb
        ans-=size[la]*size[lb]
        size[lb]+=size[la]
    result.append(ans)

for i in result[::-1]:
    print(i)
Problem p02682 (python)

Fixed submission:
a,b,c,k = map(int,input().split())
if a+b >= k:
    if a > k:
        print(k)
    else:
        print(a)
else :
    print(a-(k-a-b))

Buggy submission (verdict: Runtime Error):
a,b,c,k = map(int,input().split())
if a < k:
    print(k)
else if a+b <= k:
    print(a)
else :
    print(a-(k-a-b))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
k = int(input())
if a + b >= k:
    print(a)
else :
    print(a-(k-a-b))
Problem p02693 (python)

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

c = b // k
d = k*c

if a <= d and d <= b:
    print('OK')
else:
    print('NG')

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

b = x//a
c = y//a

if c-b <= 1:
    print('NG')
elif:
    print('OK')

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

b = x//a
c = y//a

if c-b <= 1:
    print('NG')
elif:
    print('OK')

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

b = x//a
c = y//a

if c-b <= 1:
    print('NG')
elif:
    print('OK')
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 = 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 = n//(a+b)*a
rem = n%(a+b)
ans +=(rem,a)
print(ans)
Problem p02777 (python)

Fixed submission:
li = input().split()
A,B = map(int,input().split())	
U = input()

if li[1] == U:
    B -= 1
    print(A,B)
else:
    A -= 1
    print(A,B)

Buggy submission (verdict: Runtime Error):
S = input(), T = input()
A,B = map(int,input().split())	
U = input()

if S == U:
    A -= 1
    print(A,B)
else:
    B -= 1
    print(A,B)
Problem p02829 (python)

Fixed submission:
a=input()
b=input()
if (a=="1" and b=="2")or(a=="2" and b=="1"):
	print("3")
if (a=="1" and b=="3")or(a=="3" and b=="1"):
	print("2")
if (a=="3" and b=="2")or(a=="2" and b=="3"):
	print("1")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if (a=="1" and b=="2")or(a=="2" and b=="1"):
	print("3")
if (a=="1" and b=="3")or(a=="3" and b=="1"):
	print("2")
if (a=="3" and b=="2")or(a=="2" and b=="3"):
	print("1")
Problem p02711 (python)

Fixed submission:
N=str(input())
ans='No'
if int(N[0])==7 or int(N[1])==7 or int(N[2])==7:
  ans='Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
l,m,n = map(int,input().split())
ans='No'
if l==7 or m==7 or n==7:
  ans='Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
l,m,n = map(int,input().split())
ans='No'
if l==7 or m==7 or n==7:
  ans='Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
ans='No'
if N[0]==7 or N[1]==7 or N[2]== 7:
  ans = 'Yes'
print(ans)
Problem p02754 (python)

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

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
ans=0
if A>=N:
  ans=N
elif A<N<=A+B:
  ans=A
elif N>A+B:
  num=int(N/(A+B))
  ans=num*A+N-(A+B)*num
  if n-(A+B)*num>=A:
    ans=(num+1)*A
print(ans)
Problem p02897 (python)

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

Buggy submission (verdict: Runtime Error):
def factorization(n):
    if n == 1:
        return []
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append(i)
    if temp != 1:
        arr.append(temp)
    if not arr:
        arr.append(n)
    return arr


input_values = list(map(int, input().split()))
print(len(list(set(factorization(input_values[0])) & set(factorization(input_values[1])))) + 1)
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
n1, n2 = map(Decimal, input().split())
print(int(n1*n2))

Buggy submission (verdict: Runtime Error):
from Decimal import *
n1, n2 = map(Decimal, input().split())
print(int(n1*n2))
Problem p02659 (python)

Fixed submission:
A, B = input().split()
print(int(A) * int(B.replace(".", "")) // 100)

Buggy submission (verdict: Runtime Error):
A, B = input().split()


 
print(int(A) * int(B * 100) // 100)
Problem p03041 (python)

Fixed submission:
N, K = map(int, input().split())
S = list(input())
S[K - 1] = S[K - 1].lower()
print(''.join(S))

Buggy submission (verdict: Runtime Error):
N, K = map(int), input().split())
S = list(input())
S[K - 1] = S[K - 1].lower()
print(''.join(S))
Problem p02847 (python)

Fixed submission:
# SUN MON TUE WED THU FRI SAT

A = input()

if A == "SUN":
  print(7)
elif A == "MON":
  print(6)
elif A == "TUE":
  print(5)
elif A == "WED":
  print(4)
elif A == "THU":
  print(3)
elif A == "FRI":
  print(2)
elif A == "SAT":
  print(1)

Buggy submission (verdict: Runtime Error):
# SUN MON TUE WED THU FRI SAT

A = input()

if A == "SUN":
  print(7)
elif A == "MON":
  print(6)
elif A == "TUE":
  prnt(5)
elif A == "WED":
  print(4)
elif A == "THU":
  print(3)
elif A == "FRI":
  print(2)
elif A == "SAT":
  print(1)