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

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
x = 0
lis = []
for i in range(0,len(H)-1) :
    if H[i] - H[i+1] >=0:
        x += 1
    else:
        lis.append(x)
        x =0
lis.append(x)
print(max(lis))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans=0
answer=[]
for i in range(n-1):
  if h[i]>=h[i+1]:
    ans+=1
  if h[i]<h[i+1]:
    answer.append(ans)
    ans=0
  if i == n-2:
    answer.append(ans)
  else:
    continue
print(max(answer))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans=0
answer=[]
for i in range(n-1):
  if h[i]>=h[i+1]:
    ans+=1
  if h[i]<h[i+1]:
    answer.append(ans)
    ans=0
  if i == n-1:
    answer.append(ans)
print(max(answer))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans=0
answer=[]
for i in range(n-1):
  if h[i]>=h[i+1]:
    ans+=1
  if h[i]<h[i+1]:
    answer.append(ans)
    ans=0
  if i == n-2:
    answer.append(ans)
print(max(answer))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
answer=[]
for i in range(n-1):
  ans=0
  for j in range(n-i-1):
    #print(str(h[i+j])+'と'+str(h[i+j+1])+'を比較')
    if h[i+j]>=h[i+j+1]:
      ans+=1
    if h[i+j]<h[i+j+1]:
      answer.append(ans)
      #print('第'+str(i+1)+'ループ終わり')
      break
    if i+j+1==n-1:
      answer.append(ans)
      #print('第'+str(i+1)+'ループ終わり')
      break
  ans=0
print(max(answer))
Problem p02957 (python)

Fixed submission:
A,B = map(int,input().split())
if (A+B)%2==0:
  print(int((A+B)/2))
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
N = int((input()))
S = input().split()
s=[]
b=[]
#print(S)
for i in range (N):
  s.append(int(S[i]))
#print(s)
for i in range(N):
  if s[i]==i+1:
    pass
  else:
    b.append(i)
#print(b)
if len(b)<3:
  print("YES")
else:
  print("NO")
Problem p02969 (python)

Fixed submission:
r = int(input())

print(3*r*r)

Buggy submission (verdict: Runtime Error):
n,d=map(int,input().split())
if n%(2*d+1)==0:
  print(int(n/(2*d+1)))
else:
  print(int(n/(2*d+1))+1)

Buggy submission (verdict: Runtime Error):
r=input()
print(r*r*3)

Buggy submission (verdict: Runtime Error):
r=int(inout())
print(3*r*r)

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

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

Buggy submission (verdict: Runtime Error):
S = input().sprit()
N = int(S[0])
A = int(S[1])
B = int(S[2])
if B > A*N:
  print(A*N)
else:
  print(B)
Problem p02999 (python)

Fixed submission:
X,A = list(map(int, input().split()))
if X<A:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
L=list(map(int,input().split()))
#print(L)
D=0
B=[0]
C=[]
for i in range(len(L)):
  D=D+L[i]
  B.append(D)
#print(B)
for i in range(len(L)):
  if B[i]<=x:
    C.append(i)
  else:
    pass
#print(C)
print(min(n+1,len(C)))
Problem p03085 (python)

Fixed submission:
b=input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="G":
  print("C")
else:
  print("G")

Buggy submission (verdict: Runtime Error):
b=input()
if b="A":
  print("T")
elif b="T":
  print("A")
elif b="G":
  print("C")
else:
  print("G")
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 p03238 (python)

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

Buggy submission (verdict: Runtime Error):
X=int(input())
if X=1:
  print("Hello World")
else:
  a=int(input())
  b=int(input())
  print(a+b)
Problem p03433 (python)

Fixed submission:
n=int(input())
a=int(input())
print("Yes" if (n%500) <= a else "No")

Buggy submission (verdict: Runtime Error):
n,a=map(int,input().split())
print("Yes" if (n%500) <= a else "No")

Buggy submission (verdict: Runtime Error):
n,a=map(int,input().split())
print("Yes" if n/500 <= a else "No")

Buggy submission (verdict: Runtime Error):
n,a=map(int,input().split())
print("Yes" if ((n/500) <= a) else "No")

Buggy submission (verdict: Runtime Error):
n,a=map(int,input().split())
print("Yes" if n/500 <= a else "No")
Problem p03448 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(a+1):
  A=i*500
  for j in range(b+1):
    B=j*100
    for k in range(c+1):
      C=k*50
      
      if A+B+C==x:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(a+1):
  A=i*500
  for j in　range(b+1):
    B=j*100
    for k in range(c+1):
      C=k*50
      
      if A+B+C=x:
        ans+=1
print(ans)
Problem p03469 (python)

Fixed submission:
print(input().replace('2017', '2018'))

Buggy submission (verdict: Runtime Error):
y,m,d=map(input().split("/"))
print(str(y+1)+"/"+str(m)+"/"+str(d))
Problem p03161 (python)

Fixed submission:
import numpy as np

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

i = 0
total_cost = 0
 
a = np.zeros(N, dtype=np.int64)
a[0] = 0
a[1] = abs(hs[1] - hs[0])

for i in range(2, N):
    k = min(K,i)
    a[i] = np.min(a[i-k:i] + np.abs(hs[i] - hs[i-k:i]))    
print(a[-1])

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

N, K = map(dtype=np.int64, input().split())
hs = np.array(list(map(dtype=np.int64, input().split())))

i = 0
total_cost = 0
 
a = np.zeros(N, dtype=np.int64)
a[0] = 0
a[1] = abs(hs[1] - hs[0])

for i in range(2, N):
    bmin = float('inf')
    for j in range(max(i-K,0),i):
        bmin = np.min(bmin, a[j] + np.abs(hs[i] - hs[j]))    
    a[i] = bmin
print(a[-1])

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

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

i = 0
total_cost = 0
 
a.append(0,hs[1] - hs[0])

for i in range(2, N):
    bmin = float('inf')
    for j in range(max(i-K,0),i):
        bmin = min(bmin, a[j] + abs(hs[i] - hs[j]))
    a.append(bmin)

print(a[N-1])

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

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

i = 0
total_cost = 0
 
a = np.zeros(N, int)
a[0] = 0
a[1] = abs(hs[1] - hs[0])

for i in range(2, N):
    a[i] = float('inf')
    for j in range(max(i-K,0),i):
        a[i] = min(a[i], a[j] + abs(hs[i] - hs[j]))

print(a[N-1])

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

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

i = 0
total_cost = 0
 
a = np.zeros(N, int)
a[0] = 0
a[1] = abs(hs[1] - hs[0])

for i in range(2, N):
    a[i] = float('inf')
    for j in range(max(i-K,0),i):
        a[i] = min(a[i], a[j] + abs(hs[i] - hs[j]))    
print(a[-1])
Problem p03163 (python)

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

weight = []
value = []

for i in range(N):
    w, v = list(map(int, input().split()))
    weight.append(w)
    value.append(v)


dp = []

for i in range(N+1):
    dp.append([])
    for j in range(W+1):
        dp[i].append(0)


# max value = dp[何個まで見たか][現在の重さ]
for i in range(N):
    for j in range(W+1):
        if (j+weight[i]) <= W:
            dp[i+1][j+weight[i]] = max(dp[i][j+weight[i]], dp[i][j] + value[i])

        dp[i+1][j] = max(dp[i][j],dp[i+1][j])

print(dp[N][W])

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

weight = []
value = []

for i in range(N):
    w, v = list(map(int, input().split()))
    weight.append(w)
    value.append(v)

dp = [0] * (W+1)

for i in range(N+1):
    dp.append([])
    for j in range(W+1):
        dp[i].append(0)


# max value = dp[何個まで見たか][現在の重さ]
for i in range(N):
    for j in range(W+1):
        if (j+weight[i]) <= W:
            dp[i+1][j+weight[i]] = max(dp[i][j+weight[i]], dp[i][j] + value[i])

        dp[i+1][j] = max(dp[i][j],dp[i+1][j])

print(dp[N][W])
Problem p02719 (python)

Fixed submission:
N,M=[int(x) for x in input().split()]
print(min(abs(N-N//M*M),abs(N-(N//M+1)*M)))

Buggy submission (verdict: Runtime Error):
N,M=[int(x) for x in input().split()]
print(min(abs(N-N//M*M),abs(N-(N//M+1)*(M))))N,M=[int(x) for x in input().split()]
print(min(abs(N-N//M*M),abs(N-(N//M+1)*(M))))
Problem p03476 (python)

Fixed submission:

M=pow(10,5)

prime_sieve=[-1 for i in range(M+1)]
prime_sieve[0]=1
prime_sieve[1]=1

primes=[]
for i in range(M+1):
  if prime_sieve[i]==-1:
    primes.append(i)
    for j in range(2,(M)//i+1):
      prime_sieve[i*j]=1
#print(prime_sieve)
rangesum=[0,0,0]
sum=0
for i in range(3,M+1):
  if prime_sieve[i]==-1:
    if prime_sieve[(i+1)//2]==-1:
       sum+=1
       #print(i,sum)
  rangesum.append(sum)

Q=int(input())
for i in range(Q):
  l,r=[int(x) for x in str(input()).split()]
  print(rangesum[r]-rangesum[l-1])

Buggy submission (verdict: Runtime Error):

M=pow(10,5)

prime_sieve=[-1 for i in range(M+1)]
prime_sieve[0]=1
prime_sieve[1]=1

primes=[]
for i in range(M+1):
  if prime_sieve[i]==-1:
    primes.append(i)
    for j in range(2,(M+1)//i+1):
      prime_sieve[i*j]=1
#print(prime_sieve)
rangesum=[0,0,0]
sum=0
for i in range(3,M+1):
  if prime_sieve[i]==-1:
    if prime_sieve[(i+1)//2]==-1:
       sum+=1
       #print(i,sum)
  rangesum.append(sum)

Q=int(input())
for i in range(Q):
  l,r=[int(x) for x in str(input()).split()]
  print(rangesum[r]-rangesum[l-1])

Buggy submission (verdict: Runtime Error):

M=pow(10,2)

prime_sieve=[-1 for i in range(M+1)]
prime_sieve[0]=1
prime_sieve[1]=1

primes=[]
for i in range(M+1):
  if prime_sieve[i]==-1:
    primes.append(i)
    for j in range(2,(M+1)//i+1):
      prime_sieve[i*j]=1
#print(prime_sieve)
rangesum=[0,0,0]
sum=0
for i in range(3,M+1):
  if prime_sieve[i]==-1:
    if prime_sieve[(i+1)//2]==-1:
       sum+=1
       #print(i,sum)
  rangesum.append(sum)

Q=int(input())
for i in range(Q):
  l,r=[int(x) for x in str(input()).split()]
  print(rangesum[r]-rangesum[l-1])
Problem p03566 (python)

Fixed submission:
N=int(input())
T=[0]+[int(x) for x in str(input()).split()]+[0]
V=[0]+[int(x) for x in str(input()).split()]+[0]
 
time=0
t=[0]
for i in T:
  time+=i
  t.append(time)
ans=0
 
for j in range(0,2*time):
  m1=1000000000
  m2=1000000000
  t1=j/2
  t2=(j+1)/2
  for i in range(N+2):
    if t1<=t[i]:
      m1=min(m1,V[i]+(t[i]-t1))
    elif t1<=t[i+1]:
      m1=min(m1,V[i])
    else:
      m1=min(m1,V[i]+t1-t[i+1])
 
    if t2<=t[i]:
      m2=min(m2,V[i]+(t[i]-t2))
    elif t2<=t[i+1]:
      m2=min(m2,V[i])
    else:
      m2=min(m2,V[i]+t2-t[i+1])
    
  #print(1,m1,m2)
  ans+=0.25*(m1+m2)
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T=[0]+[int(x) for x in str(input()).split()]+[0]
V=[0]+[int(x) for x in str(input()).split()]+[0]
time=0
t=[0]
for i in T:
  time+=i
  t.append(time)
ans=0

for j in range(0,2*time):
  m2=100000000
  m1=100000000
  t1=j/2
  t2=(j+1)/2
  print(t1,t2)
  for i in range(N+2):
	a=t[i]
	b=t[i+1]
	c=V[i]
    if t1<=a:
      m1=min(m1,c+(a-t1))
    elif t1<=b:
      m1=min(m1,c)
    else:
      m1=min(m1,c+t1-b)

    if t2<=a:
      m2=min(m2,c+(a-t2))
    elif t2<=b:
      m2=min(m2,c)
    else:
      m2=min(m2,c+t2-b)
    
  ans+=0.25*(m1+m2)
print(ans)
Problem p03608 (python)

Fixed submission:
N,M,C=[int(x) for x in str(input()).split()]
r=[int(x) for x in str(input()).split()]
ABC=[[0 for i in range(4)]]

dis=[[1000000000000 for i in range(N+1)]]

for i in range(N):
  dis.append([1000000000000 for i in range(N+1)])


for i in range(M):
  x=[0]+[int(x) for x in str(input()).split()]
  ABC.append(x)
  dis[x[1]][x[2]]=x[3]
  dis[x[2]][x[1]]=x[3]
  y=[0,x[2],x[1],x[3]]
  ABC.append(y)

for i in range(1,N+1):
  dis[i][i]=0


for k in range(1,N+1):
  for i in range(1,N+1):
    for j in range(1,N+1):
      dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j])


mi=1000000000000
def perm(a,i):
  global mi
  if i==len(a):      

    p=0
    for x in range(len(a)-1):
      p+=dis[a[x]][a[x+1]]

    mi=min(mi,p)


  else:
    for j in range(i,len(a)):
      a[i],a[j]=a[j],a[i]
      perm(a,i+1)
      a[i],a[j]=a[j],a[i]


perm(r,0)

print(mi)

Buggy submission (verdict: Runtime Error):
N,M,C=[int(x) for x in str(input()).split()]
r=[int(x) for x in str(input()).split()]
ABC=[[0 for i in range(4)]]

dis=[[100001 for i in range(N+1)]]

for i in range(N):
  dis.append([100001 for i in range(N+1)])


for i in range(M):
  x=[0]+[int(x) for x in str(input()).split()]
  ABC.append(x)
  dis[x[1]][x[2]]=x[3]
  dis[x[2]][x[1]]=x[3]
  y=[0,x[2],x[1],x[3]]
  ABC.append(y)

for i in range(1,N+1):
  dis[i][i]=0




from itertools import permutations
mi=1000000
BASH=[]
for item in permutations([int(i) for i in range(1,M+1)]):
    BASH.append(list(item))

for i in BASH:

  p=0
  for j in range(0,len(i)-1):
    p+=dis[i[j]][i[j+1]]
  mi=min(mi,p)
print(mi)

Buggy submission (verdict: Runtime Error):
N,M,C=[int(x) for x in str(input()).split()]
r=[int(x) for x in str(input()).split()]
ABC=[[0 for i in range(4)]]

dis=[[100001 for i in range(N+1)]]

for i in range(N):
  dis.append([100001 for i in range(N+1)])


for i in range(M):
  x=[0]+[int(x) for x in str(input()).split()]
  ABC.append(x)
  dis[x[1]][x[2]]=x[3]
  dis[x[2]][x[1]]=x[3]
  y=[0,x[2],x[1],x[3]]
  ABC.append(y)

for i in range(1,N+1):
  dis[i][i]=0




from itertools import permutations
mi=1000000
BASH=[]
for item in permutations([int(i) for i in range(1,M+1)]):
    BASH.append(list(item))

for i in BASH:

  p=0
  for j in range(0,len(i)-1):
    p+=dis[i[j]][i[j+1]]
  mi=min(mi,p)
print(mi)
Problem p03401 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
N = input()
A = map(int, input().split())
A = list(A)

A = [0] + A + [0]
total_sum = 0
for i in range(0, len(A) - 1):
    total_sum += abs(A[i + 1] - A[i])

for i in range(1, len(A) - 1):
    partial_sum = total_sum - abs(A[i + 1] - A[i]) - abs(A[i] - A[i - 1]) + abs(A[i + 1] - A[i - 1])
    print(partial_sum)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
N = input()
A = np.array(map(int, input().split()))


A = np.append(np.append([0], A), [0])
total_sum = 0
for i in range(0, len(A) - 1):
    total_sum += np.abs(A[i + 1] - A[i])

for i in range(1, len(A) - 1):
    partial_sum = total_sum - np.abs(A[i + 1] - A[i]) - np.abs(A[i] - A[i - 1]) + np.abs(A[i + 1] - A[i - 1])
    print(partial_sum)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
N = input()
A = np.array(map(int, raw_input().split()))


A = np.append(np.append([0], A), [0])
total_sum = 0
for i in range(0, len(A) - 1):
    total_sum += np.abs(A[i + 1] - A[i])

for i in range(1, len(A) - 1):
    partial_sum = total_sum - np.abs(A[i + 1] - A[i]) - np.abs(A[i] - A[i - 1]) + np.abs(A[i + 1] - A[i - 1])
    print partial_sum
Problem p02947 (python)

Fixed submission:
from collections import defaultdict

N = int(input())
s = defaultdict(lambda:0)
count=0

for i in range(N):
  a = "".join(sorted(input()))
  s[a] +=1
  
  if s[a] >1:
    count += s[a]-1
print(count)

Buggy submission (verdict: Runtime Error):
for i in range(N):
  a = list(input())
  a.sort()
  s.append(a)

duplicate_list = duplicates(s)

for i in range (len(duplicate_list)):
  for j in range (s.count(duplicate_list[i])):
    count += j

print(count)
Problem p03212 (python)

Fixed submission:
import itertools
N = int(input())
count = 0
for i in range(3, len(str(N)) + 1):
    for j in itertools.product('753', repeat=i):
        if int(''.join(j)) <= N and '3' in str(j) and '5'in str(j) and '7' in str(j):
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import itertools
N = int(input())
count = 0
for i in range(3, len(str(N)) + 1):
    for j in itertools.product('753', repeat=i):
        if int(''.join(j)) =< N and '3' in str(j) and '5'in str(j) and '7' in str(j):
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(f.input())
count = 0

for i in range(len(str(N))):
    for j in range(3 * (10**i), 4 * (10**i)):
        if j > N:
            break
        if '0' not in str(j) and '1' not in str(j) and '2' not in str(j) and '4' not in str(j) and '6' not in str(
                j) and '8' not in str(j) and '9' not in str(j) and('7' in str(j) and '5' in str(j) and '3' in str(j)):
            print(j)
            count += 1
    for j in range(5 * (10**i), 6 * (10**i)):
        if j > N:
            break

        if '0' not in str(j) and '1' not in str(j) and '2' not in str(j) and '4' not in str(j) and '6' not in str(
                j) and '8' not in str(j) and '9' not in str(j) and('7' in str(j) and '5' in str(j) and '3' in str(j)):
            print(j)
            count += 1

    for j in range(7 * (10**i), 8 * (10**i)):
        if j > N:
            break
        if '0' not in str(j) and '1' not in str(j) and '2' not in str(j) and '4' not in str(j) and '6' not in str(
                j) and '8' not in str(j) and '9' not in str(j) and('7' in str(j) and '5' in str(j) and '3' in str(j)):
            print(j)
            count += 1
    else:
        continue
    break

print(count)
Problem p02817 (python)

Fixed submission:
S, T = map(str, input().split())
print(T+S)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
while K > 0:
  if A > 0:
    A = A - 1
    K = K - 1
  elif A == 0 and B > 0:
    B = B - 1
    K = K - 1

print(str(A) + " " + str(B))
Problem p03085 (python)

Fixed submission:
b = input()
if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
elif b == 'G':
  print('C')

Buggy submission (verdict: Runtime Error):
b = input()
if b = 'A':
  print('T')
elif b = 'T':
  print('A')
elif b = 'C':
  print('G')
elif b = 'G':
  print('C')
Problem p03105 (python)

Fixed submission:
A, B, C = map(int, input().split())
D = B // A 
if D >=C:
  print(C)
else:
  print(D)

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
B // A = D
if D >=C:
  print(C)
else:
  print(D)
Problem p03206 (python)

Fixed submission:
D = int(input())
if D == 25:
  print('Christmas')
elif D == 24:
  print('Christmas Eve')
elif D == 23:
  print('Christmas Eve Eve')
elif D == 22:
  print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
D = int(input())
if D = 25:
  print('Christmas')
elif D = 24:
  print('Christmas Eve')
elif D = 23:
  print('Christmas Eve Eve')
elif D = 22:
  print('Christmas Eve Eve Eve')
Problem p03210 (python)

Fixed submission:
X = int(input())
if X == 3 or X == 5 or X == 7:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
X = int(input())
if X = 3 or 5 or 7:
  print('Yes')
else:
  print('No')
Problem p03238 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
if N == 1:
  print('Hello World')
elif N == 2:
  S = A + B
  print(S)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if a // 2 == a / 2 or b // 2 == b / 2:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
a, b = int(input().split())
if a // 2 == a / 2 or b // 2 == b / 2:
  print('Even')
else:
  print('Odd')
Problem p02687 (python)

Fixed submission:
a=input()

if a =="ABC":
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
a=[int(input())]
if a==("ABC"):
	print("ARC")
else:
  	print("ABC")
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if (a*b)%2:
   print('Odd')
else:
   print('Even')

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

if a * b % 2 == 0:
   print('Even')
else:
   print('Odd')
Problem p03288 (python)

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

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

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

Buggy submission (verdict: Runtime Error):
n,a,b = map(int, input().split())
if a*n >= b:
    print(b)
else:
    print(
Problem p03563 (python)

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

Buggy submission (verdict: Runtime Error):
r = int(input())
g = int(input())
print(2g-r)

Buggy submission (verdict: Runtime Error):
r = int(input())
g = int(input())
pri
Problem p02687 (python)

Fixed submission:
S = input()
if S == "ABC":
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
sum = [i + 1 + x for i, x in enumerate(p)]
dif = [i + 1 - x for i, x in enumerate(p)]
ans = 0

for i in range(N):
    ans += sum.count(dif[i])

print(ans)
Problem p02818 (python)

Fixed submission:
A,B,K = map(int, input().split())
 
if A >= K:
  A = A-K
else:
  if B >= (K-A):
    B = B - (K-A)
    A = 0
  else:
    A = 0
    B = 0
    
print(A,B)

Buggy submission (verdict: Runtime Error):
A,B,K = int(input()).split()
 
if A >= K:
  A = A-K
else:
  if B >= (K-A):
    A = 0
    B = B - (K-A)
  else:
    A = 0
    B = 0
    
print(A,B)

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

if(A>K):
  A = A-K
else:
  if(B>K):
    A = 0
    B = B - K
  else:
    A = 0
    B = 0
    
print(A,B)
Problem p03238 (python)

Fixed submission:
N = int(input())

if N == 1:
  print("Hello World")
elif N ==2:
  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")
elif N == 2:
  print(A+B)
Problem p03352 (python)

Fixed submission:
X = int(input())

beki = []

for i in range(1,33):
  for j in range(2,10):
    if i**j <= X:
      beki.append(i**j)

print(max(beki))

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

beki = []

for i in range(2,14):
  for j in range(2,10):
    if i**j <= 1000:
      beki.append(i**j)

new_beki=[e for e in beki if e <= X]
print(max(new_beki))
Problem p02681 (python)

Fixed submission:
import re

a = input()
b = input()

if re.match(f'^{a}.$', b):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
[a, b, h] = [int(input()) for i in range(3)]


result = (a + b) * h // 2
print(result)
Problem p02765 (python)

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

if n>=10:
    print(r)
else:
    print(r+(100*(10-n)))

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

while n  >= k: 
    n = n // k
    t += 1
    
print(t+1)
Problem p02812 (python)

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

ans = 0

for i in range(n-2):
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                ans += 1
print(ans)

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

ans = 0

for i in range(n):
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                ans += 1
print(ans)
Problem p02945 (python)

Fixed submission:
a, b = map(int, input().split())
s = a+b
t = a-b
u = a*b

if s >= t:
    if s >= u:
        print(s)
    else:
        print(u)
elif t >= u:
    if t >= s:
        print(t)
    else:
        print(s)
elif u >= s:
    if u >= t:
        print(u)
    else:
        print(t)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = a+b
t = a-b
u = a*b

if s >= t:
    if t >= u:
        print(s)
    elif s <= u:
        print(u)
else:
    if s >= u:
        print(t)
    elif:
        t <= u:
        print(u)
Problem p02969 (python)

Fixed submission:
r = int(input())

print(3*(r**2))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]

m = max(a)

for i in range(n):
    if m >= a[i]:
        print(m)
    else:
        b = a[i]
        a.remove(b)
        print(max(a))
        a.insert(i,b)