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

Fixed submission:
import numpy as np

N = int(input())
a = [input() for _ in range(N)]

a = np.sort(np.array(a))

unique_elements, index_elements = np.unique(a, return_index = True)
l = []
for i in range(index_elements.size -1):
  m = index_elements[i + 1] - index_elements[i]
  l.append(m)
l.append(a.size - index_elements[-1])    
elements = unique_elements[l == max(l)]


for i in elements:
	print(i)

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

N = int(input())
a = [input() for _ in range(N)]

a = np.array(a)

unique_elements, counts_elements = np.unique(a, return_counts=True)
elements = unique_elements[counts_elements == np.max(counts_elements)]
for i in elements:
    print(i)
    print('\n')

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

N = int(input())
a = [input() for _ in range(N)]

a = np.array(a)

unique_elements, counts_elements = np.unique(a, return_counts=True)
elements = unique_elements[counts_elements == np.max(counts_elements)]
for i in elements:
    print(i)

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

N = int(input())
a = [input() for _ in range(H)]

a = np.array(a)

unique_elements, counts_elements = np.unique(a, return_counts=True)
elements = unique_elements[counts_elements == np.max(counts_elements)]
for i in elements:
    print(i)

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

N = int(input())
a = input().split()

a = np.array(a)

unique_elements, counts_elements = np.unique(a, return_counts=True)
elements = unique_elements[counts_elements == np.max(counts_elements)]
for i in elements:
    print(i)
    print('\n')

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

N = int(input())
a = input().split()

a = np.array(a)

unique_elements, counts_elements = np.unique(a, return_counts=True)
elements = unique_elements[counts_elements == np.max(counts_elements)]
for i in elements:
    print(i)

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

N = int(input())
a = input().split()

a = np.array(a)

unique_elements, counts_elements = np.unique(a, return_counts=True)
elements = unique_elements[counts_elements == max(counts_elements)]
for i in elements:
    print(i)

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

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

a = np.array(a)
unique_elements, counts_elements = np.unique(a, return_counts=True)
elements = unique_elements[counts_elements == max(counts_elements)]
for i in elements:
    print(i)

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

a = np.array(a)
unique_elements, counts_elements = np.unique(a, return_counts=True)
elements = unique_elements[counts_elements == max(counts_elements)]
for i in elements:
    print(i)
Problem p02777 (python)

Fixed submission:
s,t = map(str, input().split())
a,b = map(int, input().split())
u = input()
if s == u:
  print("{} {}".format(a-1, b))
else:
  print("{} {}".format(a, b-1))

Buggy submission (verdict: Runtime Error):
s,t = map(str, input().split())
a,b = map(str, input().split())
u = input()
if s == u:
  print("{} {}".format(a-1, b))
else:
  print("{} {}".format(a, b-1))
Problem p02659 (python)

Fixed submission:

#TIME : 
#python에서 소수점연산을 할때 Decimal library를 사용해야한다. float는 바이너리로 표현을 해서 오차가 발생한다.
import sys
from math import sqrt
from decimal import Decimal

input = sys.stdin.readline

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))

AB = input().split()
a = Decimal(AB[0])
b = Decimal(AB[1])
res = (a*b).__trunc__()
print(res)

Buggy submission (verdict: Runtime Error):
#TIME : 
import sys
from math import sqrt
input = sys.stdin.readline

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))

AB = input().split()
a = int(AB[0])
b = int(AB[1]*100)
res = int((a*b/100))
print(res)
Problem p02659 (python)

Fixed submission:
a,b = input().split()
a = int(a)
b2 = 0
for i in b:
	if i == '.': continue
	else:
		b2 = 10*b2+int(i)
print((a*b2)//100)

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
ans = a*b
print(int(ans))
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()))

Q = sum(B)
for i in range(N-1):
    if A[i+1] == A[i]+1:
        Q += C[A[i]-1]
        
print(Q)

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

Q = sum(B)
for i in range(N-1):
    if A[i+1] == A[i]+1:
        Q += C[A[i]]
        
print(Q)

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

Q = sum(B)
for i in range(N-1):
    if A[i+1] == A[i]+1:
        Q += C[A[i]]
        
print(Q)
Problem p02659 (python)

Fixed submission:
from decimal import *
import math 
n,k = input().split()
n =Decimal(n)
k =Decimal(k)
a = math.floor(n*k)
print(a)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
n,k = input().split()
n =int(n)
k =Decimal(k)
a = math.floor(n*k)
print(a)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal

n,k = input().split()
n =int(n)
k =Decimal(k)


a = math.floor(n*k)
print(a)
Problem p03745 (python)

Fixed submission:

import numpy as np

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


ret = 0
i = 0
while i < len(a):
    j = i
    while j < n -1 and a[j] <= a[j+1]:
        j += 1
    h = i
    while h < n - 1 and a[h] >= a[h +1]:
        h += 1
    i = max(h,j) + 1
    ret += 1

print(ret)

Buggy submission (verdict: Runtime Error):

import numpy as np

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


ret = 0
i = 0
while i < len(a):
    j = i
    while j < n -1 and a[j] <= a[j+1]:
        j += 1
    h = i
    while h < n - i and a[h] >= a[h +1 ]:
        h += 1
        i = max(h,j) + 1
        ret += 1

print(ret)
Problem p02831 (python)

Fixed submission:
import math

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

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

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

print(lcm(a, b))
Problem p03127 (python)

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

ans = 0

for i in range(1, len(a)):
    if i == 1:
        ans = fractions.gcd(a[0], a[1])
    else:
        ans = fractions.gcd(ans, a[i])

print(ans)

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

ans = 0

for i in range(1, len(a)):
    if i == 1:
        ans = math.gcd(a[0], a[1])
    else:
        ans = math.gcd(ans, a[i])

print(ans)
Problem p02701 (python)

Fixed submission:
import random

n = int(input())
m = []
for i in range(n):
    m.append(input())  

# ll = []
# for j in range(n):
#     ll.append(m[random.randrange(n)])
print(len(set(m)))

Buggy submission (verdict: Runtime Error):
import random

n = int(input())
m = []
for i in range(n):
    m.append(input())  

# l = list(range(n-1))
ll = []
for j in range(n):
    ll.append(m[random.randrange(n-1)])
print(len(set(ll)))
Problem p02711 (python)

Fixed submission:
int = int(input())
st = str(int)
chars = list(st)
if chars[0] == "7":
  print("Yes")
elif chars[1] == "7":
  print("Yes")
elif chars[2] == "7":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
int = int(input())
st = str(int)
chars = list(st)
if chars[0] == 7:
  print("Yes")
elif chars[1] == 7:
  print("Yes")
elif chars[2] == 7:
  print("Yes")
else print("No")

Buggy submission (verdict: Runtime Error):
int = input()
st = str(int)
chars = list(st)
if chars[0] == 7:
  print("Yes")
elif chars[1] == 7:
  print("Yes")
elif chars[2] == 7:
  print("Yes")
else print("No")

Buggy submission (verdict: Runtime Error):
str = input()
chars = list(str)
if chars[0] == 7:
  print("Yes")
elif chars[1] == 7:
  print("Yes")
elif chars[2] == 7:
  print("Yes")
else print("No")
Problem p02712 (python)

Fixed submission:
list = []
i = int(input())
for j in range(1,i+1):
    if j%3 == 0 or j%5 == 0:
        list.append(0)
    else:
        list.append(j)
print(sum(list))

Buggy submission (verdict: Runtime Error):
list = []
i = int(input())
if i%3 != 0 or i%5 != 0:
  list.add(i)
print(sum(list))
Problem p02659 (python)

Fixed submission:
import math
from decimal import *
getcontext().prec = 100
a,b=input().split()
a=int(a)
print(int(a*Decimal(b)))

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <fstream>
#include <algorithm>
using namespace std;

int main() {
    unsigned long long a,k;
    float b;
    cin>>a>>b;
    k=trunc(a*b);
    cout<<k;
    return 0;
}
Problem p02759 (python)

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

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
S = [0] * M
C = [0] * M
for i in range(M):
    S[i], C[i]= map(int, input().split())

if M==0:
  A = 10**(N-1)
else:
  A = 0

X = []
for j in range(M):
  if S[j] in X:
    X.append(S[j])
  else:
    A +=(10**((N-S[j])))*C[j]
    X.append(S[j])

str_B = list(str(A))

for k in range(M):
  if str_B[S[k]-1] != str(C[k]):
    A = -1

if A < 10**(N-1):
  A = -1

print(A)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()

print( s if a >= 3200 else "red")

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



for i in range(N-1):
    V[0] = (V[0] + V.pop(1))/2

print(V[0])
Problem p03723 (python)

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

ans = 0

while (A%2 == 0) & (B%2 == 0) & (C%2 == 0):
    if (A==B) & (B==C) :
        ans = -1
        break

    a = (B+C)/2
    b = (A+C)/2
    c = (A+B)/2
    A = a
    B = b
    C = c
    ans += 1

print(ans)

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

ans = 0

while (A%2 == 0) & (B%2 == 0) & (C%2 == 0):
    if (A==B) & (B==C) :
        ans = -1
        break

    a = (B+C)/2
    b = (A+C)/2
    c = (A+B)/2
    A = a
    B = b
    C = c
        ans += 1

print(ans)
Problem p02790 (python)

Fixed submission:
n,m = map(int,input().split())
a = b = ''
for _ in range(m):
    a += str(n)
for _ in range(n):
    b += str(m)

print(a if n <= m else b)

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

for _ in range(m):
    a += str(n)
for _ in range(n):
    b += str(m)

print(a if n <= m else b)
Problem p02793 (python)

Fixed submission:
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
for i in a:
    g = i*g//gcd(i,g)
ans = 0
for i in range(n):
    ans+=int(g//a[i])
print(ans%(10**9+7))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
if n>1:
    for idx in range(1,len(a)):
        g = a[idx]*g//gcd(a[idx],g)
ans = []
for i in range(n):
    ans.append(int(g/a[i]))
print(sum(ans)%(10**9+7))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
if n>1:
    for idx in range(1,len(a)):
        g = a[idx]*g//math.gcd(a[idx],g)
ans = []
for i in range(n):
    ans.append(int(g/a[i]))
print(sum(ans)%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
a = [int(x) for x in input().split()]
g = a[0]
if n>1:
    for idx in range(1,len(a)):
        g = a[idx]*g//math.gcd(a[idx],g)
ans = []
for i in range(n):
    ans.append(int(g/a[i]))
print(sum(ans)%(10**9+7))
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())

print(6-a-b)

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

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

print(int(a*b/gcd(a,b)))
Problem p02831 (python)

Fixed submission:
from fractions import gcd

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

print(int(a*b/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 p02990 (python)

Fixed submission:
n,k = map(int, input().split())
mod = 10**9+7

dp = [[1] + [0 for i in range(k)] for j in range(n+1)]
for i in range(1,n+1):
    for j in range(1,k+1):
        dp[i][j] = dp[i-1][j] + dp[i-1][j-1]

for i in range(k):
    print(dp[n-k+1][i+1]*dp[k-1][i]%mod)

Buggy submission (verdict: Runtime Error):
mod = 10**9+7
a = n-k
if a > k: r = a
else: r = k

c = [[0]*(r+1)]
for i in range(1,r+2):
    c1 = [1]
    for j in range(1,r+2):
        if i == 1:
            if i == j:
                c1.append(1)
            else:
                c1.append(0)
        else:
            if j <= i:
                c1.append(c[i-1][j-1] + c[i-1][j])
            else:
                c1.append(0)
    c.append(c1)
for i in range(k):
    if a != 0:
        print(c[a+1][i+1]*c[k-1][i]%mod)
    else:
        print("0")
Problem p02659 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = input().split()
a = float(a)
b = float(b*100)
print(a*b//100)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
a = int(a)
b = int(b*100)
print(a*b/100)

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

Buggy submission (verdict: Runtime Error):
a,b = input().split()
a = int(a)
b = int(b.replace(".","")
print(a*b//100)

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

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

Buggy submission (verdict: Runtime Error):
import math
a, b = map(decimal, input().split())
b = b*1000
c = a*b
print(math.floor(c/1000))

Buggy submission (verdict: Runtime Error):
a, b = map(decimal, input().split())
b = b*1000
c = a*b
print(math.floor(c/1000))

Buggy submission (verdict: Runtime Error):
a, b = map(float, input().split())
b = b*1000
c = a*b
print(math.floor(c/1000))
Problem p02777 (python)

Fixed submission:
color = input().split()
num = input().split()
choice = input()

for i in range(2):
  num[i] = int(num[i])
  if color[i] == choice:
    num[i] = num[i] - 1
print(num[0], num[1])

Buggy submission (verdict: Runtime Error):
color = input().split()
num = input().split()
choice = input()
for i in 2:
  if choice == color[i]:
    num[i] = int(num[i]) - int(color[i])
    
print(num)
Problem p03075 (python)

Fixed submission:
ant = [int(input()) for i in range(5)]
k = int(input())
d = []
for i in range(5):
    for j in range(5):
        d.append(ant[i] - ant[j])

if max(d) > k:
    ans = ':('
else:
    ans = 'Yay!'

print(ans)

Buggy submission (verdict: Runtime Error):
ant = [int(input()) for _ in range(5)]
k = int(input())

if ant[5] - ant[1] > k:
  print(':(')
else:
  print('Yay!')
Problem p02759 (python)

Fixed submission:
N = int(input())
n = 0

if N % 2 == 0:
    n = N / 2
else:
    n = (N + 1)/2

print(int(n))

Buggy submission (verdict: Runtime Error):
N, M = map(int,(input().split()))
table = [input().split() for l in range(M)]
ans = 0
array1 = []
array2 = []
array3 = []
keta1 = -1
keta2 = -1
keta3 = -1
s1 = 0
s2 = 0
s3 = 0
for k in range(M):
    for j in range(2):
        table[k][j] = int(table[k][j])

for k in range(M):
    if table[k][0] == 1:
        if table[k][1] == 0 or (not(table[k][1] in array1) and s1 == 1):
            keta1 = -1
        else:
            keta1 = table[k][1]
        s1 = 1
        array1.append(table[k][1])

    elif table[k][0] == 2:
        if not(table[k][1] in array2) and s2 ==1:
            keta2 = -1
        else:
            keta2 = table[k][1]
        s2 = 1
        array2.append(table[k][1])
    else:
        if not(table[k][1] in array3) and s3 == 1:
            keta3 = -1
        else:
            keta3 = table[k][1]
        s3 = 1
        array3.append(table[k][1])

if s1 != 1:
    keta1 = 1
if s2 != 1:
    keta2 = 0
if s3 != 1:
    keta3 = 0

if keta1 == -1 or keta2 == -1 or keta3 == -1:
    ans = -1
else:
    ans = keta1 * 100 + keta2 * 10 + keta3

print(ans)
Problem p02829 (python)

Fixed submission:
A = int(input())
B = int(input())
print(6 - A - B)

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
print(6 - A - B)
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()

N = int(N / 2)
if S[: N] == S[N: ]:
    print('Yes')
else:
    print('No')

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

S = input()

ans = True
for i in range(N):
  if S[i] != S[i + N / 2]:
    ans = False
    
if ans:
  print('Yes')
else:
  print('No')
Problem p02912 (python)

Fixed submission:
import heapq
N,M = map(int,input().split())
H=[]
for i in input().split():
    heapq.heappush(H,-int(i))
for i in range(M):
    a = heapq.heappop(H)
    heapq.heappush(H,-(-a//2))
print(-sum(H))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A=[int(n) for n in input().split()]
A.sort()
        
for _ in range(M):
    a = A[-1]//2
    del A[-1]
    for i in range(N):
        if A[i] >a:
            A.insert(i, a)
            break
print(sum(A))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A=[int(n) for n in input().split()]
A.sort()
        
for _ in range(M):
    a = A[-1]//2
    del A[-1]
    for i in range(N):
        if A[i] >a:
            A.insert(i, a)
            break
    print(A)
print(sum(A))
Problem p03127 (python)

Fixed submission:
N = int(input())
A = [int(n) for n in input().split()]

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

temp_gcd = gcd(A[0],A[1])
for i in range(2,N):
     temp_gcd = gcd(A[i],temp_gcd)
print(temp_gcd)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(n) for n in input().split()]

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

temp_gcm = gcm(A[0],A[1])
for i in range(2,N):
  temp_gcm = gcm(A[i],temp_gcm)
print(temp_gcm)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(n) for n in input().split()]

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

temp_gcm = gcm(A[0],A[1])
 for i in range(2,N):
     temp_gcm = gcm(A[i],temp_gcm)
print(temp_gcm)
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,w=map(int, input().split())
if w>=s:
  pritn('unsafe')
else:
  print('safe')
Problem p02754 (python)

Fixed submission:
n,a,b=map(int, input().split())
t=a+b
s=n//t
p=n%t
g=0
if p<=a:
  g=p
else:
  g=a
print(s*a+g)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int, input().split())
t=''
while len(t)<n:
  t+='b'*a+'r'*b
t=t[::-1]
t=list(t)
g=0
for i in range(n):
  f=t.pop()
  if f=='b':
    g+=1
print(g)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int, input().split())
t=''
while len(t)<n:
  t+='b'*a+'r'*b
t=t[::-1]
t=list(t)
g=0
for i in range(n):
  f=t.pop()
  if f=='b':
    g+=1
print(g)
Problem p02759 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
S=N%2
if S==0:
  print(N//2)
else:
  print(N//2)+1
Problem p02790 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
if a>b:
  string(a)*b
  print(string(a)*b)
else:
  print(string(b)*a)
Problem p02989 (python)

Fixed submission:
n=int(input())
d=list(map(int, input().split()))
l=len(d)//2
d.sort()
dif=d[l]-d[l-1]
if dif==0:
  print(0)
else:
  print(dif)

Buggy submission (verdict: Runtime Error):
n=int(input())
d=list(map(int, input().split()))
l=d//2
dif=d[l]-d[l-1]
if dif==0:
  print(0)
else:
  print(dif)

Buggy submission (verdict: Runtime Error):
n=int(input())
d=list(map(int, input().split()))
l=d//2
def=d[l]-d[l-1]
if def==0:
  print(0)
else:
  print(def)
Problem p03041 (python)

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

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

Fixed submission:
A=[0]*6
for i in range(6):
  A[i]=int(input())
for i in range(5):
  for j in range(5):
    if A[i]-A[j]>A[5]:
      print(':(')
      exit()
print('Yay!')

Buggy submission (verdict: Runtime Error):
A=[0]*6
for i in range(6):
  A[i]=int(input())
for i in range(5):
  for j in range(5):
    if A[i]-A[j]>A[6]:
      print(':(')
      exit()
print('Yay!')
Problem p02753 (python)

Fixed submission:
s=input()
print('Yes' if "A" in s and "B" in s else "No")

Buggy submission (verdict: Runtime Error):
print('Yes' if "A" in input() and "B" in input() else "No")
Problem p02753 (python)

Fixed submission:
s = input()

if s.count('A') > 0 and s.count('B') > 0:
  print('Yes')
else:
  print('No')

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

s = deque()
s.append(input())
q = int(input())

reverse_status = False

for i in range(q):
  query = list(map(format, input().split()))
  if int(query[0]) == 1:
    if reverse_status:
      reverse_status = False
    else:
      reverse_status = True
  else:
    if int(query[1]) == 1:
      if reverse_status:
        s.append(query[2])
      else:
        s.appendleft(query[2])
    else:
      if reverse_status:
        s.appendleft(query[2])
      else:
        s.append(query[2])

if reverse_status:
  s.reverse()
print(''.join(s))
Problem p02820 (python)

Fixed submission:
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())

score = {
  'r': r,
  's': s,
  'p': p
}

win_map = {
  'r': 'p',
  's': 'r',
  'p': 's'
}

lose_map = {
  'r': 's',
  's': 'p',
  'p': 'r'
}

result = [''] * n
result_num = 0
for j in range(n):
  if j >= k and result[j - k] == win_map[t[j]]:
    if j + k < n and t[j] == win_map[t[j + k]]:
      result[j] = lose_map[t[j]]
    else:
      result[j] = t[j]
  else:
    result[j] = win_map[t[j]]
    result_num += score[win_map[t[j]]]


print(result_num)

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

score = {
  'r': r,
  's': s,
  'p': p
}

win_map = {
  'r': 'p',
  's': 'r',
  'p': 's'
}

lose_map = {
  'r': 's',
  's': 'p',
  'p': 'r'
}

result = [''] * n
result_num = 0
for j in range(n):
  if j >= k and result[j - k] == win_map[t[j]]:
    if j < k + 2 and t[j] == win_map[t[j + k]]:
      result[j] = lose_map[t[j]]
    else:
      result[j] = t[j]
  else:
    result[j] = win_map[t[j]]
    result_num += score[win_map[t[j]]]


print(result_num)
Problem p02831 (python)

Fixed submission:
import fractions

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

result = a * b / fractions.gcd(a, b)

print(int(result))

Buggy submission (verdict: Runtime Error):
import math

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

result = a * b / math.gcd(a, b)

print(int(result))