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

Fixed submission:
s=input()
n=len(s)
x=(n-1)//2
v=0
for i in range(x):
  if s[i]==s[n-1-i]==s[x-1-i]:
    v=v+1
if v==x:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
x=(n-1)//2
while i<x:
  if s[i]!=s[n-1-i] or s[i]!=s[x-1-i]:
    print('No')
    break 
  i=i+1
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
x=(n-1)//2
while i in range(x):
  if s[i]!=s[n-1-i] or s[i]!=s[x-1-i]:
    print('No')
    break 
else:
  print('Yes')
Problem p02760 (python)

Fixed submission:
d=[list(map(int,input().split()))for i in range(3)]
row=int(input())
num=[int(input()) for j in range(row)]
bingo=0
for a in range(3):
  if d[0][a] in num and d[1][a] in num and d[2][a] in num:
    bingo=bingo+1
  if d[a][0] in num and d[a][1] in num and d[a][2] in num:
    bingo=bingo+1
if d[1][1] in num and d[2][2] in num and d[0][0] in num:
  bingo=bingo+1
if d[1][1] in num and d[0][2] in num and d[2][0] in num:
  bingo=bingo+1
if bingo>0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
d=[list(map(int,input().split()))for i in range(3)]
row=int(input())
num=[int(input()) for j in range(row)]
bingo=0
for a in range(3):
  if d[0][a] and d[1][a] and d[2][a] in num:
    bingo=bingo+1
  elif d[a][0] and d[a][1] and d[a][1] in num:
    bingo=bingo+1
if d[1][1] and d[2][2] and d[3][3] in num:
  bingo=bingo+1
elif d[3][1] and d[2][2] and d[1][3] in num:
  bingo=bingo+1
if bingo>0:
  print('Yes')
else:
  print('No')
Problem p02767 (python)

Fixed submission:
n=int(input())
x=list(map(int,input().split()))
p=round(sum(x)/n)
m=[]
for i in x:
  m.append((i-p)**2)
print(sum(m))

Buggy submission (verdict: Runtime Error):
n=int(input())
x=list(map(int,input().split()))
p=round(sum(x)/n)
m=[]
for i in x:
  m.append((i-m)**2)
print(sum(m))

Buggy submission (verdict: Runtime Error):
n=int(input())
x=list(map(int,input().split()))
p=round(sum(x)/n)
m=[]
for i in x:
  m.append((x-m)**2)
print(sum(m))
Problem p02772 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
s=0
for i in a:
  if i%2==0:
    if i%3!=0 and i%5!=0:
      s=s+1
print('DENIED' if s>0 else 'APPROVED')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
s=0
for i in a:
  if a%2==0:
    if a%3!=0 and a%5!=0:
      s=s+1
print('DENIED' if s>0 else 'APPROVED')
Problem p02789 (python)

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

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
print('Yes' if n=m else 'No')
Problem p02802 (python)

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

submit = []
for i in range(m):
    temp = [x for x in input().split()]
    submit.append(temp)

ac = [0] * (n + 1)
wa = [0] * (n + 1)

for i in range(m):
    result = submit[i][1]
    question = int(submit[i][0])

    if result == 'AC' and ac[question] == 0:
        ac[question] = 1
    elif result == 'WA' and ac[question] == 0:
        wa[question] += 1

for i in range(n + 1):
    if ac[i] != 1:
        wa[i] = 0

print(sum(ac), sum(wa))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
collect=[]
pen=[]
sum=0
for i in range(m):
  p,s=input().split()
  if p not in collect:
    if s=='WA':
      pen.append(p)
    else:
      collect.append(p)
      sum=sum+pen.count(p)
print(len(collect),sum-len(list))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
list=[]
sum=0
for i in range(m):
  p,s=input().split()
  if s='AC':
    list.append(p)
  else:
    if p not in list:
      sum=sum+1
print(sum)
Problem p02844 (python)

Fixed submission:
n=int(input())
s=input()
p=0
for i in range(10):
  pi=s.find(str(i))
  if pi==-1:
    continue
  for j in range(10):
    pj=s.find(str(j),pi+1)
    if pj==-1:
      continue
    for k in range(10):
      pk=s.find(str(k),pj+1)
      if pk==-1:
        continue
      p=p+1
print(p)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
t=[]
for i in range(n):
  t.append(s[i])
p=0
for i in range(10):
  pi=t.find(str(i))
  if pi==-1:
    continue
  for j in range(10):
    pj=t.find(str(j),pi)
    if pj==-1:
      continue
    for k in range(10):
      pk=t.find(str(k),pj)
      if pk==-1:
        continue
      p=p+1
print(p)
Problem p02848 (python)

Fixed submission:
n=int(input())
s=input()
t='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
  x=t[(t.index(s[i])+n)%26]
  s=s[:i]+x+s[i+1:]
print(s)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
list=ABCDEFGHIJKLMNOPQRSTUVWXYZ
for i in range(len(s)):
  x=list[(list.index(s[i])+n)%26]
  s.replace(s[i],x)
print(s)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
list=ABCDEFGHIJKLMNOPQRSTUVWXYZ
for i in range(len(s)):
  x=list[(list.index(s[i])+n)%26]
  s.replace(s[i],x)
Problem p03061 (python)

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

import fractions as math

l=[0]
r=[0]
for i in range(n-1):
  li=math.gcd(l[i],a[i])
  l.append(li)
  ri=math.gcd(r[i],a[n-i-1])
  r.append(ri)
m=[]
for i in range(n):
  mi=math.gcd(l[i],r[n-i-1])
  m.append(mi)

print(max(m))

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

import math
l=[0]
r=[0]
for i in range(n-1):
  l.append(math.gcd(l[i],a[i]))
  r.append(math.gcd(r[i],a[n-i-1]))
m=[]
for i in range(n):
  m.append(math.gcd(l[i],r[n-i-1]))
print(max(m))
Problem p02612 (python)

Fixed submission:
n = int(input())

if n <= 1000:
    print(1000-n)
elif 1000< n <=2000:
    print(2000-n) 
elif 2000< n <=3000:
    print(3000-n)
elif 3000< n <=4000:
    print(4000-n)
elif 4000< n <=5000:
    print(5000-n)
elif 5000< n <=6000:
    print(6000-n)
elif 6000< n <=7000:
    print(7000-n)
elif 7000< n <=8000:
    print(8000-n)
elif 8000< n <=9000:
    print(9000-n)
elif 9000< n <=10000:
    print(10000-n)

Buggy submission (verdict: Runtime Error):
n = str(input())
if int(n)==10000:
    print(0)
else:
    print(1000-int(n[1:4]))

Buggy submission (verdict: Runtime Error):
n = str(input())
print(int(n[1:4]))
Problem p02641 (python)

Fixed submission:
import numpy as np
def calc_double(nn):
    return nn -x

x,n = list(map(int,input().split()))
p= list(map(int,input().split()))
p_all = list(range(-200,200,1))

l_in = [s for s in p_all if s not in p]

data2 = []
for val in l_in:
    data2.append(abs(calc_double(val)))

min_index =np.argmin(data2)
print(l_in[min_index])

Buggy submission (verdict: Runtime Error):
import numpy as np
def calc_double(nn):
    return nn -x

x,n = list(map(int,input().split()))
p= list(map(int,input().split()))
p_all = list(range(-200,200,1))

for i in enumerate(p):
    l_in = [s for s in p_all if s not in p]

data2 = []
for val in l_in:
    data2.append(abs(calc_double(val)))

min_index =np.argmin(data2)
print(l_in[min_index])
Problem p02713 (python)

Fixed submission:
from math import gcd

K = int(input())

ans = 0

for a in range(1,K+1) :
    for b in range(1,K+1) :
        X = gcd(a, b)
        for c in range(1,K+1) :
           Y = gcd(X, c)
           ans += Y

print(ans)

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

K = int(input())

ans = 0

for a in range(1,K+1) :
    for b in range(1,K+1) :
        for c in range(1,K+1) :
           X = fractions.gcd(a, b)
           Y = fractions.gcd(X, c)
           ans += Y

print(ans)

Buggy submission (verdict: Runtime Error):
import math
import fractions import gcd
import numpy as np
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

K = int(input())

ans = 0

for a in range(1,K+1) :
    for b in range(1,K+1) :
        for c in range(1,K+1) :
           X = fractions.gcd(a, b)
           Y = fractions.gcd(X, c)
           ans += Y

print(ans)

Buggy submission (verdict: Runtime Error):
import math
import fractions
import numpy as np
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

K = int(input())

ans = 0

for a in range(1,K+1) :
    for b in range(1,K+1) :
        for c in range(1,K+1) :
           X = fractions.gcd(a, b)
           Y = fractions.gcd(X, c)
           ans += Y

print(ans)

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

K = int(input())

ans = 0

for a in range(1,K+1) :
    for b in range(1,K+1) :
        for c in range(1,K+1) :
           X = math.gcd(a, b)
           Y = math.gcd(X, c)
           ans += Y

print(ans)
Problem p02756 (python)

Fixed submission:
from collections import deque

S = str(input())
Q = int(input())
t = 0

d = deque()
d.append(S)

for _ in range(Q):
    A = list(input().split())
    if A[0] == "1":
        if t == 0:
            t = 1
        else:
            t = 0

    elif (A[1] == "1" and t == 0) or (A[1] == "2" and t == 1):
        d.appendleft(A[2])
    else:
        d.append(A[2])

l = list(d)
ans = "".join(l)
if t == 1:
    ans = ans[::-1]
print(ans)

Buggy submission (verdict: Runtime Error):
S = str(input())
Q = int(input())
t = 0

for _ in range(Q):
    A = list(input().split())
    if A[0] == "1":
        if t == 0:
            t = 1
        else:
            t = 0

    elif (A[1] == "1" and t == 0) or (A[1] == "2" and t == 1):
        S = A[2] + S
    else:
        S = S + A[2]

if t == 1:
    S = s[::-1]

print(S)
Problem p02780 (python)

Fixed submission:
import numpy as np
import numpy

N,K = map(int, input().split())
P = list(map(int,input().split()))

S = numpy.cumsum(P)
P.append(0)
M = S[K-1]

for i in range(0,N):
    if P[i+K] == 0:
        break
    A = S[i+K] - S[i]
    M = max(M, A)

ans = 0.5 * (M + K)

print(ans)

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

N,K = map(int, input().split())
P = list(map(int,input().split()))

S = numpy.cumsum(P)
P.append(0)
M = S[K]

for i in range(0,N):
    if P[i+K] == 0:
        break
    A = S[i+K] - S[i]
    M = max(M, A)

ans = 0.5 * (M + K)

print(ans)

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

N,K = map(int, input().split())
P = list(map(int,input().split()))

S = numpy.cumsum(P)
P.append(0)
M = S[2]

for i in range(0,N):
    if P[i+K] == 0:
        break
    A = S[i+K] - S[i]
    M = max(M, A)

ans = 0.5 * (M + K)

print(ans)

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

N,K = map(int, input().split())
P = list(map(int,input().split()))
M = 0

S = numpy.cumsum(P)
P.append(0)

for i in range(1,N):
    if P[i+K] == 0:
        break
    A = S[i+K] - S[i]
    M = max(M, A)

ans = 0.5 * (M + K)

print(ans)
Problem p02900 (python)

Fixed submission:
import numpy as np

def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    table = sorted(table)
    return table

def make_prime(U):
    is_prime = np.zeros(U,np.bool)
    is_prime[2] = 1
    is_prime[3::2] = 1
    M = int(U**.5)+1
    for p in range(3,M,2):
        if is_prime[p]:
            is_prime[p*p::p+p] = 0
    return is_prime, is_prime.nonzero()[0]
A, B = map(int, input().split())

def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

A_list = set(divisor(A))
B_list = set(divisor(B))

list = A_list & B_list

#_, primes = make_prime(10**8)

cnt = 1

for i in list:
    if is_prime(i):
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    table = sorted(table)
    return table

def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

A_list = set(divisor(A))
B_list = set(divisor(B))

list = A_list & B_list

cnt = 1

for i in list:
    if is_prime(i):
        cnt += 1

print(cnt)
Problem p03469 (python)

Fixed submission:
S = input()
S_2 = S.replace("2017","2018")
print(S_2)

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

for x in range(N+1):
    for y in range(N+1):
        if 10000*x + 5000*y + 1000*(N-(x+y)) == Y and N-(x+y) >= 0:
            print(x, y, N-(x+y))
            exit()

print(-1,-1,-1)
Problem p03493 (python)

Fixed submission:
s = list(input())

#print(s)

x = s.count("1")

print(x)

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

B = set(A)

cnt = len(B)

for x in B:
    a = A.count(x)
    li.append(a)

li = sorted(li)

if cnt - K > 0:
    for x in range(cnt - K):
        ans += li[x]
    print(ans)

else :
    print(ans)
Problem p02645 (python)

Fixed submission:
name = input()

print(name[:3])

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

a_res = a + (v*t)
b_res = b + (w*t)

if a_res > b_res:

  print("YES")
else:
  print("NO")
Problem p02705 (python)

Fixed submission:
import math
print(int(input())*2 * math.pi)

Buggy submission (verdict: Runtime Error):
print(input() * 2 * 3.14)
Problem p02641 (python)

Fixed submission:
a, b = map(int, input().split())
if b != 0:
    c = input()
    l = c.split()
    cc = [int(s) for s in l]
    ccc =list(cc)
    for i in range(a,102):
        if i in ccc:
            continue
        else:
            x = i
            break
    for i in reversed(range(0, a)):
        if i in ccc:
            continue
        else:
            y = i
            break
    if x-a<a-y:
        print(x)
    else:
        print(y)
else:
    d = input()
    print(a)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if b != 0:
    c = input()
    l = c.split()
    cc = [int(s) for s in l]
    ccc =list(cc)
    for i in range(a,101):
        if i in ccc:
            continue
        else:
            x = i
            break
    for i in reversed(range(0, a)):
        if i in ccc:
            continue
        else:
            y = i
            break
    if x-a<a-y:
        print(x)
    else:
        print(y)
else:
    d = input()
    print(a)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if b != 0:
    c = input()
    l = c.split()
    cc = [int(s) for s in l]
    ccc =list(cc)
    for i in range(a,100):
        if i in ccc:
            continue
        else:
            x = i
            break
    for i in reversed(range(-100, a)):
        if i in ccc:
            continue
        else:
            y = i
            break
    if x-a<a-y:
        print(x)
    else:
        print(y)
else:
    d = input()
    print(a)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if b != 0:
    c = input()
    l = c.split()
    cc = [int(s) for s in l]
    ccc =list(cc)
    z = max(ccc) + 2
    for i in range(a,z):
        if i in ccc:
            continue
        else:
            x = i
            break
    for i in reversed(range(1, a)):
        if i in ccc:
            continue
        else:
            y = i
            break
    if x-a<a-y:
        print(x)
    else:
        print(y)
else:
    d = input()
    print(a)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if b !=0:
    c = input()
    l = c.split()
    cc = [int(s) for s in l]
    ccc =list(cc)
    z = max(ccc) + 2
    for i in range(a,z):
        if i in ccc:
            continue
        else:
            x = i
            break
    for i in reversed(range(1, a)):
        if i in ccc:
            continue
        else:
            y = i
            break
    if x-a<a-y:
        print(x)
    else:
        print(y)
else:
    print(a)
Problem p02613 (python)

Fixed submission:
N = int(input())
#print(N)

S = [input() for i in range(N)]
#print(S)

ac = 0
wa = 0
tle = 0
re = 0
for i in range(N):
    if S[i] == 'AC':
        ac += 1
    elif S[i] == 'WA':
        wa += 1
    elif S[i] == 'TLE':
        tle += 1
    elif S[i] == 'RE':
        re += 1

print('AC x' , ac)
print('WA x' ,wa)
print('TLE x' ,tle)
print('RE x' , re)

Buggy submission (verdict: Runtime Error):
print(N)

S = [input() for i in range(N)]
print(S)

ac = 0
wa = 0
tle = 0
re = 0
for i in range(N):
    if S[i] == 'AC':
        ac += 1
    elif S[i] == 'WA':
        wa += 1
    elif S[i] == 'TLE':
        tle += 1
    elif S[i] == 'RE':
        re += 1

print('AC x' , ac)
print('WA x' ,wa)
print('TLE x' ,tle)
print('RE x' , re)
Problem p02664 (python)

Fixed submission:
X = input()
ans = []

for i in range(len(X)):
    if X[i] == '?':
        ans.append('D')
    else:
        ans.append(X[i])

for i in ans:
    print(i, end = "")

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

ans = []
for i in range(len(X)):
    if X[i] == '?' and X[i-1] != 'P' and X[i+1] != 'P':
        ans.append('P')
    elif X[i] == '?':
        ans.append('D')
    else:
        ans.append(X[i])

for i in ans:
    print(i, end = "")

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

ans = []
for i in range(len(X)):
    if X[i] == '?' and X[i-1] != 'P' and X[i+1] != 'P':
        ans.append('P')
    elif X[i] == '?':
        ans.append('D')
    else:
        ans.append(X[i])

print(ans)

for i in ans:
    print(i, end = "")
Problem p02887 (python)

Fixed submission:
N = int(input())
#print(N)

S = input()

count = 0
for i in range(N):
    #print(S[i] , i)
    if i == N-1:
        break
    else:
        if S[i+1] != S[i]:
            count += 1

if count == 0:
    print(1)
else:
    print(count+1)

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

S = input()

count = 0
for i in range(N):
    #print(S[i] , i)
    if i == 0:
        if S[i+1] != S[i]:
            count += 1
    elif i == N-1:
        if S[i-1] != S[i]:
            count += 1
    else:
        if S[i+1] != S[i]:
            count += 1

if count == 0:
    print(1)
else:
    print(count)
Problem p03455 (python)

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

if (a*b)%2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
N = int(input())
tmp = [tuple(map(int,input().split())) for i in range(N)]

ct = 0
cx = 0
cy = 0
for t,x,y in tmp:
    dst = abs(cx - x) + abs(cy - y)
    if dst > t-ct or dst%2 != (t-ct)%2:
        print('No')
        exit()
    ct,cx,cy = t,x,y

print('Yes')
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(float,input().split()))


for i in range(N):
 if(i == 0): ans = A[i]
 else: ans = ans*A[i]
  
ans = '{:.19g}'.format(ans)  
if((len(ans)>=2)and(ans[1] == 'e')):
  print('-1')
else:
  print(ans)
Problem p02658 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
         
if(0 in A):
  ans = 0 
else:
  ans = 1       
  for a in A:
    ans *= a
    if(ans > 10**18):
      ans = -1
      break
    if(len(str(ans))>=2):
     if(str(ans)[1] == 'e'):
      ans = -1
      break
         
print(ans)

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


for i in range(N):
 if(i == 0): ans = A[i]
 else: ans = ans*A[i]
  
ans = '{:.19g}'.format(ans)  
if(ans[1] == 'e'):
  print('-1')
else:
  print(ans)
Problem p02687 (python)

Fixed submission:
s = input()
if(s=='ARC'):
  print('ABC')
else:
  print('ARC')

Buggy submission (verdict: Runtime Error):
S = input()
if(s=='ARC'):
  print('ABC')
else:
  print('ARC')
Problem p02690 (python)

Fixed submission:
X = int(input())

for A in range(0,10**3):
 for B in range(0,10**3):
  A1,A2,B1,B2 = A,-A,B,-B
  if(A1**5-B1**5 == X):
    ans = [A1,B1]
    break
  elif(A1**5-B2**5 == X):
    ans = [A1,B2]
    break
  elif(A2**5-B1**5 == X):
    ans = [A2,B1]
    break  
  elif(A2**5-B2**5 == X):
    ans = [A2,B2]
    break    
            
print(ans[0],ans[1])

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

for A in range(-10,100+1):
  for B in range(-10,100+1):
    if(A**5 - B**5 == X):
      ans = [A,B] 
      
print(ans[0],ans[1])
Problem p02866 (python)

Fixed submission:
import collections
def counter_list(A):
  counter = collections.Counter(A)
  counter =  [list(e) for e in counter.items()]
  counter.sort() #sortしたい場合はつける
  return counter

N = int(input())
D = list(map(int,input().split()))
#print(D)

#ans = ans*(D[i][1]**D[i+1][1]) (mod 998244353)
if(D[0] != 0): ans = 0 #一番最初が0でないなら
else: 
  D = counter_list(D) # [[0,1],[1,3],...] → 0:1個,1:3個,...
  if(D[0][1] != 1):
    ans = 0
  else:
   ans = 1
   for i in range(len(D)-1):
      if(D[i+1][0] - D[i][0] != 1):
        ans = 0
        break
      a = D[i][1]%998244353
      b = D[i+1][1]
      ans = ans%998244353
      ans = ans*(a**b)
      ans = ans%998244353
print(ans)

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

import collections
def counter_list(A):
  counter = collections.Counter(A)
  counter =  [list(e) for e in counter.items()]
  counter.sort() #sortしたい場合はつける
  return counter

if(D[0] != 0): ans = 0
else: 
  D = counter_list(D)
  ans = 1
  for i in range(len(D)-1):
    if(i>=1):
      a = D[i]%998244353
      b = D[i+1]
      ans = ans%998244353
      ans = ans*(a**b)
      ans = ans%998244353
print(ans)
Problem p03001 (python)

Fixed submission:
W,H,x,y = map(int,input().split())
c_x,c_y = W/2,H/2
S_max = (W*H)/2
if((x==c_x)and(y==c_y)): ans = 1
else: ans = 0
print(S_max,ans)

Buggy submission (verdict: Runtime Error):
W,H,x,y = map(int,input().split())
judge = 0

s11 = x*H 
s12 = (W-x)*H
S1 = min(s11,s12)

s21 = y*W
s22 = (H-y)*W
S2 = min(s21,s22)

if(y/x == H/W): judge = 1  
if(S1 == S2): 
  judge = 1 
  print(S1,judge)
elif(S1 < S2): 
  print(S2,judge)
elif(S1 > S2): 
  print(S1,judge)
Problem p03106 (python)

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

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

if(a < b):
  tmp = a
  a = b
  b = tmp
  
#a > b 
if(k > 1):
 for i in range(b+1):
  if(i != 0):
   if((a%i == 0)and(b%i == 0)):
    G.append(i)
 #print(G)
 print(G[-k]) 
elif(k == 1):
  print(gcd(a,b))

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
count = 0
gcd = []

if(a < b):
  tmp = a
  a = b
  b = tmp
  
for i in range(a):
  if(i != 0):
   if((a%i == 0)and(b%i == 0)):
    gcd.append(i)
 
print(gcd[-k])
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())
A = int(input())
B = int(input())
if(N == 1):
 print('Hello World')
else:
 print(A+B)
Problem p03471 (python)

Fixed submission:
#sys.stdin.readline()
import sys
input = sys.stdin.readline

N,Y = map(int,input().split())
p = Y//1000
x,y,z = 0,0,0
judge = 0 #0:不可,1:可

#連立方程式
#10000x + 5000y + 1000z = 1000p(Y = 1000p)
#x + y + z = N 
#整数解 x = -4k+p-N , y = 9k-2p+2N, z = N-x-y(k = 0,...2000)

if((p-N) >= 0):
 for k in range((p-N)//4 + 1):
  x = -4*k+p-N
  y = 9*k-2*p+2*N
  z = N-x-y
  if((x>=0)and(y>=0)and(z>=0)):
    judge = 1
    break

if(judge == 1):
  print(x,y,z)
else:
  print(-1,-1,-1)

Buggy submission (verdict: Runtime Error):
input = sys.stdin.readline

N,Y = map(int,input().split())
p = Y//1000
x,y,z = 0,0,0
judge = 0 #0:不可,1:可

#連立方程式
#10000x + 5000y + 1000z = 1000p(Y = 1000p)
#x + y + z = N 
#整数解 x = -4k+p-N , y = 9k-2p+2N, z = N-x-y(k = 0,...2000)

if((p-N) >= 0):
 for k in range((p-N)//4 + 1):
  x = -4*k+p-N
  y = 9*k-2*p+2*N
  z = N-x-y
  if((x>=0)and(y>=0)and(z>=0)):
    judge = 1
    break

if(judge == 1):
  print(x,y,z)
else:
  print(-1,-1,-1)