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

Fixed submission:
S,T = input().strip().split()
A,B = map(int, input().strip().split())
U = input().strip()

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

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

if U == A:
  print(A-1,B)
else U == T:
  print(A,B-1)
Problem p02792 (python)

Fixed submission:
N = int(input().strip())

ans = 0

table = [[0 for i in range(10)] for j in range(10)]
for n in range(1,N+1):
  strn = str(n)
  table[int(strn[0])][int(strn[-1])] += 1

for i in range(1,10):
  for j in range(1,10):
    ans += table[i][j] * table[j][i]

print(ans)

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

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

def lcm(a,b):
  return a*b//gcd(a,b)

now_lcm = A[0]
for a in set(A[1:]):
  now_lcm = lcm(now_lcm, a)

MOD = 1000000000 + 7
ans = 0
for a in A:
  ans = (ans + (now_lcm//a)) % MOD
print(ans)
Problem p02879 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().strip().split(' '))
print(a*b if 1 <= a <= 9 and <= b <= 9 else -1)
Problem p02970 (python)

Fixed submission:
N,D = map(int, input().strip().split(' '))
area = 2*D+1
print((N+area-1)//area)

Buggy submission (verdict: Runtime Error):
N,D = map(int, input().strip().split(' '))
area = 2*D+1
print((N+area-1)///area)
Problem p02989 (python)

Fixed submission:
N = int(input().strip())
D = sorted(list(map(int, input().strip().split(' '))))
print(D[int(N/2)] - D[int(N/2)-1])

Buggy submission (verdict: Runtime Error):
N = int(input().strip())
D = sorted(list(map(int, input().strip().split(' '))))
print(D[N/2] - D[N/2-1])
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())
if S <= W:
    print("unsafe")
else:
    print("safe")

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

Fixed submission:
S,W=map(int,input().split())
if W>=S:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
S=int(input("S"))
W=int(input("W"))
if W>=S:
    print("unsafe")
else:
    print("safe")
Problem p02699 (python)

Fixed submission:
N,K = map(int,input().split())
if(N<=K):
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
if(N<=K):
    print('unsafe')
else:
    print('safe'
Problem p02773 (python)

Fixed submission:
i = int(input())

dic = {}
for j in range(i):
    word = input()
    if word in dic:
        dic[word] += 1
    else:
        dic[word] = 1


dic2 = sorted(dic.items(), key=lambda x:x[1])
k = len(dic2)-1
s = 0
ans = []
for p in range(len(dic2)):
    t = dic2[k][1]
    ans.append(dic2[k][0])
    k -= 1
    if t == dic2[k][1]:
        s = 1
    else:
        break
ans.sort()
for ak in ans:
    print(ak)

Buggy submission (verdict: Runtime Error):
from collections import Counter

i = int(input())

dic = {}
for j in range(i):
    word = input()
    if word in dic:
        dic[word] += 1
    else:
        dic[word] = 1


dic2 = sorted(dic.items(), key=lambda x:x[1])

k = len(dic2)-1
s = 0
while True:
    t = dic2[k][1]
    print(dic2[k][0])
    k -= 1
    if t == dic2[k][1]:
        s = 1
    else:
        break
Problem p03072 (python)

Fixed submission:
a = int(input())
b = map(int,input().split())
b = list(b)
k = 1
for i in range(a-1):
    maxim = max(b[:i+1])
    if maxim <= b[i+1]:
        k += 1
print(k)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = map(int,input().split())
b = list(b)
k = 1
for i in range(a-1):
    maxim = max(a[:i+1])
    if maxim <= a[i+1]:
        k += 1
print(k)
Problem p02862 (python)

Fixed submission:
def powermod(a, p, mod):
    if p == 0:
        return 1
    elif p % 2 == 0:
        return (powermod(a, p//2, mod) ** 2) % mod
    else:
        return ((powermod(a, (p-1)//2, mod) ** 2) % mod) * a % mod

def combinationmod(n,r):
    if r == 0 or n == r:
        return 1
    mod = 10 ** 9 + 7
    factorial = 1
    for i in range(n):
        factorial = (factorial * (i+1)) % mod
        if i+1 == r:
            fact_1 = factorial
        if i+1 == n-r:
            fact_2 = factorial
        if i+1 == n:
            fact_0 = factorial
    return fact_0 * powermod(fact_1,mod-2,mod) % mod * powermod(fact_2,mod-2,mod) % mod
    
X,Y = map(int,input().split())
if (X + Y) % 3 == 0 and X <= 2 * Y and 2 * X >= Y:
    turns = (X + Y) // 3
    print(combinationmod(turns, min(X,Y) - turns))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
def powermod(a, p, mod):
    if p == 0:
        return 1
    elif p % 2 == 0:
        return (powermod(a, p//2, mod) ** 2) % mod
    else:
        return ((powermod(a, (p-1)//2, mod) ** 2) % mod) * a % mod

def combinationmod(n,r):
    mod = 10 ** 9 + 7
    factorial = 1
    for i in range(n):
        factorial = (factorial * (i+1)) % mod
        if i+1 == r:
            fact_1 = factorial
        if i+1 == n-r:
            fact_2 = factorial
        if i+1 == n:
            fact_0 = factorial
    return fact_0 * powermod(fact_1,mod-2,mod) % mod * powermod(fact_2,mod-2,mod) % mod
    
X,Y = map(int,input().split())
if (X + Y) % 3 == 0 and X <= 2 * Y and 2 * X >= Y:
    turns = (X + Y) // 3
    print(combinationmod(turns, min(X,Y) - turns))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
def powermod(a, p, mod):
    if p == 0:
        return 1
    elif p % 2 == 0:
        return (powermod(a, p//2, mod) ** 2) % mod
    else:
        return ((powermod(a, (p-1)//2, mod) ** 2) % mod) * a % mod

def combinationmod(n,r):
    mod = 10 ** 9 + 7
    factorial = 1
    for i in range(n):
        factorial = (factorial * (i+1)) % mod
        if i+1 == r:
            fact_1 = factorial
        if i+1 == n-r:
            fact_2 = factorial
        if i+1 == n:
            fact_0 = factorial
    return fact_0 * powermod(fact_1,mod-2,mod) % mod * powermod(fact_2,mod-2,mod) % mod
    
X,Y = map(int,input().split())
if (X + Y) % 3 == 0:
    turns = (X + Y) // 3
    print(combinationmod(turns, min(X,Y) - turns))
else:
    print(0)
Problem p02915 (python)

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

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

print(n*n*n)
Problem p02754 (python)

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

div = N//(A+B) * A
mod = N % (A+B)
ans = div + min(mod, A)

print(ans)

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

ans = 0
ball = []

for i in range(N // (A + B)) :
    ball += list('b' * A + 'r' * B)

mod = N % (A + B)
if mod <= A :
    ball += list('b' * mod)
elif A < mod:
    ball += list('b' * A + 'r' * (mod - A))

#print(ball)
ans = ball.count('b')
print(ans)

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

ans = 0
ball = []

for i in range(N // (A + B)) :
    ball += list('b' * A + 'r' * B)

mod = N % (A + B)
if mod <= A :
    ball += list('b' * mod)
elif A < mod:
    ball += list('b' * A + 'r' * (mod - A))

#print(ball)
ans = ball.count('b')
print(ans)
Problem p02829 (python)

Fixed submission:
a = [int(input()) for i in range(2)]
A = a[0]
B = a[1]

ans = 6 - (A + B)
print(ans)

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

i = list(map(int,input().split()))
A = i[0]
B = i[1]

ans = (A * B) // gcd(A, B)

print(ans)

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

i = list(map(int,input().split()))
A = i[0]
B = i[1]

ans = (A * B) // gcd(A, B)

print(ans)
Problem p02831 (python)

Fixed submission:
from fractions import gcd

i = list(map(int,input().split()))
A = i[0]
B = i[1]

ans = (A * B) // gcd(A, B)

print(ans)

Buggy submission (verdict: Runtime Error):
import math

i = list(map(int,input().split()))
A = i[0]
B = i[1]

ans = (A * B) // math.gcd(A, B)

print(ans)
Problem p02925 (python)

Fixed submission:
import sys
from collections import deque

input = sys.stdin.readline

n = int(input())

to_battle_with = [deque([i - 1 for i in map(int, input().split())]) for _ in range(n)]


def update_battle(player, battle_set, to_battle_with):
    if not to_battle_with[player]:
        return
    next_opponent = to_battle_with[player][0]
    if not to_battle_with[next_opponent]:
        return
    if to_battle_with[next_opponent][0] == player:
        if player > next_opponent:
            player, next_opponent = next_opponent, player
        battle_set.add((player, next_opponent))


battles_today = set()
for player in range(n):
    update_battle(player, battles_today, to_battle_with)

day_count = 0
battle_count = 0
num_all_battles = (n * (n - 1)) // 2

while battles_today:
    battles_tomorrow = set()
    for p1, p2 in battles_today:
        battle_count += 1
        to_battle_with[p1].popleft()
        to_battle_with[p2].popleft()
        for p in [p1, p2]:
            update_battle(p, battles_tomorrow, to_battle_with)
    battles_today = battles_tomorrow
    day_count += 1

if battle_count == num_all_battles:
    print(day_count)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
def solve(A, N, day=0):
    # check if end
    if all([len(a) == 0 for a in A]):
        return day
    # get available games
    available_games = set()
    for player in range(N):

        if len(A[player]) == 0:
            continue

        opponent = A[player][0]

        if opponent == player or len(A[opponent]) == 0:
            continue

        if A[opponent][0] == player:
            if player > opponent:
                player, opponent = opponent, player
            available_games.add((player, opponent))
    if len(available_games) == 0:
        return -1

    for game in available_games:
        player, opponent = game
        A[player].pop(0)
        A[opponent].pop(0)
    return solve(A, N, day + 1)


if __name__ == '__main__':
    N = int(input())
    A = [list(map(int, input().split())) for _ in range(N)]
    for i in range(N):
        for j in range(N - 1):
            A[i][j] -= 1

    answer = solve(A, N)
    print(answer)

Buggy submission (verdict: Runtime Error):
def solve(A, N, day=0):
    # check if end
    if all([len(a) == 0 for a in A]):
        return day
    # get available games
    available_games = set()
    for i in range(N):

        if len(A[i]) == 0:
            continue

        j = A[i][0]

        if len(A[j]) == 0:
            continue

        if A[j][0] == i:
            if i > j:
                i, j = j, i
            available_games.add((i, j))
    if len(available_games) == 0:
        return -1

    for game in available_games:
        i, j = game
        A[i].pop(0)
        A[j].pop(0)
    return solve(A, N, day + 1)


if __name__ == '__main__':
    N = int(input())
    A = [list(map(int, input().split())) for _ in range(N)]
    for i in range(N):
        for j in range(N - 1):
            A[i][j] -= 1

    answer = solve(A, N)
    print(answer)
Problem p02880 (python)

Fixed submission:
n = int(input())

table = [0 for i in range(0, 102)]

for i in range(1, 10):
    for j in range(1, 10):
        table[i * j] = 1

if table[n] == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import numpy as np

n = int(input())

table = np.zeros(100)

for i in range(1, 10):
    for j in range(1, 10):
        table[i * j] = 1

if table[n] == 1:
    print('Yes')
else:
    print('No')
Problem p02707 (python)

Fixed submission:
n = int(input())
a = [int(n) for n in input().split()]
 
b = [0] * n
 
for i in a:
    b[i-1] += 1
 
for i in b:
    print(i)

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

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

dp = [0] * n

for i in a:
  b[i-1] += 1
  
for _ in b:
  print(_)
Problem p02699 (python)

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

if s > w :
  print("safe")
else:
  print("unsafe")

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

if s >= w :
  print(safe)
else:
  print(unsafe)
Problem p02701 (python)

Fixed submission:
n=int(input())
s=[input() for i in range(n)]
S=list(set(s))
print(len(S))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[int(input()) for i in range(n)]
S=list(set(s))
print(len(S))
Problem p02711 (python)

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

Buggy submission (verdict: Runtime Error):
string=inout()
t=False
for i in range (len(string)):
  if string[i]==7:
    t=True
if t==True:
  print("YES")
else:
  print("NO")
Problem p02759 (python)

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

Buggy submission (verdict: Runtime Error):
n=input()
if n%2==0:
  print(n/2)
if n%2==1:
  print((n+1)/2)

Buggy submission (verdict: Runtime Error):
n=inout()
if n%2==0:
  print(n/2)
if n%2==1:
  print((n+1)/2)
Problem p02860 (python)

Fixed submission:
n = int(input())
s = str(input())
t = int(n/2)

if n%2==1:
  print('No')
else:
  if s[:t]==s[t:]:
    print('Yes')
  else:
    print('No')

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

if n%2==1:
  print('No')
else:
  if s[:n/2]==s[n/2:]:
    print('Yes')
  else:
    print('No')

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

if n%2==1:
  print('No')
else:
  if s[:n/2]==s[n/2:]:
    print('Yes')
  else:
    print('No')
Problem p02916 (python)

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

ans = 0
for i in range(n):
  ans += b[a[i]-1]
  if i != n-1 and a[i+1]-a[i] == 1:
    ans += c[a[i]-1]
print(ans)

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

ans = 0
for i in range(n):
  ans += b[a[i]-1]
  if i != n-1 and a[i+1]-a[i] == 1:
    ans += c[a[i]-1]
print(ans)
Problem p02725 (python)

Fixed submission:
# 1行目の入力を空白で分割された数値として扱う
K, N = map(int, input().split())
# 2行目の入力を数値のリストとして扱う
A = list(map(int, input().split()))

# 答えの準備
ans = 0
max = 0

# 距離の取得
for i in range(0, N -1):
    d = A[i+1] - A[i]
    ans += d
    if d > max:
        max = d

# 一周した最後
dl = K - A[N - 1]
if dl + A[0] < max:
    ans = ans - max + dl + A[0]

# 出力
print(ans)

Buggy submission (verdict: Runtime Error):
# 1行目の入力を空白で分割された数値として扱う
N, X, Y = map(int, input().split())

# 最短経路のリスト
min = []
ans = []

# 距離の取得
for i in range(0, N -1):
    d = A[i+1] - A[i]
    ans += d
    if d > max:
        max = d

# 一周した最後
dl = K - A[N - 1]
if dl < max:
    ans = ans - max + dl + A[0]

# 出力
for j in range(0, N -1):
    print(ans[j])
Problem p02699 (python)

Fixed submission:
s,w = map(int,input().split())
if s>w:
  print('safe')
else:
  print('unsafe')

Buggy submission (verdict: Runtime Error):
s,w = map(int,input().split())
if s>w:
  print('safe')
 else:
  print('unsafe')
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 and z <= K:
    	count += 1
print(count)

Buggy submission (verdict: Runtime Error):
K = input()
S = input()
count = 0
 
for x in range(int(K)+1):
  for y in range(int(K)+1):
    z = int(S) - x - y
    if 0 <= z and z <= int(K):
    	count += 1

print(count)

Buggy submission (verdict: Runtime Error):
K = input()
S = input()
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count = count + 1
        
print(count)

Buggy submission (verdict: Runtime Error):
K = input()
S = input()
count = 0

for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
        
print(count)

Buggy submission (verdict: Runtime Error):
K = input()
S = input()
count = 0

for x in range(int(K)):
    for y in range(int(K)):
        z = int(S) - x - y
        if 0 <= z and z <= int(K):
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
K = input()
S = input()
count = 0

for x in range(int(K)):
    for y in range(int(K)):
        z = int(S) - x - y
        if 0 <= z and z <= int(K):
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
K = input()
S = input()
count = 0

for x in range(K):
    for y in range(K):
        z = S - x - y
        if 0 <= z and z <= K:
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
K = input()
S = input()
count = 0

for x in range(K):
  for y in range(K):
    z = S - x - y
    if 0=< z and z =< K:
      count += 1
      
print(count)
Problem p02711 (python)

Fixed submission:
N = input()

bool_7 = False

for i in N:
    if (int(i)== 7):
        bool_7 = True
        break

if bool_7:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

R_list = []
G_list = []
B_list = []
pair_list = []

for i in range(N):
    if S[i]=='R':
        R_list.append(i)
    elif S[i]=='G':
        G_list.append(i)
    else:
        B_list.append(i)

for i in R_list:
    for j in G_list:
        for k in B_list:
            pair_list.append([i,j,k])
        
count = 0
for pair in pair_list:
    pair.sort()
    if((pair[1]-pair[0])==(pair[2]-pair[1])):
        continue
    else:
        count += 1

#print(R_list)
#print(G_list)
#print(B_list)
#print(pair_list)
print(count)
Problem p02729 (python)

Fixed submission:
n, m = map(int,input().split())
print(int(n*(n-1)/2+m*(m-1)/2))

Buggy submission (verdict: Runtime Error):
l = float(input())
print((l/3)**3)
Problem p03207 (python)

Fixed submission:
N = int(input())
p = []
for i in range(N):
    p.append(int(input()))

print(sum(p)-max(p)//2)

Buggy submission (verdict: Runtime Error):
N = input()
p = []
for i in range(N):
    p.append(int(input()))

print(sum(p)-max(p)//2)

Buggy submission (verdict: Runtime Error):
N = input()
p = []
for i in range(N):
    p.append(input())

print(sum(p)-max(p)//2)
Problem p02701 (python)

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

Buggy submission (verdict: Runtime Error):
4
aaaa
a
aaa
aa
Problem p02771 (python)

Fixed submission:
a=list(map(int,input().split()))
check=0
if a[0]==a[1]:
    check+=1
if a[0]==a[2]:
    check+=1
if a[1]==a[2]:
    check+=1
if check==1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
[n,k]=map(int,input().split())
a=np.array(list(map(int,input().split())))

c=sorted([x * y for x, y in itertools.combinations(a,2)])
print(c[k-1])
Problem p02777 (python)

Fixed submission:
def main():
    s = input().split()
    n, m = list(map(int, input().split()))
    d = input()
    #print(s)
    if s[0] == d:
        print(n - 1, m)
    else:
        print(n, m - 1)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    s = input().split()
    n, m = list(map(int, input().split()))
    d = input()
    #print(s)
    if s[0] == d:
        print(n - 1, m)
    else:
        print(n, m - 1)


if __name__
Problem p03327 (python)

Fixed submission:
n = input()

if int(n) < 1000:
    print('ABC')
else:
    print('ABD')

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

c = int(b) - int(a)

print(int(a) - (c - 1))
Problem p02754 (python)

Fixed submission:
N,a,b=(int(x) for x in input().split())

num_char = (int(N /(a+b)))
num_joyo = (N %(a+b))
result = 0

if num_joyo <= a:
    result = num_char*a + (num_joyo)
else:
    result = num_char*a + a
    
print(result)

Buggy submission (verdict: Runtime Error):
N,a,b=(int(x) for x in input().split())

n = 1
result_str = ""
while n <= N:
    result_str += "b"*a
    n += a
    result_str += "r"*b
    n+= b
    
print(result_str[:8].count("b"))
Problem p02847 (python)

Fixed submission:
input_day = input()

day_dict = {"SUN":7,
                 "MON":6,
                 "TUE":5,
                 "WED":4,
                 "THU":3,
                  "FRI":2,
                  "SAT":1}

print(day_dict[input_day])

Buggy submission (verdict: Runtime Error):
move_num = int(input())
input_char_str = input()

char_list  = [chr(i) for i in range(65, 65+26)]

ans_char = ""
move_number = move_num
for input_char in input_char_str:
    if (char_list.index(input_char)+move_number) < len(char_list):
        ans_char += char_list[char_list.index(input_char)+move_number]
    else:
        char_index = (char_list.index(input_char)+move_number) - len(char_list)
        ans_char += char_list[char_index]
        
print(ans_char)
Problem p02987 (python)

Fixed submission:
def consunt():
    if input_.count(input_str_arr[0]) and input_.count(input_str_arr[1]):
      print("Yes")
    else:
      print("No")

input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if len(set(input_str_arr))==2:
    consunt()
else:
    print("No")

Buggy submission (verdict: Runtime Error):
num_input = int(input())
input_arr = [int(x) for x in input().split()]

max_input = max(input_arr)
count = 0
second_arr =[]
first_arr = []
sorted_arr = sorted(input_arr)
ans = sorted_arr[int(num_input/2)] - sorted_arr[int(num_input/2)-1]
print(ans)

Buggy submission (verdict: Runtime Error):
input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if len(set(input_str_arr))==2:
    consunt()
else:
    print("No")
    

def consunt():
    if input_.count(input_str_arr[0]) and input_.count(input_str_arr[1]):
      print("Yes")
    else:
      print("No")

Buggy submission (verdict: Runtime Error):
input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if input_.count(input_str_arr[0]) and input_.count(input_str_arr[1]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if input_.count(input_str_arr[0]) and input_.count(input_str_arr[1]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if input_.count(inpute_str_arr[0]) and input_.count(inpute_str_arr[0]):
  print("Yes")
else:
  print("No")
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
 
if s<=w:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
s, w = int(input().split())

if s<=w:
  print('unsafe')
else:
  print('safe')
Problem p02707 (python)

Fixed submission:
from collections import Counter
 
n = int(input())
a = list(map(int, input().split()))
 
c = Counter(a)
 
for _ in range(1, n+1):
  print(c[_])

Buggy submission (verdict: Runtime Error):
from collection import counter

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

c = counter(a)

for _ in c:
  print(_)
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):
n, x, y = map(int, input().split())

klist = [0]*(n)
for i in range(1, n):
  for j in range(i+1, n+1):
    k = min(j-i, abs(j-y)+1+abs(x-i))
    klist[k] += 1

for _ in range(1, n):
  print(klist[_])
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
if s<=w:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
s, w = map(int, input())
if s<=w:
  print('unsafe')
else:
  print('safe')
Problem p02951 (python)

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

diff = a - b - c

if diff >= 0:
  print(0)
else:
  print(-diff)

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

diff = a - b - c

if diff => 0:
  print(0)
else:
  print(-diff)
Problem p02831 (python)

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd (a, b)

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))