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

Fixed submission:

P = [11, 31, 41, 61, 71, 101, 131,
     151, 181, 191, 211, 241, 251,
     271, 281, 311, 331, 401, 421,
     431, 461, 491, 521, 541, 571,
     601, 631, 641, 661, 691, 701,
     751, 761, 811, 821, 881, 911,
     941, 971, 991, 1021, 1031, 1051,
     1061, 1091, 1151, 1171, 1181,
     1201, 1231, 1291, 1301, 1321,
     1361, 1381]

print " ".join(map(str, P[:input()]))

Buggy submission (verdict: Runtime Error):
S = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
        31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
        73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
        127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
        179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
        233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
        283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
        353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
        419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
        467, 479, 487, 491, 499, 503, 509, 521, 523, 541]

N = int(input())

ans = [S[0], S[2], S[4], S[6], S[8]]

for i in range(N-5):
    ans.append(S[int(10+i*2)])
Problem p03363 (python)

Fixed submission:
import math

N = int(input())

a = list(map(int, input().split()))
b = [a[0] for i in range(N)]

for i in range(1, N):
    b[i] = b[i-1] + a[i]
    
b.sort()
c = 1
ans = 0

def P(n, r):
    return math.factorial(n)//math.factorial(n-r)   

def C(n, r):
    return P(n, r)//math.factorial(r)

if N==1:
    if b[0]==0:
        print(1)
    else:
        print(0)
else:
    for i in range(1, N):
        if b[i]==b[i-1]:
            c = c+1
        else:
            if c>1:
                ans = ans + C(c, 2)
            if b[i-1]==0:
                ans = ans + c
            c=1
    else:
        if c>1:
            ans = ans + C(c, 2)
        if b[i-1]==0:
            ans = ans + c
    
    print(ans)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

a = list(map(int, input().split()))
b = [a[0] for i in range(N)]

for i in range(1, N):
    b[i] = b[i-1] + a[i]
    
b.sort()
c = 1
ans = 0

def P(n, r):
    return math.factorial(n)//math.factorial(n-r)   

def C(n, r):
    return P(n, r)//math.factorial(r)

for i in range(1, N):
    if b[i]==b[i-1]:
        c = c+1
    else:
        if c>1:
            ans = ans + C(c, 2)
        if b[i-1]==0:
            ans = ans + c
        c=1
else:
    if c>1:
        ans = ans + C(c, 2)
    if b[i-1]==0:
        ans = ans + c
        
print(ans)
Problem p03407 (python)

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

if a+b>=c:
    print("Yes")
else:
    print("No")

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

if a==c or b==c or a+b==c
    print("Yes")
else:
    print("No")
Problem p03437 (python)

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

if a%b==0:
	print('-1')
else:
	print(a)

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

if a%b==0:
	print(-1)
else
	print(a)
Problem p03447 (python)

Fixed submission:
X = int(input())
A = int(input())
B = int(input())

print((X-A)%B)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 17 23:38:43 2018

@author: ashida
"""

N=int(input())

A1 = list( map(int, input().split()))
A2 = list( map(int, input().split()))

SA1 = [0]*N
SA2 = [0]*N

SA1[0] = A1[0]
SA2[N-1] = A2[N-1]

for i in range(N-1):
    SA1[i+1] = SA1[i]+A1[i+1]
    SA2[N-2-i] = SA1[N-1-i]+A1[N-2-i]
    
ans = [0]*N

for i in range(N):
    ans[i] = SA1[i]+SA2[i]

print(max(ans))
Problem p03448 (python)

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())

count = 0

for ac in range(A+1):
    for bc in range(B+1):
        for cc in range(C+1):
            if 500*ac+100*bc+50*cc == X:
                count += 1

print(count)

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

count = 0

for ac in range(A)
    for bc in range(A)
        for cc in range(A)
            if 500*ac+100*bc+50*cc == X:
                count += 1

print(count)
Problem p03449 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 17 23:38:43 2018

@author: ashida
"""

N=int(input())

A1 = list( map(int, input().split()))
A2 = list( map(int, input().split()))

SA1 = [0]*N
SA2 = [0]*N

SA1[0] = A1[0]
SA2[N-1] = A2[N-1]

for i in range(N-1):
    SA1[i+1] = SA1[i]+A1[i+1]
    SA2[N-2-i] = SA2[N-1-i]+A2[N-2-i]
    
ans = [0]*N

for i in range(N):
    ans[i] = SA1[i]+SA2[i]

print(max(ans))

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

A1 = list(int, input().split())
A2 = list(int, input().split())

SA1 = [0]*N
SA2 = [0]*N

SA1[0] = A1[0]
SA2[N-1] = A2[N-1]

for i in range(N-1):
    SA1[i+1] = SA1[i]+A1[i+1]
    SA2[N-2-i] = SA1[N-1-i]+A1[N-2-i]
    
ans = [0]*N

for i in range(N):
    ans[i] = SA1[i]+SA2[i]

print(max(ans))
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):
A,B = map(int, input(.split()))

if A*B%2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03456 (python)

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

if b<10:
    N=10*a+b
elif b<100:
    N=100*a+b
else:
    N=1000*a+b
    
flag = -1

for i in range(317):
    if i*i == N:
        flag=1

if flag==1:
    print("Yes")
else:
    print("No")

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

if b<10:
    N=10*a+b
elif b<100:
    N=100*a+b
else:
    N=1000*a+b
    
flag = -1

for i in range(317):
    if i*i == N:
        flag=1

if flag==1
    print("Yes")
else:
    print("No")
Problem p03469 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 19 03:01:30 2018

@author: ashida
"""

S = list(input())

S[3]="8"

print("".join(S))

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

S[3]="8"

print(S)
Problem p03478 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 20 16:39:29 2018

@author: Yuya
"""

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

sum_k=0

for i in range(N+1):
    if i <10:
        k=i
    elif i<100:
        k=i//10+i%10
    elif i<1000:
        k=i//100+(i%100)//10+(i%100)%10
    elif i<10000:
        k=i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
    else:
        k=1
    if A<=k and k<=B:
        sum_k=sum_k+i
      
print(sum_k)

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

sum_k=0

for i in range(N+1):
    if i <10:
        k=i
    elif i<100:
        k=i//10+i%10
    elif i<1000:
        k=i//100+(i%100)//10+(i%100)%10
    else:
        k=1
    if A<=k and k<=B
        sum_k=sum_k+i
      
print(sum_k)
Problem p03487 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 22 10:08:31 2018

@author: Yuya
"""

N=int(input())

a = list(map(int, input().split()))



#count_sum=0
#count = 1
#
#for i in range(N-1):
#    flag=-1
#    if a[i+1]!=a[i]:
#        if count>a[i]:
#            count_sum += count-a[i]
#        elif count<a[i]:
#            count_sum += count
#        count=1
#        flag=1
#    else:
#        count+=1
#
#if flag==-1:
#    if count>a[N-1]:
#        count_sum += count-a[N-1]
#    elif count<a[N-1]:
#        count_sum += count
#
#print(count_sum)

count_a = [0]*100000
ans = 0

for i in range(N):
    if a[i]<100001:
        count_a[a[i]-1] += 1
    else:
        ans += 1


for i in range(100000):
    if i+1<count_a[i]:
        ans+=count_a[i]-i-1
    elif i+1>count_a[i]:
        ans+=count_a[i]

print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 22 10:08:31 2018

@author: Yuya
"""

N=int(input())

a = list(map(int, input().split()))

a.sort()
count_sum=0
count = 1

for i in range(N-1):
    flag=-1
    if a[i+1]!=a[i]:
        if count>a[i]:
            count_sum += count-a[i]
        elif count<a[i]:
            count_sum += count
        count=1
        flag=1
    else:
        count+=1

if flag==-1:
    if count>a[N-1]:
        count_sum += count-a[N-1]
    elif count<a[N-1]:
        count_sum += count

print(count_sum)
Problem p03555 (python)

Fixed submission:
A=list(input())
B=list(input())

B.reverse()

if A==B:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A=input()
B=input()

B.reverse()

if A==B:
    print("Yes")
else:
    print("No")
Problem p03609 (python)

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

if x<t:
	ans=0
else:
	ans=x-t

print(ans)

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

if x<t:
	ans=0
else
	ans=x-t

print(ans)
Problem p03611 (python)

Fixed submission:
N=int(input())

a = list(map(int, input().split()))

a_max=100001
ans=[0]*(a_max)

for i in range(N):
    ans[a[i]]+=1

ll = [ans[0], ans[0]+ans[1], ans[a_max-2]+ans[a_max-1], ans[a_max-1]]

ans_a=max(ll)

for i in range(a_max-2):
    aa = ans[i]+ans[i+1]+ans[i+2]
    if aa>ans_a:
        ans_a=aa
    
print(ans_a)

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

a = list(map(int, input().split()))

ans=[0]*max(a)

for i in range(N):
    ans[a[i]-1]+=1

ll = [ans[0], ans[0]+ans[1], ans[N-2]+ans[N-1], ans[N-1]]

ans_a=max(ll)

for i in range(N-2):
    aa = ans[i]+ans[i+1]+ans[i+2]
    if aa>ans_a:
        ans_a=aa
    
print(ans_a)
Problem p03626 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Tue Jul  3 10:58:30 2018

@author: ashida
"""
N=int(input())

S1=list(input())
S2=list(input())

if len(S1)>1:
    if S1[0]==S1[1]:
        st=2
        ans=6
        flag=1
    else:
        st=1
        ans=3
        flag=-1
else:
    st=1
    ans=3
    flag=-1

while st<N:
    if st+1<N:
        if S1[st]==S1[st+1]:
            if flag<0:
                ans*=2
            else:
                ans*=3
            st+=2
            flag=1
        else:
            if flag<0:
                ans*=2
            else:
                ans*=1
            st+=1
            flag=-1
    else:
        if flag<0:
            ans*=2
        else:
            ans*=1
        st+=1
        
ans=ans%1000000007
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Tue Jul  3 10:58:30 2018

@author: ashida
"""
N=int(input())

S1=list(input())
S2=list(input())

if S1[0]==S1[1]:
    st=2
    ans=6
    flag=1
else:
    st=1
    ans=3
    flag=-1

while st<N:
    if st+1<N:
        if S1[st]==S1[st+1]:
            if flag<0:
                ans*=2
            else:
                ans*=3
            st+=2
            flag=1
        else:
            if flag<0:
                ans*=2
            else:
                ans*=1
            st+=1
            flag=-1
    else:
        if flag<0:
            ans*=2
        else:
            ans*=1
        st+=1
        
ans=ans%1000000007
print(ans)
Problem p03739 (python)

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

ans1=0
ans2=0

now=0

for i in range(n):
    now+=a[i]
    if i%2==0:
        if now<=0:
            ans1+=1-now
            now=1
    else:
        if now>=0:
            ans1+=now+1
            now=-1

now=0

for i in range(n):
    now+=a[i]
    if i%2==1:
        if now<=0:
            ans2+=1-now
            now=1
    else:
        if now>=0:
            ans2+=now+1
            now=-1

#print(ans1,ans2)
print(min([ans1,ans2]))

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

now=a[0]
flag=abs(a[0])//a[0]
c=0
#print(c,flag)

for i in range(1,n):
    tmp=now+a[i]
    if not tmp*flag<0:
        c+=abs(flag*-1-tmp)
        now=flag*-1
    else:
        now=tmp
    flag*=-1
    #print(c,flag)

print(c)
Problem p03828 (python)

Fixed submission:
mod=1000000007

k=int(input())

if k==1:
    print(1)
    exit()
elif k==2:
    print(2)
    exit()
    
counter = 0
primes = [2, 3]

for n in range(5, k+1, 2):
    isprime = True
    for i in range(0, len(primes)):
        counter+=1
        if primes[i]**2 > n:
            break
        counter += 1
        if n % primes[i] == 0:
            isprime = False
            break
    if isprime:
        primes.append(n)    

#print(primes)
num=[0]*(k+1)

for i in range(1,k+1):
    for a in primes:
        b=i
        while b>1:
            if b%a==0:
                num[a]+=1
                b=b//a
            else:
                break

ans=1
        
for a in primes:
    if num[a]>0:
        ans=ans*(num[a]+1)%mod
        
#print(num)
print(ans)

Buggy submission (verdict: Runtime Error):
mod=1000000007

k=int(input())

counter = 0
primes = [2, 3]

for n in range(5, k+1, 2):
    isprime = True
    for i in range(0, len(primes)):
        counter+=1
        if primes[i]**2 > n:
            break
        counter += 1
        if n % primes[i] == 0:
            isprime = False
            break
    if isprime:
        primes.append(n)    

#print(primes)
num=[0]*(k+1)

for i in range(1,k+1):
    for a in primes:
        b=i
        while b>1:
            if b%a==0:
                num[a]+=1
                b=b//a
            else:
                break

ans=1
        
for a in primes:
    if num[a]>0:
        ans=ans*(num[a]+1)%mod
        
#print(num)
print(ans)
Problem p03860 (python)

Fixed submission:
s=list(map(str,input().split()))

print(''.join([s[0][0],s[1][0],s[2][0]]))

Buggy submission (verdict: Runtime Error):
s=list(map(str,input().split()))

print(''.join([s[0][0],s[1][0],s[2][0]]))s=list(map(int,input().split()))
Problem p03861 (python)

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

f=0

if b%c==0 and a%c==0:
    f+=1

if a==0 and b==0:
    print(1)
elif a==0:
    print(b//c+1)
else:
    print(b//c-(a-1)//c)

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

f=0

if b%c==0 and a%c==0:
    f+=1
if a==0 and b>0:
    f+=1

print(b//c-a//c+f)a,b,c=map(int,input().split())

f=0

if b%c==0 and a%c==0:
    f=1

print(b//c-a//c+f)
Problem p03944 (python)

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

ma_x=w
ma_y=h
mi_x=0
mi_y=0

for i in range(n):
    x,y,a=map(int,input().split())
    if a==1:
        if mi_x<x:
            mi_x=x
    elif a==2:
        if ma_x>x:
            ma_x=x
    elif a==3:
        if mi_y<y:
            mi_y=y
    elif a==4:
        if ma_y>y:
            ma_y=y

if ma_x-mi_x<0 and ma_y-mi_y<0:
  ma_x=mi_x
            
ans=(ma_x-mi_x)*(ma_y-mi_y)

if ans<0:
    ans=0

print(ans)

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

ma_x=w
ma_y=h
mi_x=0
mi_y=0

for i in range(n):
    x,y,a=map(int,input().split())
    if a==1:
        if mi_x<x:
            mi_x=x
    elif a==2:
        if ma_x>x:
            ma_x=x
    elif a==3:
        if mi_y<y:
            mi_y=y
    elif a==4:
        if ma_y>y:
            ma_y=y

if ma_x-mi_x<0 and ma_y-mi_y<0:
  ma_x-mi_x=0
            
ans=(ma_x-mi_x)*(ma_y-mi_y)

if ans<0:
    ans=0

print(ans)
Problem p04029 (python)

Fixed submission:
N=int(input())

print((1+N)*N//2)

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

print((1+N)*N//2)
Problem p03136 (python)

Fixed submission:
n = int(input())
t = list(map(int,input().split()))
a = max(t)
if a < (sum(t) - a):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
t = list(map(int,input().split()))
a = max(t)
if a < sum(t.remove(a)):
  print("Yes")
else:
  print("No")
Problem p03220 (python)

Fixed submission:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = []
for i in range(n):
  ans.append(abs((t-h[i]*0.006)-a))
print(ans.index(min(ans))+1)

Buggy submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = []
for i in range(n):
  ans.append(abs((t-h[i]*0.06)-a))
print(ans.index(min(a))+1)

Buggy submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = []
for i in range(n):
  ans.append(abs((t-h[i]*0.06)-a))
print(a.index(min(a))+1)
Problem p03251 (python)

Fixed submission:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
a.append(x)
b = list(map(int,input().split()))
b.append(y)
for i in range(x+1,y+1):
  if max(a) < i <= min(b):
    print("No War")
    break
else:
  print("War")

Buggy submission (verdict: Runtime Error):
n,m,x,y = map(int,input().split())
a = [int(input()) for i in range(n)]
a.append(x)
b = [int(input()) for i in range(m)]
b.append(y)
for i in range(x+1,y+1):
  if max(a) < i <= max(b):
    print("No War")
else:
  print("War")
Problem p03264 (python)

Fixed submission:
n = int(input())
a = 0
if n%2 == 0:
  a = (n/2)**2
else:
  a = (n**2-1)/4
print(int(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = 0
if n % 2:
  a = (n/2)^2
else:
  a = (n^2-1)/4
print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n%2:
  a = (n/2)^2
else: 
  a = (n-1)/2 *(n+1)/2
print(a)
Problem p03274 (python)

Fixed submission:
N,K = map(int,input().split())
a = list(map(int,input().split()))
b = []
dis = N-K+1
for i in range(dis):
  b.append(min(abs(a[i])+abs(a[i]-a[i+K-1]),abs(a[i+K-1])+abs(a[i+K-1]-a[i])))
print(min(b))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
a = list(map(int,input().split()))
b = []
for i in range(N-K+1):
  b.append(min(abs(a[i])+abs(a[i+k-1]-a[i]),abs(a[i+k-1])+abs(a[i+k-1]-a[i])))
print(min(b))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
a = list(map(int,input().split()))
b = []
dis = N-K+1
for i in range(dis):
  b.append(min(abs(a[i])+abs(a[i]-a[i+dis-1]),abs(a[i+dis-1])+abs(a[i+dis-1]-a[i])))
print(min(b))
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
if K == 1 and S[0] == "1":
  print(1)
elif S[0] == "1":
  print(S[1])
else:
  print(S[0])

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
if K == 1 and S[0] == 1:
  print(1)
elif K != 1 and S[0] == 1:
  print(S[1])
else:
  print(S[0])
Problem p03281 (python)

Fixed submission:
n = int(input())
ans = 0
def cou(n):
  d = 0
  for i in range(1,n+1):
    if n % i == 0:
      d += 1
  return(d)
for j in range(1,n+1,2):
  if cou(j) == 8:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = 0
d = 0
for i in range(n):
  for j in range(1,n,2):
    if j % i == 0:
      c += 1
      if c == 8:
        d += 1
print(d)
Problem p03289 (python)

Fixed submission:
s = input()
if s[0] == "A" and s[2:-1].count("C") == 1:
  i = s.index("C")
  ss = s[1:i] + s[i+1:]
  if ss.islower() == True:
    print("AC")
  else:
    print("WA")
else:
  print("WA")

Buggy submission (verdict: Runtime Error):
s = input()
sa = s.index("A")
sc = s.index("C")
scr = s.rindex("C")
if sa == 1 and sc == scr and 2 <= sc <= len(s) - 3
Problem p03293 (python)

Fixed submission:
s = input()
t = input()
for i in range(len(s)):
  if s == t:
    print("Yes")
    break
  else:
    t = t[-1] + t[:-1]
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = list(input()).sorted()
b = list(input()).sorted()
if a == b:
  print("Yes")
else:
  print("No")
Problem p03316 (python)

Fixed submission:
n = int(input())
s = 0
for i in range(len(str(n))):
  s += int(list(str(n))[i])
if n % s == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = 0
for i in range(len(str(n))):
  s += list(str(n))[i]
if n % s == 0:
  print("Yes")
else:
  print("No")
Problem p03338 (python)

Fixed submission:
n = int(input())
s = list(input())
a = {}
b = {}
c = []
for i in range(n):
  a = set(s[:i+1])
  b = set(s[i+1:])
  c.append(len((a&b)))
  a.clear()
  b.clear()
print(max(c))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())
a = {}
b = {}
c = []
for i in range(n//2):
  a = set([:i+1])
  b = set([i+1:])
  c.append(len((a^b)))
  a.clear()
  b.clear()
print(max(c))
Problem p03352 (python)

Fixed submission:
x = int(input())
a = []
for i in range(1,32):
  for j in range(2,9):
    if i ** j <= x:
      a.append(i**j)
print(max(a))

Buggy submission (verdict: Runtime Error):
import math 

x = int(input())
a = []
if x == 1:
  print(1)
else:
  for i in range(1,x):
    for j in range(2,32):
      if math.log(i,j).is_integer() == True:
        a.append(i)
print(max(a))

Buggy submission (verdict: Runtime Error):
import math 

x = int(input())
a = []
if x == 1:
  print(1)
for i in range(1,x):
  for j in range(2,32):
    if math.log(i,j).is_integer() == True:
      a.append(i)
print(max(a))

Buggy submission (verdict: Runtime Error):
import math 

x = int(input())
a = []
for i in range(1,x):
  for j in range(2,32):
    if math.log(i,j).is_integer() == True:
      a.append(i)
print(max(a))

Buggy submission (verdict: Runtime Error):
import math

x = int(input())
a = []
for i in range(1,x):
  for j in range(2,10):
    if math.log(i,j).is_integer() == True:
      a.append(i)
print(max(a))
Problem p03360 (python)

Fixed submission:
a = list(map(int,input().split()))
k = int(input())
a.sort(reverse = True)
a[0] = a[0]*2**k
print(sum(a))

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
k = int(input())
a.sort(reverse = True)
a[0] = a*2**k
print(sum(a))
Problem p03369 (python)

Fixed submission:
s = input()
c = 0
for i in range(3):
  if s[i] == "o":
    c += 1
print(700 + c*100)

Buggy submission (verdict: Runtime Error):
s = input()
c = 0
for i in range(3):
  if a[i] == "○":
    c += 1
print(700 + 100*c)
Problem p03378 (python)

Fixed submission:
n,m,x = map(int,input().split())
a =list(map(int,input().split()))
c1 = 0
c2 = 0
for i in range(x):
  if i in a:
    c1 += 1
for i in range(x,n):
  if i in a:
    c2 += 1
print(min(c1,c2))

Buggy submission (verdict: Runtime Error):
n,m,x = map(int,input().split())
a = [int(input()) for i in range(m)]
c1 = 0
c2 = 0
for i in range(x):
  if i in a:
    c1 += 1
for i in range(x,n):
  if i in a:
    c2 += 1
print(min(c1,c2))
Problem p03379 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
c = sorted(a)
mid1 = c[n//2-1]
mid2 = c[n//2]
if mid1 == mid2:
  for i in range(n):
    print(mid1)
  exit()
for i in range(n):
  if a[i] <= mid1:
    print(mid2)
  else:
    print(mid1)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
for i in range(n):
  a = x[:i] + x[i+1:]
  a.sort()
  print(a[n//2])

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
for i in range(n):
  a = x[:i] + x[i+1:]
  print(a[n//2])
Problem p03385 (python)

Fixed submission:
s = list(input())
if len(set(s)) == 3:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
inte = []
if k >= (b-a+1) // 2:
  k = (b-a+1) // 2
for i in range(a,a+k):
  inte.append(i)
for i in range(b-k+1,b+1):
  inte.append(i)
for i in range(len(set(inte))):
  print(list(set(inte))[i])
Problem p03387 (python)

Fixed submission:
a = list(map(int,input().split()))
m = max(a)
s = sum(a)
if (m-s) % 2 == 0:
  print((3*m-s)//2)
else:
  print((3*(m+1)-s)//2)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
if max(a) % sum(a) == 0:
  print((max(a)*3 - sum(a)) // 2)
else:
  print(((max(a)+1)*3 - sum(a)) // 2)
Problem p03407 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a + b >= c:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
from operator import itemgetter

n = int(input())
r = []
b = []
c = 0
for i in range(n):
  r.append(list(map(int,input().split())))
for i in range(n):
  b.append(list(map(int,input().split())))
r.sort(key = itemgetter(1),reverse = True)
b.sort(key = itemgetter(0))
for i in range(n):
  for j in range(n):
    if b[i][0] > r[j][0] and b[i][1] > r[j][1]:
      r[j] = [10**6,10**6]
      c += 1
      break
print(c)