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

Fixed submission:
A, B = map(int, input().split())
if A+B < 24:
   print(A+B)
else:
    print(A+B-24)

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

ab_list = []
cd_list = []

for i in range(N):
    ab = list(map(int, input().split()))
    ab_list.append(ab)

for i in range(M):
    cd = list(map(int, input().split()))
    cd_list.append(cd)

for a, b in ab_list:
    num = -1
    min_num = 10 ** 10 + 1
    count = 0
    for c, d in cd_list:
        count += 1
        distance = abs(a-c) + abs(b-d)
        if distance < min_num:
            min_num = distance
            num = count
    print(num)
Problem p03846 (python)

Fixed submission:
n = int(input())
a_list = list(map(int, input().split()))
zero = a_list.count(0)
D = 1000000000 + 7
a_set = set(a_list)
if zero == 1 and n - 1 == 2 * (len(a_set)-1):
    print(2 ** ((n-1)//2) % D)
elif zero == 0 and n == 2 * len(a_set):
    print(2 ** (n//2) % D)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int, input().split()))
zero = a_list.count(0)
D = 1000000000 + 7
a_set = set(a_list)
if zero == 1 and n -1 == 2 * a_set:
    print(2 ** ((n-1)//2) % D)
elif zero == 0 and n == 2 * a_set:
    print(2 ** (n//2) % D)
else:
    print(0)
Problem p03938 (python)

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

r = {}
for i in range(N):
    r[p_list[i]] = i + 1

a_list = []
b_list = []
for i in range(1, N + 1):
    a_list.append(30000 * i)
    b_list.append(30000 * (N - i) + r[i])

print(*a_list)
print(*b_list)

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

r = {}
for i in range(N):
    r[p_list[i]] = i + 1

a_list = []
b_list = []

for i in range(1, N + 1):
    a_list.append(30000 * i)
    b_list.append(30000 * (N - i) + r[i - 1])

print(*a_list)
print(*b_list)
Problem p04006 (python)

Fixed submission:
N, x = map(int, input().split())
a_list = list(map(int, input().split()))
ex_list = a_list.copy()
ex_list.extend(a_list)

ans = float("inf")
cost_list = [float("inf") for _ in range(N)]
for i in range(N):
    cost = 0
    for j in range(N):
        if i == 0:
            cost += ex_list[N + j]
            cost_list[j] = ex_list[N + j]
        else:
            tmp = cost_list[j]
            if tmp > ex_list[N - i + j]:
                cost_list[j] = ex_list[N - i + j]
                cost += ex_list[N - i + j]
            else:
                cost += tmp

    cost += x * i
    ans = min(ans, cost)
print(ans)

Buggy submission (verdict: Runtime Error):
N, x = map(int, input().split())
a_list = list(map(int, input().split()))
ex_list = a_list.copy()
ex_list.extend(a_list)

ans = float("inf")
for i in range(N):
    cost = 0
    for j in range(N):
        cost += min(ex_list[N-i+j:N+1+j])

    cost += x * i
    ans = min(ans, cost)
print(ans)
Problem p02783 (python)

Fixed submission:
import math

a,b = map(int, input().split())
print(math.ceil(a/b))

Buggy submission (verdict: Runtime Error):
import math
import sys

n,k = map(int, input().split())
hlist = input().split()
hlist.sort(reverse=True)

if (n-k) <= 0:
  print(0)
  sys.exit()
sum = 0
for i in range(n):
  if i > k-1:
    sum = sum + int(hlist[i])
print(sum)
Problem p02789 (python)

Fixed submission:
n,m=map(int, input().split())
if n==m:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
li=list(map(int, input().split()))
ans=1
for i in range(1,n):
    lis=li[:i]
    if min(lis)>=li[i]:
        ans=ans+1
print(ans)
Problem p02801 (python)

Fixed submission:
alf=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
C=input()
counter=1
for i in alf:
    if i==C:
        ans=alf[counter]
    counter=counter+1
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int, input().split())
li_1=list(range(m))
li_2=list(range(m))
pr=list(range(n))
wa=0
ac=0
for i in range(n):
    pr[i]=0
for i in range(m):
    li_1[i],li_2[i]=map(str, input().split())
    li_1[i]=int(li_1[i])

for i in range(m):
    if li_2[i]=='AC':
        a=li_1[i]-1
        if pr[a]==0:
            for j in range(i):
                if li_1[j]==li_1[i]:
                    wa=wa+1
            pr[a]=1
            ac=ac+1
print(ac,wa)
Problem p02658 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
answer=1
for i in range(n):
    answer*=a[i]
    if answer>10**18:
        answer=-1
        break
if a.count(0)>0:
    answer=0
print(answer)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
answer=1
for i in range(n):
    answer*=a[i]
    if answer>10**18:
        answer=-1
        break
if a.cout(0)>0:
    answer=0
print(answer)
Problem p02690 (python)

Fixed submission:
x=int(input())
fifth_power=[0]*200
for i in range(200):
    fifth_power[i]=(i+1)**5
for i in range(200):
    t=abs(x-fifth_power[i])
    if x==1:
        print(0,-1)
        break
    elif fifth_power.count(t)==1:
        if fifth_power[i]-t==x:
            print(i+1,fifth_power.index(t)+1)
            break
        else:
            print(i+1,-fifth_power.index(t)-1)
            break

Buggy submission (verdict: Runtime Error):
x=int(input())
fifth_power=[0]*200
for i in range(200):
    fifth_power[i]=(i+1)**5
for i in range(200):
    t=x-fifth_power[i]
    if x==1:
        print(0,-1)
        break
    elif fifth_power.count(abs(t))==1:
        if i%2==0:
            print(fifth_power.index(abs(t))+1,i+1)
            break
        elif ifth_power[fifth_power.index(abs(t))]-fifth_power[1]==x:
            print(fifth_power.index(abs(t))+1,i+1)
            break
        else:
            print(fifth_power.index(abs(t))+1,-i-1)
            break
Problem p02747 (python)

Fixed submission:
s=input()
answer='Yes'
for i in range(len(s)):
    if len(s)%2==1:
        answer='No'
        break
    elif i%2==0:
        if s[i]!='h' or s[i+1]!='i':
            answer='No'
print(answer)

Buggy submission (verdict: Runtime Error):
print('No' if !(input().replace('hi','')) else 'Yes')
Problem p02854 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
sumFrontHalf=0
halfIndex=0
sumA=sum(a)
for i in range(n):
  sumFrontHalf+=a[i]
  if sumFrontHalf>=sumA/2:
    halfIndex=i
    break
sumBackHalf=sumA-sumFrontHalf+a[halfIndex]
if sumFrontHalf<sumBackHalf:
  print(sumFrontHalf-sumBackHalf+a[halfIndex])
else:
  print(sumBackHalf-sumFrontHalf+a[halfIndex])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
sumFrontHalf=0
halfIndex=0
sumA=aum(a)
for i in range(n):
  sumFrontHalf+=a[i]
  if sumFrontHalf>=sumA/2:
    halfIndex=i
    break
sumBackHalf=sumA-sumFrontHalf+a[halfIndex]
if sumFrontHalf<sumBackHalf:
  print(sumFrontHalf-sumBackHalf+a[halfIndex])
else:
  print(sumBackHalf-sumFrontHalf+a[halfIndex])
Problem p02958 (python)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
count=0
for i in range(n-1):
  if p[i]!=i+1:
      count=count+1
if count<3:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
n=int(input())
p=list(map(int,input().split()))
count=0
for i in range(n-1):
  if p[i]!=i+1
      count=count+1
if count<2:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
answer=0
for i in range(n):
  if a[i]>=b[i]:
    answer+=b[i]
    a[i]=0
    b[i]=0
  elif a[i]<b[i] and a[i]+a[i+1]>=b[i]:
    answer+=b[i]
    b[i]-=a[i]
    a[i+1]-=b[i]
  elif a[i]<b[i] and a[i]+a[i+1]<b[i]:
    answer+=(a[i]+a[i+1])
    b[i]-=(a[i]+a[i+1])
    a[i]=0
    a[i+1]=0
print(answer)
Problem p02969 (python)

Fixed submission:
r=input()
r=int(r)
print(3*(r**2))

Buggy submission (verdict: Runtime Error):
r=input()
r=int(r)
print(3(r**3))
Problem p02981 (python)

Fixed submission:
n=list(map(int,input().split()))
if n[0] * n[1] >= n[2]:
  print(n[2])
else :
  print(n[0] * n[1])

Buggy submission (verdict: Runtime Error):
import math
n,d=input().split()
n=int(n)
d=int(d)
def combinations(n, r):
    return math.factorial(n)/(math.factorial(n-r)*math.factorial(r))
x=[]
if d==1:
  count=combinations(n,2)
  count=int(count)
else:
  for i in range(n):
    xa=[int(s) for s in input().split()]
    x.append(xa)
  a=[]
  for i in range(n-1):
    for j in range(i+1,n):
      t=[]
      for k in range(d):
        c=(x[i][k]-x[j][k])*(x[i][k]-x[j][k])
        t.append(c)
        if k==d-1:
          a.append(sum(t))
  answer=list(map(lambda x:pow(x,1/2),a))
  count=0
  for l in range(n):
    if answer[l].is_integer()==True:
      count=count+1
print(count)
Problem p02612 (python)

Fixed submission:
N = int(input())
a = 1000 - (N % 1000)
A = a % 1000
print(A)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
ans = A[0]

if N%2 == 0:
  for i in range(1,N/2):
    ans = ans + A[i]*2
if N%2 == 1:
  for i in range(1,(N-1)/2):
    ans = ans + A[i]*2
  ans += A[(N+1)/2]
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input() for i in range(n))
a = s.count("AC")
w = s.count("WA")
t = s.count("TLE")
r = s.count("RE")

print("AC x " + str(a))
print("WA x " + str(w))
print("TLE x " + str(t))
print("RE x " + str(r))
Problem p02613 (python)

Fixed submission:
n = int(input())
s = list(input() for i in range(n))
a = s.count("AC")
w = s.count("WA")
t = s.count("TLE")
r = s.count("RE")

print("AC x " + str(a))
print("WA x " + str(w))
print("TLE x " + str(t))
print("RE x " + str(r))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input() for i in range(n))
a = s.count("AC")
w = s.count("WA")
t = s.count("TLE")
r = s.count("RE")

print("AC x " + str(a))
print("WA x " + str(w))
print("TLE x " + str(t))
print("RE x " + str(r
Problem p02615 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
ans = A[0]

if N%2 == 0:
  for i in range(1,int(N/2)):
    ans = ans + A[i]*2
if N%2 == 1:
  for i in range(1,int((N-1)/2)):
    ans = ans + A[i]*2
  ans += A[int((N-1)/2)]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
ans = A[0]

if N%2 == 0:
  for i in range(1,int(N/2)):
    ans = ans + A[i]*2
if N%2 == 1:
  for i in range(1,int((N-1)/2)):
    ans = ans + A[i]*2
  ans += A[(N+1)/2]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
ans = A[0]

if N%2 == 0:
  for i in range(1,int(N/2)):
    ans = ans + A[i]*2
if N%2 == 1:
  for i in range(1,int((N-1)/2)):
    ans = ans + A[i]*2
  ans += A[(N+1)/2]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
ans = A[0]

if N%2 == 0:
  for i in range(1,N/2):
    ans = ans + A[i]*2
if N%2 == 1:
  for i in range(1,(N-1)/2):
    ans = ans + A[i]*2
  ans += A[(N+1)/2]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
ans = A[0]

if N%2 == 0:
  for i in range(1,N/2):
    ans = ans + A[i]*2
if N%2 == 1:
  for i in range(1,(N-1)/2)
    ans = ans + A[i]*2
  ans += A[(N+1)/2]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
ans = A[0]

for i in range(1,N):
    ans = ans + A[i]:2
print(ans)
Problem p02639 (python)

Fixed submission:
x= list(map(int, input().split()))
for i in range(5):
  if x[i]==0:
    print(i+1)
    exit(0)

Buggy submission (verdict: Runtime Error):
x= list(map(int, inpout().split()))
for i in range(5):
  if x[i]==0:
    print(i)
    exit(0)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
import sys

if 0 in A:
    print(0)
    sys.exit()

ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    sys.exit()
if 10**18 < ans:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
import sys

if 0 in A:
    print(0)
    sys.exit()

ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    sus.exit()
if 10**18 < ans:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
if 0 in A:
    print(0)
    exit(0)

ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    exit(0)
if 10**18 < ans:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
if 0 in A:
    print(0)
    exit(0)
    
ans = np.prod(A)
elif ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
ans = np.prod(A)

if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(N):
    ans = ans*A[i]

if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(N):
    ans = ans*A[i]

if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)
Problem p03457 (python)

Fixed submission:
t, x, y = 0, 0, 0
for i in range(int(input())):
    next_t, next_x, next_y = map(int, input().split())
    diff = abs(x - next_x) + abs(y - next_y)
    if diff > (next_t - t) or (diff - (next_t - t)) % 2 == 1:
        print("No")
        exit(0)
    t, x, y, = next_t, next_x, next_y
print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
t=0
x=0
y=0
for i in range(N)
    nt, nx, ny = map(int, input().split())
    km = abs(nx-x) + abs(ny-y)
    if km > (nt-t) or (km - (nt-t)) % 2 == 1:
        print("No")
        exit(0)
    t, x, y = nt, nx, ny
print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
t=0
x=0
y=0
for i in range(N)
    nt, nx, ny = map(int, input().split())
    km = abs(nx-x) + abs(ny-y)
    if km > (nt-t) or (km - (nt-t)) % 2 = 1:
        print("No")
        exit(0)
    t, x, y = nt, nx, ny
print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
t=0
x=0
y=0
for i in range(N)
    nt, nx, ny = map(input().split())
    km = abs(nx-x) + abs(ny-y)
    if km > (nt-t) or (km - (nt-t)) % 2 = 1:
        print("No")
        exit(0)
    t, x, y = nt, nx, ny
print("Yes")
Problem p03470 (python)

Fixed submission:
N  = int(input())
num = list(map(int, (input() for h in range(N))))
num.sort()
count = 1

for i in range(N-1):
    if not num[i] == num[i+1]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N  = int(input())
num = list(map(int, input().split()))
num.sort()
count = 1

for i in range(N-1):
    if not num[i] == num[i+1]:
        count += 1
print(count)
Problem p03361 (python)

Fixed submission:
import numpy as np
import sys

h, w = map(int, sys.stdin.readline().strip().split(" "))

a = np.zeros((h,w), dtype=int)

for i in range(h):
    l = sys.stdin.readline().strip()
    for j in range(w):
        a[i, j] = (l[j] == "#")

for i in range(h):
    for j in range(w):
        if a[i, j] == 0:
            continue
        check = True
        if i >= 1:
            check &= a[i-1, j] == 0
        if i < h-1:
            check &= a[i+1, j] == 0
        if j >= 1:
            check &= a[i, j-1] == 0
        if j < w-1:
            check &= a[i, j+1] == 0
        if check:
            print("No")
            quit()
print("Yes")

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

w, h = map(int, sys.stdin.readline().strip().split(" "))

a = np.zeros((w,h), dtype=int)

for i in range(w):
    l = sys.stdin.readline().strip()
    for j in range(h):
        a[i, j] = (l[j] == "#")

for i in range(w):
    for j in range(h):
        if a[i, j] == 0:
            continue
        check = True
        if i >= 1:
            check &= a[i-1, j] == 0
        if i < h-1:
            check &= a[i+1, j] == 0
        if j >= 1:
            check &= a[i, j-1] == 0
        if j < w-1:
            check &= a[i, j+1] == 0
        if check:
            print("No")
            quit()
print("Yes")
Problem p03624 (python)

Fixed submission:
import sys

DICT = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

d = set(DICT)
s = set(list(sys.stdin.readline().strip()))

z = sorted(list(d-s))

if len(z) >= 1:
    print(z[0])
else:
    print('None')

Buggy submission (verdict: Runtime Error):
import sys

DICT = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

d = set(DICT)
s = set(list(sys.stdin.readline().strip()))

print(sorted(list(d-s))[0])
Problem p03737 (python)

Fixed submission:
import sys

data = sys.stdin.readline().split(" ")
print("".join([x[0].upper() for x in data]))

Buggy submission (verdict: Runtime Error):
import sys
x, y = map(int, sys.stdin.readlines())
if x > y:
    print("GREATER")
elif x == y:
    print("EQUAL")
else:
    print("LESS")
Problem p03680 (python)

Fixed submission:
N = int(input())
A = [0] * N
for i in range(N):
    A[i] = int(input()) - 1 # 配列に対応
index = 0
trials = -1
for i in range(N):
    index = A[index]
    if index == 1:
        trials = i + 1
        break
print(trials)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [0 * N]
for i in range(N):
    A[i] = int(input()) - 1 # 配列に対応
index = 0
trials = -1
for i in range(N):
    index = A[index]
    if index == 1:
        trials = i + 1
        break
print(trials)
Problem p02639 (python)

Fixed submission:
x = [int(i) for i in input().split()]
print(x.index(0)+1)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [int(i) for i in input().split()]
ans = 0
A.sort()
if n > 1:
    if A[0] != A[1]:
        ans = 1
for i in range(1, n):
    can_div = False
    for j in range(0, i):
        if A[i] % A[j] == 0:
            can_div = True
            break
        if A[j] > A[i] // 2:
            if A[i-1] == A[i]:
                can_div = True
            else:
                break
    if not can_div:
        ans += 1

print(ans)
Problem p02778 (python)

Fixed submission:
s = input()
print('x'*len(s))

Buggy submission (verdict: Runtime Error):
s = input()
print('x'*s)
Problem p02802 (python)

Fixed submission:
n, m = (int(i) for i in input().split())
p = [None] * m
s = [None] * m
for i in range(m):
    p[i], s[i] = (j for j in input().split())
    p[i] = int(p[i])
    
pena = [0] * n
ac   = [0] * n

for i in range(m):
    q_index = p[i]-1
    if s[i] == 'AC': 
        ac[q_index] = 1
    if s[i] == 'WA':
        if ac[q_index] == 0: pena[q_index] += 1
        
ac_num = 0
pena_num = 0
for i in range(n):
    if ac[i] == 1:
        ac_num += 1
        pena_num += pena[i]

print(ac_num, pena_num)

Buggy submission (verdict: Runtime Error):
n, m = (int(i) for i in input().split())
p = [None] * m
s = [None] * m
for i in range(m):
    p[i], s[i] = (j for j in input().split())
    p[i] = int(p[i])
    
pena = [0] * m
ac   = [0] * m
for i in range(m):
    q_index = p[i]-1
    if s[i] == 'AC': 
        ac[q_index] = 1
    if s[i] == 'WA':
        if ac[q_index] == 0: pena[q_index] += 1
        
print(sum(ac), sum(pena))
Problem p02865 (python)

Fixed submission:
N = int(input())
N = N - 1
print(int(N/2))

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
D = input().split(' ')
for i in range(N):
    D[i] = int(D[i])
D.sort()
if D[0] != 0 or 0 in D[1:]:
    print(0)
else:
    nums = []
    previous_num = D[0]
    previous_cnt = 1
    cnt = 1
    sum = 1
    for i in range(1,N):
        if D[i] != previous_num:
            if D[i] - previous_num != 1:
                print(0)
                sys.exit()
            previous_num = D[i]
            sum *= previous_cnt ** cnt
            previous_cnt = cnt
            cnt = 1
        else:
            cnt += 1
        if i == N-1:
            sum *= previous_cnt ** cnt
    
    print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
D = input().split(' ')
for i in range(N):
    D[i] = int(D[i])
D.sort()
if D[0] != 0 or 0 in D[1:]:
    print(0)
else:
    nums = []
    previous_num = D[0]
    previous_cnt = 1
    cnt = 1
    sum = 1
    for i in range(1,N):
        if D[i] != previous_num:
            previous_num = D[i]
            sum *= previous_cnt ** cnt
            previous_cnt = cnt
            cnt = 1
        else:
            cnt += 1
        if i == N-1:
            sum *= previous_cnt ** cnt
    
    print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
D = input().split(' ')
for i in range(N):
    D[i] = int(D[i])
D.sort()
if D[0] != 0 or 0 in D[1:]:
    print(0)
else:
    nums = []
    previous_num = D[0]
    previous_cnt = 1
    cnt = 1
    sum = 1
    for i in range(1,N):
        if D[i] != previous_num:
            previous_num = D[i]
            sum *= previous_cnt ** cnt
            previous_cnt = cnt
            cnt = 1
        else:
            cnt += 1
        if i == N-1:
            sum *= previous_cnt ** cnt
    
    print(sum)

Buggy submission (verdict: Runtime Error):
N = input()
N = N-1
print(N/2)
Problem p02923 (python)

Fixed submission:
N = int(input())
H = [int(i) for i in input().split()]
H = H[::-1]
can_move_nums = [0] * N
start = 0

for i in range(1, N):
    if H[i] >= H[i-1]:
        can_move_nums[i] = can_move_nums[i-1]+1        
        
print(max(can_move_nums))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = [int(i) for i in input().split()]
can_move_nums = [None] * N

for i in range(N):
    cnt = 0
    if i == N-1:
        break
    
    for j in range(i, N-1):
        if H[j+1] <= H[j]:
            cnt += 1
        else:
            break
        
    
    can_move_nums[now] = cnt 

print(max(can_move_nums))
Problem p02969 (python)

Fixed submission:
print(3*(int(input())**2))

Buggy submission (verdict: Runtime Error):
print(3*(int(input())**2)
Problem p03125 (python)

Fixed submission:
a, b = (int(i) for i in input().split())
print(a+b) if b%a == 0 else print(b-a)

Buggy submission (verdict: Runtime Error):
a, b = (int(i) for i in input(),split())
print(a+b) if b%a == 0 else print(b-a)
Problem p03238 (python)

Fixed submission:
age = int(input())
if age == 1:
  print('Hello World')
else:
  a = int(input())
  b = int(input())
  print(a+b)

Buggy submission (verdict: Runtime Error):
age = int(input())
if age == 1:
  print('Hello'World)
else:
  a = int(input())
  b = int(input())
  print(a+b)
Problem p03284 (python)

Fixed submission:
n, k = (int(i) for i in input().split())
print(0) if n%k == 0 else print(1)

Buggy submission (verdict: Runtime Error):
n, k = (int(i) for in input().split())
print(0) if n % k == 0 else print(1)
Problem p03288 (python)

Fixed submission:
n = int(input())
if n < 1200: print('ABC')
elif n < 2800: print('ARC')
else: print('AGC')

Buggy submission (verdict: Runtime Error):
n = input()
if n < 1200: print('ABC')
elif n < 2800: print('ARC')
else: print('AGC')
Problem p03377 (python)

Fixed submission:
a, b, x = (int(i) for i in input().split())
if x >= a and x-a <= b:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a, b, x = (i for i in input().split())
if x-a <= a+b:
  print('Yes')
else:
  print('No')