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

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

M = 998244353
fact_n = [0 for m in range(n+1)]
fact_inv = [0 for m in range(n+1)]


def mod_pow(a, n):
    x = 1
    while n > 0:
        if n & 1:
            x = x * a % M

        a = a * a % M
        n >>= 1

    return x


def combination(n, r):
    if n == 0 and r == 0:
        return 1
    elif n < r or n < 0:
        return 0

    return fact_n[n] * fact_inv[r] * fact_inv[n-r] % M


def main():
    fact_n[0] = fact_inv[0] = 1
    for i in range(1, n+1):
        fact_n[i] = fact_n[i-1] * i % M

    fact_inv[n] = pow(fact_n[n], M-2, M)
    for i in range(n-1, 0, -1):
        fact_inv[i] = fact_inv[i+1] * (i+1) % M

    com = 0
    for i in range(n+1):
        if (k-a*i) % b == 0 and k - a * i >= 0:
            j = (k-a*i) // b
            com += combination(n, i) * combination(n, j) % M

    print(com % M)


if __name__ == '__main__':
    main()

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

M = 998244353
fact_n = [0 for m in range(n+1)]
fact_inv = [0 for m in range(n+1)]


def combination(n, r):
    if n == 0 and r == 0:
        return 1
    elif n < r or n < 0:
        return 0

    c = fact_inv[r] * fact_inv[n-r] % M
    return fact_n[n] * c % M


def main():
    fact_n[0] = fact_inv[0] = 1
    for i in range(1, n+1):
        fact_n[i] = fact_n[i-1] * i % M
        fact_inv[i] = fact_inv[i-1] * pow(i, M-2, M) % M

    com = 0
    for i in range(n):
        if (k-a*i) % b == 0:
            j = (k-a*i) // b
            com += combination(n, i) * combination(n, j) % M

    print(com)


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

Fixed submission:
n,m = map(float,input().split())
a= round(m*100)
b= int(n)
print(int(a*b // 100))

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

print(math.floor(n * m)
Problem p02693 (python)

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

sa = m[1] - m[0]
flag = 0
hantei = m[0]

if sa == 0:
    if m[0] % n == 0:
        print("OK")
        exit()
    else:
        print("NG")
        exit()

if hantei % n == 0:
    flag += 1

for x in range(sa):
    hantei = (x + 1) + m[0]
    if hantei % n == 0:
        flag += 1

if flag >= 1:
    print("OK")
else:
    print("NG")

Buggy submission (verdict: Runtime Error):
import math

n = list(map(int,input().split()))
x = min(b-1 , n[2])
if n[2] >= n[2]:
    print(math.floor(n[0] * x // n[1]))
Problem p02688 (python)

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

d = []
l = []
i = 0

while i < 2*K:
  i += 1
  if i % 2 == 0:
    l.extend([int(x) for x in input().split()])
  else:
    d.append(int(input()))

L = list(set(l))
print(N - len(L))

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

d = []
l = []
i = 0

while i <= 2*K:
  i += 1
  if i % 2 == 1:
    d.append(int(input()))
  else:
    l.extend([int(x) for x in input().split()])

L = set(l)
print(K - len(L))

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

d = []
l = []
i = 0

while i <= 2*K:
  i += 1
  if i % 2 == 1:
    d.append(int(input()))
  else:
    l = l + list(map(int,input().split()))

L = set(l)
print(K - len(L))

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

d = []
l = []
i = 0

while i <= 2*K:
  i += 1
  if i % 2 == 1:
    d.append(int(input()))
  else:
    l + list(map(int,input().split()))

L = set(l)
print(K - len(L))

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

d = []
l = []
i = 0

while i <= 2*K:
  i += 1
  if i % 2 == 1:
    d.append(int(input()))
  else:
    l.append(list(map(int,input().split()))

L = set(l)
print(K - len(L))

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

d = []
l = []
i = 0

while i <= 2*K:
  i += 1
  if i % 2 == 1:
    d.append(input())
  else:
    l.appemd(input())

L = set(l)
print(K - len(L))
Problem p02711 (python)

Fixed submission:
N = str(input())

if N[-1] == "7" or N[-2] == "7" or N[-3] == "7":
    print("Yes")
else:
  	print("No")

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

if N[-1] = "7" or N[-2] = "7" or N[-3] = "7":
    print("Yes")
else:
  	print("No")

Buggy submission (verdict: Runtime Error):
N = str(input())
 
if N[-1] = "7" or N[-2] = "7" or N[-3] = "7":
    print("Yes")
else:
  	print("No")

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

if N[-1] = 7 or N[-2] = 7 or N[-3] = 7:
    print("Yes")
else:
  	print("No")
Problem p02773 (python)

Fixed submission:
import collections
 
N = int(input())
l = [input() for _ in range(N)]
 
c = collections.Counter(l)
 
L = c.most_common()
 
values, counts = zip(*c.most_common())
 
A = list(values)
B = list(counts)
 
b = B.count(B[0])
 
a = A[0:b]
c = sorted(a)

for i in c[0:]:
		print(i)

Buggy submission (verdict: Runtime Error):
import collections

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

c = collections.Counter(l)

L = c.most_common()

values, counts = zip(*c.most_common())

A = list(values)
B = list(counts)

b = B.count(B[0])

a = A[0:b + 1]

for i in a[0:]:
print(i)

Buggy submission (verdict: Runtime Error):
import collections

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

c = collections.Counter(l)

L = c.most_common()

values, counts = zip(*c.most_common())

A = list(values)
B = list(counts)

b = B.count(B[0])

a = A[0:b + 1]

for i in a[0:]:
print(i)

Buggy submission (verdict: Runtime Error):
import collections

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

c = collections.Counter(l)

L = c.most_common()

values, counts = zip(*c.most_common())

A = list(values)
B = list(counts)

b = B.count(B[0])

a = A[0:b + 1]

for i in a[0:]:
print(i)

Buggy submission (verdict: Runtime Error):
import collections
 
N = int(input())
l = [input() for _ in range(H)]
 
c = collections.Counter(l)
 
L = c.most_common()
 
values, counts = zip(*c.most_common())
 
A = list(values)
B = list(counts)
 
b = B.count(B[0])
 
a = A[0:b + 1]
 
for i in a[0:]:
print(i)

Buggy submission (verdict: Runtime Error):
import collections

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

c = collections.Counter(l)

L = c.most_common()

values, counts = zip(*c.most_common())

A = list(values)
B = list(counts)

b = B.count(B[0])

a = A[0:b + 1]

[print(i) for i in a]
Problem p02777 (python)

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

if U == S:
  	A -= 1
else:
  	B -= 1

print(A),
print(B)

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

if U = S:
  	A -= 1
else:
  	B -= 1

print(A),
print(B)
Problem p02847 (python)

Fixed submission:
d = input()

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

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

str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
alist = list(str)

print(alist)
Problem p02933 (python)

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

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

Buggy submission (verdict: Runtime Error):
n,q = input().split()
#print(str(n))
#print(str(q))

n = int(n)
q = int(q)
a = [0] * (n-1)
b = [0] * (n-1)
p = [0] * q
x = [0] * q
counter = [0] * n
children = []
parent = [-1] * n

for c in range(n):
  children.append(str(c+1))
#print(children)

for i in range(n-1):
  a[i],b[i] = input().split()
  parent[int(b[i]) - 1] = int(a[i])-1#親の配列インデックス
  children[int(a[i])-1]+=(" "+b[i])
  children[parent[int(a[i])-1]] += (" "+b[i])

for j in range(q):
  p[j],x[j] = input().split()
  list = children[int(p[j])-1].split()
  #print(list)
  for aa in list:
    counter[int(aa)-1] += int(x[j])
for bb in counter:
  print(bb, end="")
  print(" ", end="")

Buggy submission (verdict: Runtime Error):
n,q = input().split()
#print(str(n))
#print(str(q))
 
n = int(n)
q = int(q)
a = [0] * (n-1)
b = [0] * (n-1)
p = [0] * q
x = [0] * q
counter = [0] * n
children = []
parent = [-1] * n
 
for c in range(n):
  children.append(str(c+1))
#print(children)
 
for i in range(n-1):
  a[i],b[i] = input().split()
  parent[int(b[i]) - 1] = int(a[i])-1#親の配列インデックス
  children[int(a[i])-1]+=(" "+b[i])
  children[parent[int(a[i])-1]] += (" "+b[i])
 
for j in range(q):
  p[j],x[j] = input().split()
  list = children[int(p[j])-1].split()
  #print(list)
  for aa in list:
    counter[int(aa)-1] += int(x[j])
for bb in counter:
  print(bb, end="")
  print(" ", end="")
Problem p02753 (python)

Fixed submission:
S = input()
c = S.count('A') 
if c == 3 or c == 0:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
S = input()
c = S.count('A') 
if s == 3 or s == 0:
  print('No')
else:
  print('Yes')
Problem p02771 (python)

Fixed submission:
a,b,c = map(int, input().split())
if a == b and b != c:
  print('Yes') 
elif b == c and c != a:
  print('Yes')
elif c == a and a != b:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
#i桁めをそのまま払うかi+1桁めの額の紙幣で支払うかでDP
N = input()
digit = len(N)
l_N = [0] * digit
for i in range(1, digit + 1):
  l_N[i - 1] = int(N[-i])
dp = 0
for i in range(digit):
  dp += min(l_N[i], 10 - l_N[i] + 1)
  #print(dp)
print(dp)
Problem p03986 (python)

Fixed submission:
X = input()
cnt = 0
res = 0
for i in X:
  if i == 'S':
    cnt += 1
  else:
    if cnt > 0:
      cnt -= 1
    else:
      res += 1
print(cnt + res)

Buggy submission (verdict: Runtime Error):
X = input()
mLoop = 10 ** 1000
i = 0
while i < mLoop:
  p = X.find('ST')
  if p == -1:
    break
  q = p + 2
  p -= 1
  while p >= 0 and i < mLoop:
    if not(X[p] == 'S' and X[q] == 'T'):
      break
    p -= 1
    q += 1
    i += 1
  X = ''.join([X[:p + 1],X[q:]])
  i += 1

print(len(X))
Problem p02693 (python)

Fixed submission:
k = int(input())
a,b = map(int,input().split())
if a % k == 0:
    print('OK')
elif a + k - a%k <= b:
    print('OK')
else:
    print('NG')

Buggy submission (verdict: Runtime Error):
n,m,q = map(int,input().split())
List = [list(map(int, input().split())) for i in range(q)]

p_max = 0
point =0
A = [1]*n
E = [m]*n

while A != E :

    #得点計算
    for j in range(q):
        if A[List[j][1]-1] - A[List[j][0]-1] == List[j][2]:
            point += List[j][3]


    #最大値の更新
    if p_max < point:
        p_max = point
    point = 0


    #Aの更新
    for i in reversed(range(0,n)):
        if A[i] < m:
            A[i] = A[i] + 1
            if i !=n-1:
                for k in range(i+1,n):
                    A[k] = A[i]
            break

print(p_max)
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 = int(input())
w = int(input())

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

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

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

Buggy submission (verdict: Runtime Error):
s = input()
w = input()

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

Fixed submission:
import collections

n = int(input())
List = list(map(int, input().split()))
Col = collections.Counter(List)
Col2 = sorted(Col.items())
CountList = [0]*n
for i in Col2:
    CountList[i[0]-1] = i[1]
#CountList = list(Col2.values()) 
#for i in range(n-len(CountList)):
#    CountList.append(0)

for i in CountList:
    print(i)

Buggy submission (verdict: Runtime Error):
import collections
import numpy as np
n = int(input())
List = list(map(int, input().split()))
Col = collections.Counter(List)
CountList = list(Col) 
for i in range(n-len(CountList)):
    CountList.append(0)
#padding = np.zeros_like(list(range(n-len(CountList))))
#print(padding)
#CountList2 = CountList + padding

for i in CountList:
    print(i)

#for i in range(n):
#    CountList[i] = List.count(i+1)
Problem p02711 (python)

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

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

    rcs = [0] * N
    gcs = [0] * N
    bcs = [0] * N

    for i in range(N):
        if S[i] == 'R':
            rcs[i] = 1
        elif S[i] == 'G':
            gcs[i] = 1
        elif S[i] == 'B':
            bcs[i] = 1

    for i in range(1, N):
        rcs[i] += rcs[i - 1]
        gcs[i] += gcs[i - 1]
        bcs[i] += bcs[i - 1]

    result = 0
    for i in range(N):
        if S[i] == 'R':
            for j in range(i + 1, N):
                if S[j] == 'R':
                    continue
                elif S[j] == 'G':
                    result += bcs[N - 1] - bcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'B':
                        result -= 1
                elif S[j] == 'B':
                    result += gcs[N - 1] - gcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'G':
                        result -= 1
        elif S[i] == 'G':
            for j in range(i + 1, N):
                if S[j] == 'G':
                    continue
                elif S[j] == 'R':
                    result += bcs[N - 1] - bcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'B':
                        result -= 1
                elif S[j] == 'B':
                    result += rcs[N - 1] - rcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'R':
                        result -= 1
        elif S[i] == 'B':
            for j in range(i + 1, N):
                if S[j] == 'B':
                    continue
                elif S[j] == 'R':
                    result += gcs[N - 1] - gcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'G':
                        result -= 1
                elif S[j] == 'G':
                    result += rcs[N - 1] - rcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'R':
                        result -= 1
    print(result)


main()
Problem p02711 (python)

Fixed submission:
n=input()
n=int(n)
og=n
flag=0
while(n>0):
    d=n%10
    n=n//10
    if(d==7):
        flag=flag+1
        
if(flag>0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=input()
n=int(n)
if(n%10==7):
  print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=input()
n=int(n)
if(n%10==7)
  print("Yes")
  else
    print("No")
Problem p03315 (python)

Fixed submission:
s=input()
c=0
for i in range(0,len(s)):
  if (s[i]=="+"):
    c=c+1
  else:
   c=c-1
print(c)

Buggy submission (verdict: Runtime Error):
s=input()
c=0
for i in range(0,len(s)):
  if (s[i]=="+"):
    c=c+1
  else:
   c=c-1
print(C)
Problem p03631 (python)

Fixed submission:
n=input()
n=int(n)
og=n
rev=0
while(n>0):
    d=n%10  
    n=n//10
    rev=rev*10+d
if(rev==og):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=input()
n=int(n)
og=n
rev=0
while(n>0):
    d=n%10
    n=n/10
    rev=rev+d
if(og==rev):
    print("Yes)
    else:
    print("No")
Problem p02879 (python)

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

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

Fixed submission:
n,k=map(int,input().split())
a = input()
 
a = list(a)
a[k - 1] = a[k-1].lower()
a = "".join(a)
print(a)

Buggy submission (verdict: Runtime Error):
S = int(input())
a = S % 100
b = (S- (S % 100))/100
if   b <= 12 and  a<=12 and a!=0 and b!= 0:
       print("AMBIGUOUS")
elif b <= 12 and a!=0 :
       print("MMYY")
elif a<=12 and a!=0  :
       print("YYMM")
else :
      print("NA")

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a = input()
 
a = list(a)
a[k - 1] = a[k-1].lower()
a = "".join(a)
print(a)
 
127
a,b = map(int, input().split(" "))
if a >= 13 :
  print(b)
elif a >= 6 :
  print(b//2)
else:
  print(0)

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

Fixed submission:
k = int(input())
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
  if i % k == 0:
    ans = 1
if ans == 1:
 	 print("OK")
else:
  	print("NG")

Buggy submission (verdict: Runtime Error):
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
  if i % k == 0:
    ans = 0
if ans == 0:
  print("OK")
else:
  print("NG")

Buggy submission (verdict: Runtime Error):
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
  if i % k == 0:
    ans = 0
if ans = 0:
  print("OK)
else:
  print("NG")
Problem p02711 (python)

Fixed submission:
a = int(input())
toprint = False
while a > 0 :
 last_digit = a % 10
 a = a // 10
 if last_digit == 7 :
   toprint = True
 
if toprint == True :
 print ("Yes")
else :
 print ("No")

Buggy submission (verdict: Runtime Error):
a = int(input())
toprint = False
while a > 0 :
 	last_digit = a % 10
 	a = a // 10
 	if last_digit == 7 :
   		toprint = True
 
	if toprint == True :
 		print ("Yes")
	else :
 		print ("No")

Buggy submission (verdict: Runtime Error):
a = int(input())
toprint = False
while N > 0 :
 	last_digit = a % 10
 		a = a // 10
	if last_digit == 7 :
   		toprint = True
 
	elif toprint == True :
 		print ("Yes")
	else :
 		print ("No")
Problem p02835 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a + b + c >= 22:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input())
if a + b + c >= 22:
  print('bust')
else:
  print('win')
Problem p03041 (python)

Fixed submission:
n,k=map(int,input().split())
s = input()
 
s = list(s)
s[k - 1] = s[k-1].lower()
s = "".join(s)
print(s)

Buggy submission (verdict: Runtime Error):
s = int(input())
a = s % 100
b = ((s-a) % 100)
if a <= 31 and b <= 12:
  print("YYMM")
elif a <= 12 and b <= 31:
  print("MMYY")
elif  a <= 12 and b <= 31 and a <= 31 and b <= 12:
  print("AMBIGUOUS")
else:
  print("NA")

Buggy submission (verdict: Runtime Error):
n,k=input().split()
s = input()
 
s = list(s)
s[k - 1] = s[k-1].lower()
s = "".join(s)
print(s)

Buggy submission (verdict: Runtime Error):
x = input().split(" ")
command = x[1]
N = x[0]
N += command.lower(x[1])
print(N)

Buggy submission (verdict: Runtime Error):
x = input().split(" ")
command = x[1]
N = x[0]
N = command.lower(x[1])
print(N)
Problem p02729 (python)

Fixed submission:
import math
def combi(n,r):
  ans = math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
  return ans

N, M = map(int,input().split())

ans = 0
if N > 1:
  ans += combi(N,2)
if M > 1:
  ans += combi(M,2)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def combi(n,r):
  ans = math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
  return ans

N, M = map(int,input().split())

ans = 0
if N != 0:
  ans += combi(N,2)
if M != 0:
  ans += combi(M,2)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def combi(n,r):
  ans = math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
  return ans

N, M = map(int,input().split())

ans = 0
if N != 0:
  ans += combi(M,2)
if M != 0:
  ans += combi(N,2)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def combi(n,r):
  ans = math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
  return ans

N, M = map(int,input().split())

ans = 0
ans += combi(M,2)
ans += combi(N,2)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def combi(n,r):
  ans = math.factorial(N) // (math.factorial(n-r) * math.factorial(r))
  return ans

N, M = map(int,input().split())

ans = 0
ans += combi(M,2)
ans += combi(N,2)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def combi(n,r):
  ans = math.factorial(N) // (math.factorial(n-r) * math.factorial(r))
  return ans

M = int(input())
N = int(input())

ans = 0
ans += combi(M,2)
ans += combi(N,2)
print(ans)
Problem p02777 (python)

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

if U == S:
  A -= 1
else:
  B -= 1

print(A, B)

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

if U == S:
  A -= 1
else:
  B -= 1

print(A, B)
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))

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

S[K+1] = S[K=1].lower()
print(''.join(S))
Problem p03075 (python)

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

if d > k:
  print(":(")
else:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
V = []
for i in range(5):
  V.append(int(input()))
               
k = int(input())
               
d = max(V) = min(V)

if d > k:
  print(":(")
else:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
v = []
for i in range(5):
  V.append(int(input()
               
k = int(input())
               
d = []
for i in range(1,5):
  d.append(V[i]-v[i-1])

if max(v) > k:
  print(":(")
else:
  print(("Yay!")
Problem p03242 (python)

Fixed submission:
S = list(input())
for i in range(3):
  if S[i] == '1':
  	S[i] = '9'
  elif S[i]== '9':
    S[i] = '1'
A = int(''.join(S))
print(A)

Buggy submission (verdict: Runtime Error):
S = list(input())
for n in S:
  if N == '1':
  	N = '9'
  elif N == '9':
    N = '1'
A = int(''.join(S))
print(A)
Problem p03327 (python)

Fixed submission:
n = int(input())
ans = ''
if n > 999:
  ans = "ABD"
else:
  ans = "ABC"
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = ''
if n > 999:
  ans = "ABD" + str(n-999).zfill(3)
else:
  ans = "ABC" + str(n).zfill(3)
print(ans
Problem p03317 (python)

Fixed submission:
from math import ceil
n,k = map(int,input().split(" "))


print(ceil((n - 1) / (k - 1)))

Buggy submission (verdict: Runtime Error):
from math import floor
n,k = input().split(" ")

print(floor((n - 1) / (k - 1)))
Problem p02693 (python)

Fixed submission:
k = int(input())
a,b = list(map(int,input().split()))
res = 0
for i in range(a,b+1):
  if(i%k==0):
    res=1
    break
if(res==1):
  print("OK")
else:
  print("NG")

Buggy submission (verdict: Runtime Error):
k = int(input())
a,b = list(map(int,input.split()))
res = 0
for i in range(a,b+1):
  if(i%k==0):
    res=1
    break
if(res==1):
  print("OK")
else:
  print("NG")
Problem p02836 (python)

Fixed submission:
S = input()

a = len(S) / 2
b = len(S) % 2
x = 0

if b == 0:
  for i in range(1, int(a+1)):
    if S[i-1]!=S[-i]:
      x += 1
else:
  for i in range(1, int(a+1)):
    if S[i-1]!=S[-i]:
      x += 1

print(x)

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

a = len(S) / 2
x = 0

if b == 0:
  for i in range(1, int(a+1)):
    if S[i-1]!=S[-i]:
      x += 1
else:
  for i in range(1, int(a+1)):
    if S[i-1]!=S[-i]:
      x += 1

print(x)
Problem p02659 (python)

Fixed submission:
def c():
    from decimal import Decimal
    import math
    a, b = map(str, input().split())
    print(int(math.floor(Decimal(a) * Decimal(b))))

if __name__ == "__main__":
    c()

Buggy submission (verdict: Runtime Error):
def cc():
    a, b = map(str, input().split())
    a2 = int(a)
    b2 = int(b.replace('.', ''))
    c = a2 * b2
    ans = str(c)[0:-2] if len(c) > 2 else 0
    print(ans)
if __name__ == "__main__":
    cc()

Buggy submission (verdict: Runtime Error):
def cc():
    a, b = map(str, input().split())
    a2 = int(a)
    b2 = int(b.replace('.', ''))
    c = a2 * b2
    print(str(c)[0:-2])

    if __name__ == "__main__":
    cc()