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

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

sum = 0.0
for x in a:
  sum = sum + 1 / x

print(1/sum)

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

sum = 0.0
for x in n:
  sum = sum + 1/x

print(1/sum)
Problem p02952 (python)

Fixed submission:
n=int(input())
 
count=0
 
if n == 100000:
  count+=90909

if 10000 <= n and n < 100000:
  m=n-9999
  count+=m
  count+=909

if 1000 <= n and n < 10000:
  count+=909

if 100 <=n and n < 1000:
  l=n-99
  count+=l
  count+=9

if 10 <= n and n < 100:
  count +=9

if n < 10:
  count+=n

print(count)

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

count_1=9
count_3=900
count_5=90000

count=0

if n = 100000:
  count+=90909

if 10000 <= n and n < 100000:
  m=n-9999
  count+=m
  count+=909

if 1000 <= n and n < 10000:
  count+=909

if 100 <=n and n < 1000:
  l=n-99
  count+=l
  count+=9

if 10 <= n and n < 100:
  count +=9

if n < 10:
  count+=n

print(count)
Problem p03145 (python)

Fixed submission:
l = list(map(int, input().split()))
l.sort()
l.reverse()
l.pop(0)
print(l[0]*l[1]//2)

Buggy submission (verdict: Runtime Error):
l = list(map(int, input().split))
l.sort()
l.reverse()
l.pop(0)
print(l[0]*l[1]/2)
Problem p03282 (python)

Fixed submission:
n=list(input())
k=int(input())
if len(n)==1 and n[0]=='1':
  print('1')
else:
  one_list=[]
  while len(n)!=0:
    if n[0]=='1':
      one_list.append(n.pop(0))
    else:
      break
  if k<=len(one_list):
    print('1')
  else:
    print(n[0])

Buggy submission (verdict: Runtime Error):
n=list(input())
k=int(input())
if len(n)==1:
  print('1')
else:
  one_list=[]
  while len(n)!=0:
    if n[0]=='1':
      one_list.append(n.pop(0))
    else:
      break
  if 0<len(one_list)<=k:
    print('1')
  else:
    print(n[0])

Buggy submission (verdict: Runtime Error):
n=list(input())
k=int(input())
if len(n)==1:
  print('1')
else:
  one_list=[]
  while len(n)!=0:
    if n[0]=='1':
      one_list.pop(n.pop(0))
    else:
      break
  if 0<len(one_list)<=k:
    print('1')
  else:
    print(n[0])

Buggy submission (verdict: Runtime Error):
n=list(input())
k=int(input())
if len(n)==1:
  print('1')
else:
  one_list=[]
  while 1==1:
    if n[0]=='1':
      one_list.pop(n.pop(0))
    else:
      break
  if 0<len(one_list)<=k:
    print('1')
  else:
    print(n[0])

Buggy submission (verdict: Runtime Error):
n=list(input())
k=int(input())
if n[0]=='1':
  print(n[1])
else:
  print(n[0])
Problem p02934 (python)

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

x = []
for i in range(len(A)):
    x.append(1/A[i])
    bunbo = sum(x)
print(1 / bunbo)

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

x = []
for i in range(A):
    x.append(1/A[i])
    bunbo = sum(x)
print(1 / bunbo)

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

x = []
for i in range(A):
    x.append(1/A[i])
    bunbo = sum(x)
print(1 / bunbo)
Problem p02945 (python)

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

x = a + b
y = a - b
z = a * b
print(max(x, y, z))

Buggy submission (verdict: Runtime Error):

k, x = map(int, input().split())

axis = list(range(-10, 11, 1))
df = pd.DataFrame(axis)
df = df.rename(columns = {0 : 'var'})

res = []

if k == 1:
    print(x)
else:
    for i in range(1, k):

        a = df[df['var'] == x + i]
        a = list(a['var'])
        res.append(a)
        
        a = df[df['var'] == x - i]
        a = list(a['var'])
        res.append(a)
    res.append([x])
    res = sum(res, []) #リスト一段解除
    res = sorted(res) #並び替え
    print(*res)

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

x = a + b
y = a - b
z = a * b
m = max(x, y, z)

print('A + B =', str(x), 'A - B =', str(y), 'A ×　B =', str(z), 'の中で最大の数は', str(m), 'です。')

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

x = a + b
y = a - b
z = a * b

print(max(x, y, z))
Problem p02946 (python)

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

res = []
if k == 1:
    print(x)
else:
    for i in range(1, k):
        res.append(x + i)
    for i in range(1, k):
        res.append(x - i)
    res.append(x)
    res = sorted(res)
    print(*res)

Buggy submission (verdict: Runtime Error):
import pandas as pd

k, x = map(int, input().split())

axis = list(range(-1000000, 1000001, 1))
df = pd.DataFrame(axis)
df = df.rename(columns = {0 : 'var'})

res = []

if k == 1:
    print(x)
else:
    for i in range(1, k):

        a = df[df['var'] == x + i]
        a = list(a['var'])
        res.append(a)
        
        a = df[df['var'] == x - i]
        a = list(a['var'])
        res.append(a)
    res.append([x])
    res = sum(res, []) #リスト一段解除
    res = sorted(res) #並び替え
    print(*res)

Buggy submission (verdict: Runtime Error):
import pandas as pd

k, x = map(int, input().split())

axis = list(range(-10, 11, 1))
df = pd.DataFrame(axis)
df = df.rename(columns = {0 : 'var'})

res = []

if k == 1:
    print(x)
else:
    for i in range(1, k):

        a = df[df['var'] == x + i]
        a = list(a['var'])
        res.append(a)
        
        a = df[df['var'] == x - i]
        a = list(a['var'])
        res.append(a)
    res.append([x])
    res = sum(res, []) #リスト一段解除
    res = sorted(res) #並び替え
    print(*res)

Buggy submission (verdict: Runtime Error):

k, x = map(int, input().split())

axis = list(range(-10, 11, 1))
df = pd.DataFrame(axis)
df = df.rename(columns = {0 : 'var'})

res = []

if k == 1:
    print(x)
else:
    for i in range(1, k):

        a = df[df['var'] == x + i]
        a = list(a['var'])
        res.append(a)
        
        a = df[df['var'] == x - i]
        a = list(a['var'])
        res.append(a)
    res.append([x])
    res = sum(res, []) #リスト一段解除
    res = sorted(res) #並び替え
    print(*res)

Buggy submission (verdict: Runtime Error):
import pandas as pd

k, x = map(int, input().split())

axis = list(range(-10, 11, 1))
df = pd.DataFrame(axis)
df = df.rename(columns = {0 : 'var'})

res = []

if k == 1:
    print(x)
else:
    for i in range(1, k):

        a = df[df['var'] == x + i]
        a = list(a['var'])
        res.append(a)
        
        a = df[df['var'] == x - i]
        a = list(a['var'])
        res.append(a)
    res.append([x])
    res = sum(res, []) #リスト一段解除
    res = sorted(res) #並び替え
    print(*res)
Problem p02957 (python)

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

k = (a + b) / 2
if k == int(k):
    print(int(k))
else:
    print("IMPOSSIBLE")

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

swap = 0
done = False
ok = True
for i in range(n):
    p = next(ps)
    if p != i+1:
        if done:
            ok = False
            break
        elif swap != 0:
            if swap == i+1:
                done = True
                swap = 0
            else:
                ok = False
                break
        else:
            swap = p

if ok:
    print("YES")
else:
    print("NO")
Problem p02927 (python)

Fixed submission:
M,D = map(int,input().split())
D_array = list(map(int, str(D)))

ans = 0
for i in range(2,M+1):
  for d10 in range(2,int(D_array[0])+1):
    for d1 in range(2,10):
      if int(str(d10)+str(d1)) <= D:
        if int(d1)*int(d10) == i:
          ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
M = int(input())
D = int(input())
D_array = list(map(int, str(D)))

ans = 0
for i in range(2,M+1):
  for d10 in range(2,int(D_array[0])+1):
    for d1 in range(2,10):
      if int(str(d10)+str(d1)) <= D:
        if int(d1)*int(d10) == i:
          ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
M = int(imput())
D = int(imput())
D_array = list(map(int, str(D)))

ans = 0
for i in range(2,M+1):
  for d10 in range(2,int(D_array[0])+1):
    for d1 in range(2,10):
      if int(str(d10)+str(d1)) <= D:
        if int(d1)*int(d10) == i:
          ans += 1
print(ans)
Problem p02945 (python)

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

print (max([a+b, a-b, a*b]))

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

print (max([a+b, a-b, a*b]))

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

print (max(a+b, a-b, a*b))
Problem p03369 (python)

Fixed submission:
s = input()

print(s.count("o")*100+700)

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

sum = 700

for i in s:
  if i == o:
    sum += 100
  
  else:
    sum += 0
    
print (sum)
Problem p03455 (python)

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

if c % 2 == 0:
    print("Even")
else:
    print("Odd")

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

if c%2 == 0:
  print ("Even")
else:
  print ("Odd")

Buggy submission (verdict: Runtime Error):
a, b= int(input())
c = a*b

if c%2 == 0:
  print ("Even")
else:
  print ("Odd")

Buggy submission (verdict: Runtime Error):
a = int(input(a))
b = int(input(b))
c = a*b

if c%2 == 0:
  print ("Even")
else:
  print ("Odd")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = a*b

if c%2 == 0:
  print ("Even")
else:
  print ("Odd")
Problem p03494 (python)

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

ans = 0
while all(i%2 == 0 for i in A):
  A = [i/2 for i in A]
  ans += 1

print (ans)

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

ans = 0
while all(i%2 == 0 for i in A):
  A = [i/2 for i in A]
  ans += 1

print (ans)

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

for i in A:
  if A%2 == 0:
    a += 1
  else:
    brake:
      print a
Problem p03563 (python)

Fixed submission:
R = int(input())
G = int(input())

x = 2*G-R
print (x)

Buggy submission (verdict: Runtime Error):
now_Rating = int(input(R))
average = int(input(G))

x = 2*average-now_Rating

prtint(x)
Problem p03071 (python)

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

if abs(A-B)>=2:
  if A-B>0:
    ans=2*A-1
  else:
    ans=2*B-1
else:
  ans=A+B
print(ans)

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

if abs(A-B)=>2:
  if A-B>0:
    ans=2*A-1
  else:
    ans=2*B-1
else:
  ans=A+B
print(ans)
Problem p02947 (python)

Fixed submission:
N = int(input())
count = 0
DIC = {}
for i in range(N):
    j = ''.join(sorted(input()))
    if j in DIC:
        count += DIC[j]
        DIC[j] += 1
    else:
        DIC[j] = 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
DIC = {}
for i in range(n):
    j = ''.join(sorted(input()))
    if j in DIC:
        count += DIC[j]
        DIC[j] += 1
    else:
        DIC[j] = 1
print(count)
Problem p02958 (python)

Fixed submission:
N = int(input())
X = [int(i) for i in input().split()]
count = 0
for i in range(N):
    if X[i] != i+1:
        count+=1
if count <= 2:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
X = [int(i) for i in input().split(' ')]
count = 0
for i in range(N):
    if X[i]! = i+1:
        count+=1
if count <= 2:
    print("YES")
else:
    print("NO")
Problem p02983 (python)

Fixed submission:
L,R = map(int,input().split(' '))
MIN = 2019
if R - L >= 2019:
  print(0)
else:
  for i in range(L,R):
    for j in range(i+1,R+1):
      A = i * j
      MIN = min(A%2019,MIN)
  print(MIN)

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split(' '))
if R - L >= 2019:
  print(0)
else:
  MIN = flaot('inf')
  for i in range(L,R):
    for j in range(i,R+1):
      MIN = min(MIN,(j-i) % 2019)
print(MIN)
Problem p03035 (python)

Fixed submission:
A,B = map(int,input().split(' '))
if A >= 13:
  print(B)
elif 6 <= A < 13:
  print(int(B/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split(' '))
left = float('-inf')
right = float('inf')
for i in range(M):
  L,R = map(int,input().split(' '))
  if left <= L:
    left = L
  if R <= right:
    right = R
  if (right - left) < 0:
    print(0)
    exit()
print(right-left+1)
Problem p03076 (python)

Fixed submission:
N = sorted([(input())for i in range(5)],key=lambda x:x[-1])
S = list(map(int,N))
#合計時間
num = 0
key = 0
for x in S:
  if x % 10 == 0:
    num += x
  elif key == 0 and x % 10 != 0:
    num += x 
    key = 1
  else:
    num += x + 10 - int(str(x)[-1])
print(num)

Buggy submission (verdict: Runtime Error):
import math
S = [input() for i in range(5)]
#合計時間
num = 0
#ポイント
point = int(S[0])
for i in range(1,5):
  if point[-1] == 0:
    num += point
    point = S[i]
  else:
    if point[-1] > int(S[i][-1]):
      num += point + 10 - point[-1]
      point = S[i]
    else:
      num += int(S[i]) +10 - intS[i][-1]
   
    
num += point

print(num)
Problem p03101 (python)

Fixed submission:
H,W = map(int, input().split(' '))
h,w = map(int, input().split(' '))
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
H,W = map(int, input().split(','))
h,w = map(int, input().split(','))
print((H-h)*(W-w))
Problem p03105 (python)

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


def calc1(A,B,C):
  if A*C <= B:
    return C
  else:
    #回数
    N = 0
    while A*N <=B:
      N += 1
    return N-1
print(calc1(A,B,C))

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


def calc1(A,B,C):
  if A*C <= B:
    return C
  else:
    #回数
    N = 0
    while A*N <=B:
      N += 1
    return N-1
print(calc1(A,
Problem p03106 (python)

Fixed submission:
A,B,K = map(int,input().split(' '))
# 与えられた整数の約数を返す
def func_divisors(x):
  divisors = []
  for i in range(1,int(x**0.5)+1):
    if x % i == 0:
      divisors.append(i)
      if i != x / i:
        divisors.append(int(x/i))
        
  divisors.sort()
  return divisors
  
A_divisors = func_divisors(A)
B_divisors = func_divisors(B)
C_divisors = sorted(list(set(A_divisors) & set(B_divisors)),reverse=True)

print(C_divisors[K-1])

Buggy submission (verdict: Runtime Error):
# 与えられた整数の約数を返す
def func_divisors(x):
  divisors = []
  for i in range(1,int(x**0.5)+1):
    if x % i == 0:
      divisors.append(i)
      if i != x / i:
        divisors.append(int(x/i))
        
  divisors.sort()
  return divisors
  
A_divisors = func_divisors(A)
B_divisors = func_divisors(B)
C_divisors = list(set(A_divisors) & set(B_divisors))

print(C_divisors[K-1])
Problem p03111 (python)

Fixed submission:
N, A, B, C = map(int, input().split(' '))
L = [int(input()) for i in range(N)]
# 上限
MAX = 10 ** 9
#再帰関数
def dfs(cur, a, b, c):
  if cur == N:
    return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else MAX
  ret0 = dfs(cur + 1, a, b, c)
  ret1 = dfs(cur + 1, a + L[cur], b, c) + 10
  ret2 = dfs(cur + 1, a, b + L[cur], c) + 10
  ret3 = dfs(cur + 1, a, b, c + L[cur]) + 10
  return min(ret0,ret1,ret2,ret3)
print(dfs(0, 0, 0, 0))

Buggy submission (verdict: Runtime Error):
N, A, B, C = map(int, input().split(' '))
L = [int(input()) for i in range(N)]
# 上限
MAX = 10 ** 9
#再帰関数
def dfs(cur, a, b, c):
  if cur == N:
    return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else MAX
  ret0 = dfs(cur + 1, a, b, c)
  ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
  ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
  ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
  print(ret0,ret1,ret2,ret3)
  return min(ret0,ret1,ret2,ret3)
print(dfs(0, 0, 0, 0))
Problem p03125 (python)

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

if B % A == 0:
  print(B+A)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
import heapq

N = int(input())
A = list(map(int,input().split(' ')))
A_min = heapq.nsmallest(2,A)
X= A_min[0]
Y = A_min[1]

while X > 0 and Y > 0:
  if X <= Y:
    Y -= X
  else:
    X -= Y
print(max(X,Y))
Problem p03161 (python)

Fixed submission:
import numpy as np
N,K = map(int,input().split())
H = np.array(list(map(int,input().split())))
dp = np.zeros(N,dtype=int)

for i in range(1,N):
  x = max(0,i-K)
  dp[i] = np.min(dp[x:i] + abs(H[x:i] - H[i]))

print(dp[-1])

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split(' '))
H = list(map(int,input().split(' ')))
dp = [0]*N

for i in range(1,N):
  x = max(0.i-K)
  dp[i] = min([dp[j] + abs(H[i] - H[j]) for j in range(x,i)])
  
print(dp[-1])
Problem p03163 (python)

Fixed submission:
def DP():
    n,W = map(int, input().split(' '))
    WV = (map(int, input().split(' ')) for _ in range(n))
    dp = [0] * (W+1)

    for w, v in WV:
        for j in range(W, w-1, -1):
            DP = dp[j-w] + v
            if dp[j] < DP:
                dp[j] = DP
    return max(dp)
print(DP())

Buggy submission (verdict: Runtime Error):
def DP():
    n,w = map(int, input().split(' '))
    WV = (map(int, input().split(' ')) for _ in range(n))
    dp = [0] * (W+1)

    for w, v in WV:
        for j in range(W, w-1, -1):
            DP = dp[j-w] + v
            if dp[j] < DP:
                dp[j] = DP
    return max(dp)
print(DP())
Problem p03211 (python)

Fixed submission:
#主人の大好きな数字
fav = 753
listA = list(input())
N = len(listA)
#ダックスフンドの選ぶ数字
s = 0

for i in range(0,N-2):
  a,b,c = map(str,listA[i:i+3])
  x = a+b+c
  if abs(fav-s) > abs(fav-int(x)):
    s = int(a+b+c)
print(abs(fav-s))

Buggy submission (verdict: Runtime Error):
#主人の大好きな数字
fav = 753
listA = list(input())
N = len(listA)
#ダックスフンドの選ぶ数字
s = 0

for i in range(0,N-2):
  a,b,c = map(str,listA[i:i+3])
  x = a+b+c
  if abs(fav-s) > abs(fav-int(x)):
    s = int(a+b+c)
print(abs(fav-s)
Problem p03238 (python)

Fixed submission:
N = int(input())
 
if N == 1:
  print('Hello World')
else:
  A = int(input())
  B = int(input())
  print(A + B)

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

if N == 1:
  print('Hello World')
else:
  A,B = map(int,input().split(' '))
  print(A + B)
Problem p03244 (python)

Fixed submission:
from collections import Counter
N = int(input())
V = input().split(' ')
V_even = V[1::2]
V_odd = V[0::2]
#偶数列の要素を数え上げ
V_even_Count = Counter(V_even)
#奇数列の数え上げ
V_odd_Count = Counter(V_odd)

#偶数列の格納
X = []
for x in V_even_Count.most_common(2):
  X.append(x)
if len(X) == 1:
  X.append(('i',0))
#奇数列の格納
Y = []
for y in V_odd_Count.most_common(2):
  Y.append(y)
if len(Y) == 1:
  Y.append(('j',0))

A,B,C,D = X[0],X[1],Y[0],Y[1]
if A[0] != C[0]:
  print(N-A[1]-C[1])
else:
  if B[1] <= D[1]:
    print(N-A[1]-D[1])
  else:
    print(N-B[1]-C[1])

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
V = input().split(' ')

EVEN = V[0::2]
ODD = V[1::2]
EVEN_V = collections.Counter(EVEN)
ODD_V = collections.Counter(ODD)
Count_EVEN_V = EVEN_V.most_common()
Count_ODD_V =ODD_V.most_common()


if Count_EVEN_V[0][1] >= Count_ODD_V[0][1]:
  MAX_ELE = Count_EVEN_V[0][0]
  count_max = Count_EVEN_V[0][1]
  for i in range(int(N/2)):
    if MAX_ELE != Count_ODD_V[i][1]:
      SECOND_ELE = Count_ODD_V[i][0]
      count_SEC = Count_ODD_V[i][1]
      break
    else:
      pass
  
else:
  MAX_ELE = Count_ODD_V[0][0]
  count_max = Count_ODD_V[0][1]
  for i in range(N/2):
    if MAX_ELE != Count_EVEN_V[i][1]:
      SECOND_ELE = Count_EVEN_V[i][0]
      count_SEC = ount_EVEN_V[i][1]
      break
    else:
      pass
print((N- int(count_max) - int(count_SEC)))
Problem p03280 (python)

Fixed submission:
A, B = map(int,input().split(' '))
print((A-1) * (B-1))

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
if all(S[x] == '1' for x in range(K)):
  print(1)
  exit()
else:
  for i in S:
    if i != '1':
      print(i)
      exit()

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
if all(S[x] == '1' for x in range(K)):
  print(1)
  exit()
else:
  for i in S:
    if i != '1':
      print(i)
      exit()

Buggy submission (verdict: Runtime Error):
A B = map(int,input().split(' '))
print((A-1) * (B-1))
Problem p03289 (python)

Fixed submission:
S = input()
lead = S[0]
sub = S[2:-1]
C = sub.count('C')
if lead == 'A' and C == 1:
  for x in range(1,len(S)):
    if S[x].islower() or S[x] == 'C':
      pass
    else:
      print('WA')
      exit()
  print('AC')
else:
  print('WA')

Buggy submission (verdict: Runtime Error):
S = input()
lead = S[0]
sub = S[2:-1]
C = sub.count('C')
if lead == 'A' and C == 1:
  for x,i in enumerate(1,len(S)):
    if i =='C' and ( 2<= x < len(S)-2):
      pass
    else:
      if i.islower():
        pass
      else:
        print('WA')
        exit()
  print('AC')
  exit()
else:
  print('WA')
Problem p03311 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split(' ')))
num = 0
X = []
for i,j in enumerate(A):
  B = j-(i+1)
  X.append(B)
X.sort()
median = 0
if N % 2 == 0:
  median = (X[int(N/2)] + X[int(N/2-1)])/2
else:
  median = X[int((N-1)/2)] 

for x in X:
  num += abs(x-median)
print(int(num))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split(' ')))
num = 0
X = []
for i,j in enumerate(A):
  B = j-(i+1)
  X.append(B)
X.sort()
median = 0
if N % 2 == 0:
  median = (X[N/2] + X[N/2-1])/2
else:
  median = X[int((N-1)/2)] 

for x in X:
  num += abs(x-median)
print(num)
Problem p03352 (python)

Fixed submission:
import math
X = int(input())
answer = 0
for i in range(1,math.ceil(X**0.5)+1):
  for j in range(2,11):
    if i**j <= X:
      answer = max(i**j,answer)

print(answer)

Buggy submission (verdict: Runtime Error):
import math
X = int(input())
answer = 0

for i in range(2,math.floor(X)):
  for j in range(2,11):
    if i**J <= X:
      answer = max(answer,i**j)
      
print(answer)
Problem p03360 (python)

Fixed submission:
A,B,C = map(int,input().split(' '))
K = int(input())
x = max(A,B,C)
y = x*(1-2**K)/(1-2)
print(int(A+B+C+y))

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

for i in range(K):
  max = max(A,B,C)
  max *= 2
print(A+B+C)
Problem p03369 (python)

Fixed submission:
S = input()

topping = S.count('o')

print(700 + int(topping)*100)

Buggy submission (verdict: Runtime Error):
A,B,C,X,Y = map(int,input().split(' '))
MIN = float('inf')

for i in range(10**5):
  sum = C*2*i + max(0,X-i)*A + max(0,Y-i)*B
  MIN = min(MIN,sum)
print(MIN)
Problem p03385 (python)

Fixed submission:
S = input()
A = S.count('a')
B = S.count('b')
C = S.count('c')
if A == B == C == 1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = input()
A = S.count('a')
B = S.count('b')
C = S.count('c')
if a == b == c == 1:
  print('Yes')
else
:
  print('No')
Problem p03416 (python)

Fixed submission:
A,B = map(int,input().split(' '))
num = 0
for x in range(A,B+1):
  if str(x) == str(x)[::-1]:
    num += 1
print(num)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split(' '))
num = 0
for str(x) in range(A,B+1):
  if str(x) == str(x)[::-1]:
    num += 1
print(num)
Problem p03434 (python)

Fixed submission:
N = int(input())
A = sorted(list(map(int,input().split(' '))),reverse=True)
alice = A[0::2]
bob = A[1::2]
print(sum(alice) - sum(bob))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = sorted(list(map(int,input().split(' '))),reverse=True)
alice = A[0::2]
bob = A[1::2]
print(num(alice) - num(bob))
Problem p03448 (python)

Fixed submission:
import itertools
A = int(input())
B = int(input())
C = int(input())
X = int(input())
AL = [500*i for i in range(A+1)]
BL = [100*i for i in range(B+1)]
CL = [50*i for i in range(C+1)]
num = 0

for comb in itertools.product(AL,BL,CL):
  x,y,z = comb
  if x + y + z == X:
    num += 1
print(num)

Buggy submission (verdict: Runtime Error):
import itertools
A = int(input())
B = int(input())
C = int(input())
AL = [500*i for i in range(A)]
BL = [100*i for i in range(B)]
CL = [50*i for i in range(C)]
num = 0

for comb in itertools.product(AL,BL,CL):
  x,y,z = comb
  if x+y+z == X:
    num += 1
print(num)
Problem p03449 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split(' ')))
B=list(map(int,input().split(' ')))
ans=0
for i in range(N):
  z = sum(A[:i+1]+B[i:])
  ans=max(ans,z)
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split(' ')))
B=list(map(int,input().split(' ')))
ans=0
for i in range(N):
  A = sum(A[:i+1]+B[i:])
  ans=max(ans,B)
print(ans)