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

Fixed submission:
import fractions
def myAnswer(N:int,A:list) -> int:
   A.sort()
   pre = A.pop(0)
   ans = 10**10
   for a in A:
      ans = min(fractions.gcd(pre,a),ans)
      pre = a
   return ans

def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   print(myAnswer(N,A[:]))
if __name__ == '__main__':
   main()

Buggy submission (verdict: Runtime Error):
import fractions
def myAnswer(N:int,A:list) -> int:
   A.sort()
   target = A.pop(0)
   for a in A:
      if(fractions.gcd(A[0],A[1])==1):
         return 1
   return target

def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   print(myAnswer(N,A[:]))
if __name__ == '__main__':
   main()

Buggy submission (verdict: Runtime Error):
import math
def myAnswer(N:int,A:list) -> int:
   A.sort()
   return math.gcd(A[0],A[1])

def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   print(myAnswer(N,A[:]))
if __name__ == '__main__':
   main()
Problem p02685 (python)

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

p = 998244353

def comb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n-r)
    return fact[n] * factinv[r] * factinv[n-r] % p

fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]

for i in range(2, n+1):
    fact.append(fact[-1]*i%p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1]*inv[i])%p)
ans = 0

for i in range(k+1):
    row = comb(n-1, i, p)
    column = m * pow(m-1, n-i-1, p)
    ans += row * column
    
print(ans % p)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
color = [i for i in range(m)]
ans = 0
def dfs(i, daburi, num):
    global ans
    if i == n-1:
        if daburi == k:
            ans += num % 998244353
            return 
        elif daburi < k:
            ans += num % 998244353
            return
    if daburi > k:
        return
    dfs(i+1, daburi, num*(m-1))
    dfs(i+1, daburi+1, num)
dfs(0, 0, m)
print(ans% 998244353)
Problem p02695 (python)

Fixed submission:
import sys
n, m, q = map(int, input().split())
alis, blis, clis, dlis = [], [], [], []
for _ in range(q):
    a, b, c, d = map(int, input().split())
    alis.append(a)
    blis.append(b)
    clis.append(c)
    dlis.append(d)
sys.setrecursionlimit(10**9)
Alist = [] 
def dfs(A):
    if len(A)==(n+1):
        Alist.append(A)
        return
    for i in range(A[-1], m+1):
        dfs(A+[i])

dfs([1])

ans = 0
for A in Alist:
    score = 0
    for i in range(q):
        if A[blis[i]] - A[alis[i]] == clis[i]:
            score += dlis[i]
    ans = max(ans, score)

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
n, m, q = map(int, input().split())
alis, blis, clis, dlis = [], [], [], []
for _ in range(q):
    a, b, c, d = map(int, input().split())
    alis.append(a)
    blis.append(b)
    clis.append(c)
    dlis.append(d)
sys.setrecursionlimit(10**9)
Alist = [] 
def dfs(A):
    if len(A)==(n+1):
        Alist.append(A)
        return
    for i in range(A[-1], m+1):
        A.append(i)
        dfs(A)

dfs([1])

ans = 0
for A in Alist:
    score = 0
    for i in range(q):
        if A[blis[i]] - A[alis[i]] == clis[i]:
            score += dlis[i]
    ans = max(ans, score)

print(ans)
Problem p02820 (python)

Fixed submission:
n, k = map(int, input().split())
r, s, p = map(int, input().split())
d = {'r':r, 's':s, 'p':p}
t = input()
def janken(x):
    if x == 'r':
        return 'p'
    elif x == 's':
        return 'r'
    else:
        return 's'
l = ['']*k
for i in range(n):
    l[i%k] += t[i]
ans = 0
for i in l:
    pre = i[0]
    ans += d[janken(i[0])]
    for j in range(1, len(i)):
        if i[j] != pre:
            ans += d[janken(i[j])]
            pre = i[j]
        else:
            pre = ''
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
r, s, p = map(int, input().split())
d = {'r':r, 's':s, 'p':p}
t = input()
def janken(x):
    if x == 'r':
        return 'p'
    elif x == 's':
        return 'r'
    else:
        return 's'
l = ['']*k
for i in range(n):
    l[i%k] += t[i]
ans = 0
for i in l:
    dp = d(i[0]) + ['-1']*(len(i)-1)
    ans += d[janken(i[0])]
    for j in range(1, len(i)):
        if i[j] != i[j-1]:
            ans += d[janken(i[j])]
            dp[j] = d(i[j])
        else:
            dp[j] = d(i[j])
print(ans)
Problem p02881 (python)

Fixed submission:
n = int(input())
ans = float('inf')
for i in range(1, int(n**(1/2))+1):
    a, b = divmod(n, i)
    if b == 0:
        ans = min(ans, a+i-2)
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
import math
n = int(input())
lis1 = []
for i in range(n):
    lis1.append(list(map(int, input().split())))
S = 0
for i in list(itertools.permutations(range(n))):
    for j in range(n-1):
        S += math.sqrt((lis1[i[j]][0]-lis1[i[j+1]][0])**2 + (lis1[i[j]][1]-lis1[i[j+1]][1])**2)
for i in range(1, n+1):
    S = S / i
print(S)

Buggy submission (verdict: Runtime Error):
import itertools
import math
n = int(input())
lis1 = []
for i in range(n):
    lis1.append(list(map(int, input().split())))
S = 0
for i in list(itertools.permutations(range(n))):
#     print(i, type(i))
    for j in range(n-1):
#         print(lis1[i[j]][0], lis1[i[j+1]][0])
        S += math.sqrt((lis1[i[j]][0]-lis1[i[j+1]][0])**2 + (lis1[i[j]][1]-lis1[i[j+1]][1])**2)
for i in range(1, n+1):
    S = S / i
print(S)

Buggy submission (verdict: Runtime Error):
n = int(input())
lis = []
for i in range(n):
    lis.append(list(map(int, input().split())))
s = 0
for i in range(n):
    for j in range(i,n):
        s += ((lis[i][0] - lis[j][0])**2 + (lis[i][1] - lis[j][1])**2)**(1/2)
print(s*2/n)
Problem p03013 (python)

Fixed submission:
n, m = map(int, input().split())
alis = list(int(input()) for _ in range(m))
dp = [-1]*(n+1)
mod = 10**9 + 7
for i in alis:
    dp[i] = 0
dp[0] = 1
dp[1] = 1 if 1 not in alis else 0
for i in range(2,n+1):
    if dp[i] == -1:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print(dp[n])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
danger = list(int(input()) for _ in range(m))
danger = [0] + danger + [n]
def fibo(n):
    memo = [-1]*(n+1)
    def _fibo(n):
        if memo[n] != -1:
            return memo[n]
        else:
            if n <= 1:
                memo[n] = n
                return memo[n]
            else:
                memo[n] = _fibo(n-1) + _fibo(n-2)
                return memo[n]
    return _fibo(n)
ans = 1
for j in range(m+1):
    if danger[j+1] - danger[j] ==1:
        ans *= 0
    else:
        ans *= fibo(danger[j+1] - danger[j] )
print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
danger = list(int(input()) for _ in range(m))
danger = [0] + danger + [n]
def fibo(n):
    memo = [-1]*(n+1)
    def _fibo(n):
        if memo[n] != -1:
            return memo[n]
        else:
            if n <= 1:
                memo[n] = n
                return memo[n]
            else:
                memo[n] = _fibo(n-1) + _fibo(n-2)
                return memo[n]
    return _fibo(n)
ans = 1
for j in range(m+1):
    ans *= fibo(danger[j+1] - danger[j] )
print(ans)
Problem p02711 (python)

Fixed submission:
import sys

input = sys.stdin.readline

N = input().strip()

for i in range(3):
    if N[i] == '7':
        print('Yes')
        exit()
print('No')

Buggy submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline

N = input().split()

for i in range(3):
    if N[i] == '7':
        print('Yes')
        exit()
print('No')
Problem p02659 (python)

Fixed submission:
import math
a, b = input().split()
a = int(a)
b = int(round(float(b),3)*1000)

print((a*b)//1000)

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

if S>W:
  print("safe")
else:
  print("unsafe")
Problem p02773 (python)

Fixed submission:
import collections

N = int(input())

s = [input() for i in range(N)]

c = collections.Counter(s)
max_n = max(c.values())

ans = []
for key, val in c.items():
  if val == max_n:
    ans.append(key)
print("\n".join(sorted(list(set(ans)))))

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

list_val = list(set(L))
list_size = []
for i in list_val:
    list_size.append(L.count(i))

max_size = max(list_size)

ans = []
while max(list_size) == max_size:
    max_idx = list_size.index(max_size)
    ans.append(list_val[max_idx])
    list_size[max_idx] = 0
print("\n".join(sorted(ans))
Problem p03041 (python)

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

S[K-1] = chr(ord(S[K-1]) + 32)

print("".join(S))

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

S[K] -= 26

print(S)
Problem p03307 (python)

Fixed submission:
x = int(input())
 
if x%2 == 0:
  print(x)
else:
  print(x*2)

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

if x%2 == 0:
  print(x)
else:
  print(x*2)
Problem p03804 (python)

Fixed submission:
import numpy as np

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

As = np.array([["." for n in range(N)] for nn in range(N)])
for n in range(N):
  As[n,:] = np.array(list(input()))
  
Bs = np.array([["." for n in range(M)] for nn in range(M)])
for m in range(M):
  Bs[m,:] = np.array(list(input()))
  
ok = False
for i in range(N-M+1):
  for j in range(N-M+1):
    if (As[i:i+M,j:j+M] == Bs).all():
      ok = True
      break
if ok:
  print("Yes")
else:
  print("No")

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

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

As = np.array([["." for n in range(N)] for nn in range(N)])
for n in range(N):
  As[n,:] = np.array(list(input()))
  
Bs = np.array([["." for n in range(M)] for nn in range(M)])
for m in range(M):
  Bs[m,:] = np.array(list(input()))
  
ok = False
for i in range(N-M):
  for j in range(N-M):
    if (As[i:i+M,j:j+M] == Bs).all():
      ok = True
      break
if ok:
  print("Yes")
else:
  print("No")
Problem p03806 (python)

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

items = []
mas = []
mbs = []
costs = []
for i in range(N):
  ma, mb, c = map(int, input().split())
  mas.append(ma)
  mbs.append(mb)
  costs.append(c)

max_cost = 5000
dp = [[[max_cost for k in range((N+1)*10)] for j in range((N+1)*10)] for i in range(N+1)]
dp[0][0][0] = 0

for i in range(N):
  for j in range(N*10):
    for k in range(N*10):
      if dp[i][j][k] == max_cost:
        continue
      if dp[i+1][j][k] > dp[i][j][k]:
        dp[i+1][j][k] = dp[i][j][k]
      if dp[i+1][j+mas[i]][k+mbs[i]] > dp[i][j][k] + costs[i]:
        dp[i+1][j+mas[i]][k+mbs[i]] = dp[i][j][k] + costs[i]
        
min_cost = max_cost
for wa in range(1, N*10):
  for wb in range(1, N*10):
    if (wa * Mb != wb * Ma):
      continue;
    if min_cost > dp[N][wa][wb]:
      min_cost = dp[N][wa][wb]

  
if min_cost == max_cost:
  print("-1")
else:
  print(min_cost)

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

items = []
mas = []
mbs = []
costs = []
for i in range(N):
  ma, mb, c = map(int, input().split())
  mas.append(ma)
  mbs.append(mb)
  costs.append(c)

max_cost = 5000
dp = [[[max_cost for k in range(410)] for j in range(410)] for i in range(41)]

for i in range(N):
  for j in range(400):
    for k in range(400):
      if dp[i][j][k] == max_cost:
        continue
      if dp[i][j][k] > dp[i+1][j][k]:
        dp[i][j][k] = dp[i+1][j][k]
      if dp[i+1][j+mas[i]][k+mbs[i]] > dp[i][j][k] + costs[i]:
        dp[i+1][j+mas[i]][k+mbs[i]] = dp[i][j][k] + costs[i]
        
min_cost = 1000000000000000000
for (int wa = 1; wa < 400; ++wa) :
  for (int wb = 1; wb < 400; ++wb) :
    if (wa * mb != wb * ma):
      continue;
      if min_cost > dp[N][wa][wb]:
        min_cost = dp[N][wa][wb]

  
if min_cost == 1000000000000000000:
  print("-1")
else:
  print(min_cost)

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

N, Ma, Mb = map(int, input().split())

items = []
for i in range(N):
  items.append(list(map(int, input().split())))

items = np.array(items)

import itertools
l = list(itertools.product([False,True], repeat=N))

min_cost = 1000000000000000000
for comb in l[1:]:
  idx = np.where(comb)
  cost = items[idx,2].sum()
  if (items[idx,0].sum() == items[idx,1].sum()) & (cost < min_cost):
    min_cost = cost
print(int(min_cost))

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

N, Ma, Mb = map(int, input().split())

items = []
for i in range(N):
  items.append(list(map(int, input().split())))

items = np.array(items)

import itertools
l = list(itertools.product([False,True], repeat=N))

min_cost = 1000000000000000000
for comb in l[1:]:
  idx = np.where(comb)
  cost = items[idx,2].sum()
  if (items[idx,0].sum() == items[idx,1].sum()) & (cost < min_cost):
    min_cost = cost
print(min_cost)
Problem p02725 (python)

Fixed submission:
K,N = map(int,input().split())
A_list = list(map(int,input().split()))
A_list.append(K + A_list[0])
A_split = []
for i in range(N):
    A_split.append(A_list[i+1]-A_list[i])

A_split.pop(A_split.index(max(A_split)))
print(sum(A_split))

Buggy submission (verdict: Runtime Error):
K,N = map(int,input().split())
A_list = list(map(int,input().split())
A_list.append(K+A_list[0])
A_split = []
i for in range(N):
    split = A_list[i+1] - A_list[i]
    A_split.append(split)

A_split.pop(A_split.index(max(A_split)))
print(sum(A_split))
Problem p02753 (python)

Fixed submission:
S = input()
cnt = 0
for i in range(3):
  if S[i] == 'A':
    cnt = cnt +1
 
if cnt == 3 or cnt == 0:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
S = input()
cnt = 0
for i in len(S):
  if S[i] == 'A':
    cnt = cnt +1

if cnt == 3 or cnt == 0:
  print('No')
else:
  print('Yes')
Problem p02790 (python)

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

Buggy submission (verdict: Runtime Error):
a , b =input().split()
 
if a <= b:
	for i in b:
    print(a*int(b))
 
else:
	for v in a:
	print(b*int(a))

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

if a <= b:
	for i in b:
    print(a*int(b))
 
else:
	for v in a:
	print(b*int(a))

Buggy submission (verdict: Runtime Error):
a , b = map(int(),input().split())
 
X = ''
Y = ''
 
if a < b:
	for i in b:
		X = 'X' + 'a'
    print(X)
 
else:
	for v in a:
		Y = 'Y' + 'b'
	print(Y)

Buggy submission (verdict: Runtime Error):
a , b = map(int(),input().split())
 
X = 0
Y = 0
 
if a < b:
	for i in b:
		X = 'X' + 'a'
    print(X)
 
else:
	for v in a:
		Y = 'Y' + 'b'
	print(Y)

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

X = 0
Y = 0

if a < b:
	for i in b:
		X = 'X' + 'a'
    print(X)

else:
	for v in a:
		Y = 'Y' + 'b'
	print(Y)

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

for i in b:
  X = 'X' + 'a'
  
for v in a:
  Y = 'Y' + 'b'
  
if 'X' <= 'Y':
  print('X')
else:
  print('Y')

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

for i in b:
  X = 'X' + 'a'
  
for v in a:
  Y = 'Y' + 'b'
  
if 'X' < 'Y':
  print(X)
else:
  print(Y)

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

X = 0
Y = 0

list = [X,Y]

for i in b:
  X = X + 'a'
  
for v in a:
  Y = Y + 'b'
  
if 'X' < 'Y':
  print(X)
else:
  print(Y)
Problem p02792 (python)

Fixed submission:
N = int(input())
A =[[0]*10 for i in range(10)]
 
for i in range(1,N+1):
  a = int(str(i)[0])
  b = int(str(i)[-1])
  A[a][b] += 1
 
cnt = 0
for _ in range(1,N+1):
  a = int(str(_)[0])
  b = int(str(_)[-1])
  cnt += A[b][a]
  
print(cnt)

Buggy submission (verdict: Runtime Error):
from numpy import zeros

N = int(input())
A = zeros((10,10))

for i in range(1,N+1):
  s = int(str(i)[0])
  t = int(str(i)[-1])
  A[s][t] += 1

cnt = 0
for l in range(1,N+1)
  a = int(str(i)[0])
  b = int(str(i)[0])
  cnt += A[s][t]
  
print(cnt)
Problem p02711 (python)

Fixed submission:
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def lcm(x, y) : return (x * y) // math.gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")

N = input()

print("Yes" if "7" in N else "No")

Buggy submission (verdict: Runtime Error):
aaa
Problem p02881 (python)

Fixed submission:
import math

N = int(input())

sn = int(math.sqrt(N) // 1)
ans = N

for i in range(1, sn + 1):
  if N % i == 0:
    ans = min(ans, int(i + (N / i) - 2))

print(ans)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

sn = math.sqrt(N) // 1
a = 0

for i in range(1, sn + 1):
  if N % i == 0:
    a = i
    break

print(int(a + (N / a) - 2))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

sn = math.sqrt(N) // 1
a = 0

for i in range(1, sn + 1):
  if N % i == 0:
    a = i
    break

print(int(i + (N / i) - 2))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

sn = math.sqrt(N) // 1
i = 0

for i in range(1, sn + 1):
  if N % i == 0:
    break

print(int(i + (N / i) - 2))

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

sn = math.sqrt(N) // 1

while True:
  if N % sn == 0:
    break
  sn += 1

print(sn + (N / sn) - 2)

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

sn = math.sqrt(N)

while True:
  if N % sn == 0:
    break
  sn += 1

print(sn + (N / sn) - 2)
Problem p03127 (python)

Fixed submission:
# coding: utf-8

import sys
input = sys.stdin.readline

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

N = int(input())
A = list(map(int, input().split()))

first_gcd = A[0]
for i in range(len(A)):
    first_gcd = gcd(first_gcd, A[i])

print(first_gcd)

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import math
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))

first_gcd = A[0]
for i in range(len(A)):
    first_gcd = math.gcd(first_gcd, A[i])

print(first_gcd)

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import sys
input = sys.stdin.readline

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

def gccd(num):
    if len(num) == 1:
        return num[0]
    else:
        return gcd(gccd(num[0:1]), gccd(num[1:]))

N = int(input())
A = list(map(int, input().split()))

print(gccd(A))

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import sys
input = sys.stdin.readline

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

def gccd(num):
    if len(num) == 1:
        return num[0]
    else:
        return gcd(gccd(num[0:1]), gccd(num[1:]))

N = int(input())
A = list(map(int, input().split()))

print(gccd(A))

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import math
import sys
input = sys.stdin.readline

def gccd(num):
    if len(num) == 1:
        return num[0]
    else:
        return math.gcd(gccd(num[0:1]), gccd(num[1:]))

N = int(input())
A = list(map(int, input().split()))

print(gccd(A))

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import math
import sys
input = sys.stdin.readline

def gcd(num):
    if len(num) == 1:
        return num[0]
    else:
        return math.gcd(gcd(num[0:1]), gcd(num[1:]))

N = int(input())
A = list(map(int, input().split()))

print(gcd(A))

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import math
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))

def gcd(num):
    if len(num) == 1:
        return num[0]
    else:
        return math.gcd(gcd(num[0:1]), gcd(num[1:]))

print(gcd(A))

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import sys
input = sys.stdin.readline

import math

N = int(input())
A = list(map(int, input().split()))

def gcd(num):
    if len(num) == 1:
        return num[0]
    else:
        return math.gcd(gcd(num[0:1]), gcd(num[1:]))

print(gcd(A))

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import sys
input = sys.stdin.readline

import math
from functools import reduce

N = int(input())
A = list(map(int, input().split()))

print(reduce(math.gcd, A))
Problem p02659 (python)

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

Buggy submission (verdict: Runtime Error):
import math
list = map(input().split())
ans = float(list[1])*int(list[0])
print(math.floor(ans))

Buggy submission (verdict: Runtime Error):
import math
a = list(map(input().split()))
ans = float(a[1])*int(a[0])
print(math.floor(ans))
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()
c=int(a)
d=float(b)
print(int(a*b))
Problem p02773 (python)

Fixed submission:
x=int(input())
List=[input() for i in range (x)]
List=sorted(List)
sum=-1
count=1
ans=[]
for i in range (x-1):
    if List[i] == List[i+1]:
        count+=1
    elif sum>count:
        count=1
    elif sum==count:
        count=1
        ans+=[List[i]]
    else:
        sum=count
        count=1
        ans=[]
        ans+=[List[i]]
if sum==count:
    ans+=[List[-1]]
elif sum<count:
        sum=count
        count=1
        ans=[]
        ans+=[List[i]]
ans=sorted(ans)
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
x=int(input())
List=[int(input()) for i in range (x)]
sorted(List)
print(List)
Problem p02831 (python)

Fixed submission:
a,b=map(int,input().split())
i=min(a,b)
j=max(a,b)
while not(i==0) and not(j==0):
  x=i
  i=j%i
  j=x
print(int(a*b/j))

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

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
s=sum(a,b,c)
if s>=22:
  print("bust")
else:
  print("win")
Problem p02847 (python)

Fixed submission:
a=input()
if a=="SUN":
  print(7)
if a=="MON":
  print(6)
if a=="TUE":
  print(5)
if a=="WED":
  print(4)
if a=="THU":
  print(3)
if a=="FRI":
  print(2)
if a=="SAT":
  print(1)

Buggy submission (verdict: Runtime Error):
a=input()
if a=="SUN":
  print(7)
if a=="MON":
  print(6)
if a=="TUE":
  print(5)
if a=="WED":
  print(4)
if a=="THU":
  print(3)
if a=="FRI":
  print(2)
if a=="SAT"
  print(1)

Buggy submission (verdict: Runtime Error):
a=input()
if a==SUN:
  print(7)
if a==MON:
  print(6)
if a==TUE:
  print(5)
if a==WED:
  print(4)
if a==THU:
  print(3)
if a==FRI:
  print(2)
if a==SAT
  print(1)
Problem p03242 (python)

Fixed submission:
s = input()
print(s.replace("9","c").replace("1","9").replace("c","1"))

Buggy submission (verdict: Runtime Error):
s = input()
print(s.replace("9","c").replace("1","9").replace("c"."1"))
Problem p03327 (python)

Fixed submission:
n = int(input())
print("ABC" if n<1000 else "ABD")

Buggy submission (verdict: Runtime Error):
int n = input()
print("ABC" if n < 1000 else "ABD")