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

Fixed submission:
n = int(input())
s = str(input())
r = []
g = []
b = []
for i in range(n):
    if s[i] == "R":
        r.append(i+1)
    elif s[i] == "G":
        g.append(i+1)
    else:
        b.append(i+1)
cnt=len(r)*len(g)*len(b)
if n<=3:
    print(0)
    exit()
for i in range(n-2):
    for j in range(i+1,n-1):
        if j*2-i<n:
            if s[i]!=s[j] and s[j]!=s[j*2-i] and s[j*2-i]!=s[i]:
                cnt-=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = 39
s = str(input())
r = []
g = []
b = []
for i in range(n):
    if s[i] == "R":
        r.append(i+1)
    elif s[i] == "G":
        g.append(i+1)
    else:
        b.append(i+1)
cnt = 0
for i in r:
    for j in g:
        if (i+j)%2==0:
            if (i + j) // 2 in b:
                cnt += 1
        if (2 * j) - i in b:
            cnt += 1
        if (2 * i) - j in b:
            cnt += 1
print((len(r) * len(g) * len(b))-cnt)
Problem p02722 (python)

Fixed submission:
n=int(input())
def prime_factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f**2<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return(a)

import collections
A=collections.Counter(prime_factorize(n-1))
ans=1
cnt=0
for a,b in A.items():
    ans*=(b+1)

import math
li=[]
for i in range(2,math.floor(n**0.5)+1):
    if n%i==0:
        li.append(i)
        if i!=n//i:
            li.append(n//i)
li.append(n)
for i in li:
    x = n
    while x % i == 0:
        x //= i
    if x % i == 1:
        cnt += 1
print(ans - 1 + cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
def prime_factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f**2<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return(a)

import collections
A=collections.Counter(prime_factorize(n-1))
B=collections.Counter(prime_factorize(n))
ans=1
cnt=0
for a,b in A.items():
    ans*=(b+1)

import math
for i in range(1,math.floor(n**0.5)+1):
    if n%i==0:
        if j in B.keys():
            if (n // (j ** B[j])) % j == 1:
                cnt+=1
        else:
            if (n//i)%i==1:
                cnt+=1
                
        if (i-1)%(n//i)==0:
            cnt+=1
            
print(ans-1+cnt)
Problem p02744 (python)

Fixed submission:
n=int(input())
li=["a"]
alpha=["a","b","c","d","e","f","g","h","i","j"]
if n==1:
    print("a")
    exit()
else:
    for i in range(n-1):
        ans=[]
        for j in range(len(li)):
            for k in range(len(set(li[j]))+1):
                ans.append(li[j]+alpha[k])
        li=ans
for i in range(len(ans)):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
n=int(input())
li=["a"]
alpha=["a","b","c","d","e","f","g","h","i","j"]
if n==1:
    print("a")
else:
    for i in range(n-1):
        ans=[]
        for j in range(len(li)):
            if len(set(li[j]))==1:
                ans.append(li[j]+"a")
                ans.append(li[j]+"b")
            else:
                for k in range(i+2):
                    ans.append(li[j]+alpha[k])
        li=ans
for i in range(len(ans)):
    print(ans[i])
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())
cnt=0
while n!=0:
    n=n//k
    cnt+=1
print(cnt)
Problem p02780 (python)

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[0]
for i in range(n):
    b.append(b[-1]+a[i])
max=0
for j in range(k,len(b)):
    if max<b[j]-b[j-k]:
        max=b[j]-b[j-k]
print((max+k)/2)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[0]
for i in range(n):
    b.append(b[-1]+a[i])
max=0
for j in range(k,len(b)+1):
    if max<b[j]-b[j-k]:
        max=b[j]-b[j-k]
print((max+k)/2)
Problem p02796 (python)

Fixed submission:
n=int(input())
ans=0
cnt=-(10**9)-1
li=[]
for i in range(n):
    X,L=map(int,input().split())
    li.append([X+L,L])
li=sorted(li,key=lambda x:x[0])
for i in range(n):
    if cnt>li[i][0]-li[i][1]*2:
        ans+=1
    else:
        cnt=li[i][0]
print(n-ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=0
ans=0
cnt=-(10**9)-1
cnt2=(10**9)*2
li=[]
li2=[]
for i in range(n):
    X,L=map(int,input().split())
    li.append([X-L,L])
    li2.append([X+L,L])
li=sorted(li,key=lambda x:x[0])
for i in range(n):
    if cnt>li[i][0]:
        ans+=1
    else:
        cnt=li[i][0]+li[i][1]*2
li2=sorted(li2,key=lambda x:x[0],reverse=True)
for i in range(1,n):
    if cnt2<li[i][0]:
        ans2+=1
    else:
        cnt2=li[i][0]-li[i][1]*2
print(n-min(ans,ans2))
Problem p02814 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
import math
def gcd(x,y):
    if x%y==0:
        return y
    else:
        return gcd(y,x%y)
def lcm(x,y):
    return x*y//gcd(x,y)
a[0]=a[0]//2
l=a[0]
cnt=0
while a[0]%2==0:
    a[0]=a[0]//2
    cnt+=1
    
for i in range(1,n):
    a[i]=a[i]//2
    l=lcm(l,a[i]) 
    x=0
    while a[i]%2==0:
        a[i]=a[i]//2
        x+=1
    if x!=cnt:
        print(0)
        exit()

print(((m//l-1)//2)+1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
def gcd(x,y):
    if x%y==0:
        return y
    else:
        return gcd(y,x%y)  
def lcm(x,y):
    return x*y/gcd(x,y)  
g=1
for i in range(n):
    g=lcm(g,a[i])
print(1+int((m-max(a)//2)//g))
Problem p02866 (python)

Fixed submission:
n=int(input())
d=list(map(int,input().split()))
x=max(d)
li=[0]*(x+1)
for i in range(n):
    li[d[i]]+=1
if d[0]!=0 or li[0]!=1:
    print(0) 
else:
    ans=1
    for i in range(2,len(li)):
        ans*=pow(li[i-1],li[i],998244353)   
    print(ans%998244353)

Buggy submission (verdict: Runtime Error):
n=int(input())
d=list(map(int,input().split()))
c=[0]*n
ans=0
for i in range(0,n):
  c[d[i]]+=1

if d[0]!=0 or c[0]!=1:
  print(0)
  
else:
  for j in range(2,n-1):
    if c[j+1]!=0 and c[j]==0:
      ans=0
      break      
    elif c[j]==0 and c[j+1]==0:
      ans+=0
    else:
      ans*=c[j]**c[j-1]
      
  if c[n-2]==0　and c[n-1]!=0:
      ans=0
  elif c[n-2]==0 and c[n-1]==0:
    ans+=0
  elif:c[n-1]==0:
    ans+=0
  else:
    ans*=c[n-1]**c[n-2]
      
  print(int(ans%998244353))
Problem p02888 (python)

Fixed submission:
import bisect
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(0,n-1):
  for j in range(i+1,n):
    x=l[i]+l[j]
    y=bisect.bisect_left(l,x)-1
    ans+=max((y-j),0)
    
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
ans=0
for i in range(0,n-2):
  for j in range(i+1,n-1):
    x=l[i]+l[j]
    y=bisect.bisect_left(l,x)-1
    ans+=max((y-j),0)
    
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[map(int,input().split())]
l.sort()
ans=0
for i in range(0,n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if l[k]<l[i]+l[j]:
        ans+=1
        
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[map(int,input().split)]
l.sort()
ans=0
for i in range(0,n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if l[k]<l[i]+l[j]:
        ans+=1
        
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=int(input())
ans=0
for i in range(0,len(l)):
    for j in range(i+1,len(l)):
        for k in range(j+1,len(l)):
            if l[i]>=l[j] and l[i]>=l[k]:
                if l[i]>l[j]+l[k]:
                    ans+=1
                else:
                    ans+=0
            if l[j]>=l[i] and l[j]>=l[k]:
                if l[j]>l[i]+l[k]:
                    ans+=1
                else:
                    ans+=0
            if l[k]>=l[i] and l[k]>=l[j]:
                if l[k]>l[i]+l[j]:
                    ans+=1
                else:
                    ans+=0   
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=int(input())
ans=0
for i in range(0,len(l)):
  for j in range(i+1,len(l)):
    for k in range(j+1,len(l)):
      if l[i]>=l[j] and l[i]>=l[k]:
        if l[i]>l[j]+l[k]:
          ans+=1
        else:
          ans+=0
      if l[j]>=l[i] and l[j]>=l[k]:
        if l[j]>l[i]+l[k]:
          ans+=1
        else:
          ans+=0
      if l[k]>=l[i] and l[k]>=l[j]:
        if l[k]>l[i]+l[j]:
          ans+=1
        else:
          ans+=0   
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(int,input())
ans=0
for i in range(0,len(l)):
  for j in range(i+1,len(l)):
    for k in range(j+1,len(l)):
      if l[i]>=l[j] and l[i]>=l[k]:
        if l[i]>l[j]+l[k]:
          ans+=1
        else:
          ans+=0
      if l[j]>=l[i] and l[j]>=l[k]:
        if l[j]>l[i]+l[k]:
          ans+=1
        else:
          ans+=0
      if l[k]>=l[i] and l[k]>=l[j]:
        if l[k]>l[i]+l[j]:
          ans+=1
        else:
          ans+=0   
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(int,input())
ans=0
for i in range(0,len(l)):
  for j in range(i+1,len(l)):
    for k in range(j+1,len(l)):
      if i>=j and i>=k:
        if i>j+k:
          ans+=1
        else:
          ans+=0
      if j>=i and j>=k:
        if j>i+k:
          ans+=1
        else:
          ans+=0
      if k>=i and k>=j:
        if k>i+j:
          ans+=1
        else:
          ans+=0   
print(ans)
Problem p02898 (python)

Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
x=0
for i in range(0,len(h)):
  if h[i]>=k:
    x+=1

print(x)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=map(int,input().split())
x=0
for i in range(0,len(h)):
  if h[i]>=k:
    x+=1

print(x)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=map(int,inout().split())
x=0
for i in range(0,len(h)):
  if h[i]>=k:
      x+=1

print(x)
Problem p02899 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
d=[0]*n
for i in range(0,n):
  d[a[i]-1]=i+1
print(*d)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=map(int,input().split())
d=[0]*n
for i in range(0,n):
  d[a[i]-1]=i+1
print(*d)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=map(int,input().split())
d=[0]*n
for i in range(0,n):
  d[a[i]-1]=i
print(*d)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
d=[0]*n
for i in range(0,n):
  d[a[i]]=i

print(*d)
Problem p02900 (python)

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

def gcd(x,y):
  if x%y==0:
    return y
  else:
    return gcd(y,x%y)
  
  
n=gcd(a,b)  
i=2
ans=[1]

while i * i <= n:
  if n % i == 0:
    n /= i
    ans.append(i)
  else:
    i += 1

ans.append(n)    
  
print(len(set(ans)))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
import numpy as np
def gcd(x,y):
  if x%y==0:
    return y
  else:
    return gcd(x,x%y)
  
  
  
z=np.ceil(np.sqrt(gcd(a,b)))
j=0
ans=[]
for i in range(1,z+1):
  while z%i==0:
    z/=i
    ans.append(i)
  

  
print(len(ans))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
def gcd(x,y):
  if x%y==0:
    return y
  else:
    return gcd(x,x%y)
  
z=gcd(a,b)
j=0
ans=[]
for i in range(0,z):
  if z%i==0:
    z/=i
    ans.append(i)
  else:
    j+=1
print(len(set(ans)))
Problem p02910 (python)

Fixed submission:
s=input()
x=0
for i in range(0,len(s),2):
  if s[i]=="L":
    x+=1
    
for j in range(1,len(s),2):
  if s[j]=="R":
    x+=1

if x==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
x=0
for i in range(0,len(s),2):
  if s[i]="L":
    x+=1
    
for j in range(1,len(s),2):
  if s[j]="R":
    x+=1

if x==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=list(map(input().split()))
x=0
for i in range(0,len(s),2):
  if s[i]="L":
    x+=1
    
for j in range(1,len(s),2):
  if s[j]="R":
    x+=1

if x==0:
  print("Yes")
else:
  print("No")
Problem p02911 (python)

Fixed submission:
import numpy as np
n,k,q=map(int,input().split())
a=[int(input()) for i in range(q)]
li=np.array([0]*n)
d=np.array([k-q]*n)

for j in range(0,len(a)):
  li[a[j]-1]+=1

  
ans=np.array(li+d)


for m in range(0,n):
  if ans[m]>0:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k,q=map(int,input().split())
a=[int(input()) for i in range(Q)]
li=np.array([0]*n)
d=np.array([k-q]*n)
for j in range(0,len(a)):
  li[a[j]-1]+=1

  
ans=np.array(li+d)


for m in range(0,n):
  if ans[m]>0:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k,q=map(int,input().split())
a=[int(input()) for i in range(Q)]
li=np.array([0]*n)
d=np.array([k-q]*n)
for j in range(0,len(a)):
    li[a[j]-1]+=1

    
ans=np.array(li+d)
print(ans)
for m in range(0,n):
    if ans[m]>0:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
a=[int(input()) for i in range(Q)]
li=[0]*n
d=[k-q]*n
for j in range(0,len(a)):
  li[a[j]-1]+=1
  
ans=li+d

for m in range(0,n):
  if ans[m]>0:
    print("Yes")
  else:
    print("No")
Problem p02917 (python)

Fixed submission:
n=int(input())
a=[0]*n
b=list(map(int,input().split()))
a[0]=b[0]
a[n-1]=b[n-2]
ans=0

for i in range(1,n-1):
  a[i]=min(b[i-1],b[i])

print(sum(a))

Buggy submission (verdict: Runtime Error):
n=int(input().split())
a=[0]*n
b=list(map(int,input().split()))
a[0]=b[0]
a[n-1]=b[n-2]

for i in range(1,n-1):
  a[i]=min(b[i-1],b[i])

print(sum(a))

Buggy submission (verdict: Runtime Error):
n=int(input().split())
a=[0]*n
b=list(map(input().split()))
a[0]=b[0]
a[n-1]=b[n-2]

for i in range(1,n-1):
  a[i]=min(b[i-1],b[i])

print(sum(a))

Buggy submission (verdict: Runtime Error):
n=int(input().split())
a=[0]*n
b=list(map(input().split()))
a[0]=b[0]
a[n-1]=b[n-2]

for i in range(1,n):
  a[i]=min(b[i-1],b[i])

print(sum(a))
Problem p02921 (python)

Fixed submission:
s=input()
t=input()
c=0
for i in range(3):
    if s[i]==t[i]:
        c+=1

print(c)

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

x=0
for i in renge(3):
  if s[i]==t[i]:
    x+=1
    
print(x)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
i=0
x=0
while i<=2:
  i+=1
  if s[i]==t[i]:
    x+=1
        
print(x)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
i=0
x=0
while i<=2:
  i+=1
  if S[i]==T[i]:
    x+=1
        
print(x)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
i=0
x=0
while i<=2:
  i+=1
  if S[i]==T[i]:
    X+=1
        
print(x)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
c=0
for i in range(3):
    if s[i]==t[i]:
        c+=1

print(c)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
i=0
x=0
while i<=2:
  i+=1
  if S[i]==T[i]:
    X+=1
        
print(x)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
num=range(1,4)
x=0
for i in num:
  if S[i]==T[i]:
    X+=1
print(x)
Problem p02922 (python)

Fixed submission:
A, B=map(int,input().split())
y=1
x=0
while y<B:
  y+=(A-1)
  x+=1
  
print(x)

Buggy submission (verdict: Runtime Error):
A, B=map(int,input().split())
y=1+(A-1)*x
x=0
while y<B:
  x+=1
print(x)
Problem p02946 (python)

Fixed submission:
K, X=map(int,input().split())
x=X-K+1
while x<=X+K-1:
  print(x)
  x+=1

Buggy submission (verdict: Runtime Error):
K, X=map(int,input().split())
print(x, for x in range(X-K+1,X+K))
Problem p02947 (python)

Fixed submission:
n=int(input())
dic={}
for _ in range(0,n):
  s="".join(sorted(input()))
  if s in dic:
    dic[s]+=1
  else:
    dic[s]=1
    
ans=0    
for a in dic.values():
  ans+=(a*(a-1))/2
  
print(int(ans))

Buggy submission (verdict: Runtime Error):
n=int(input().split())
dic={}
for i in range(0,n):
  s="".join(sorted(input()))
  if s in dic:
    dic[s]+=1
  else:
    dic[s]=1
    
ans=0    
for a in dic.values():
  ans+=(a*(a-1))/2
  
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=0
for i in range(0,n):
  s=input().split()
  s[i]=''.join(sorted(s))
  
for j in range(0,n-1):
  for k in range(j+1,n):
    if li[j]==li[k]:
      ans+=1
    else:
      ans+=0
      
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(map(str,input().split()))
li=[0]*n
ans=0
for i in range(0,n):
  li[i]=''.join(sorted(s[i]))
  
for j in range(0,n-1):
  for k in range(j+1,n):
    if li[j]==li[k]:
      ans+=1
    else:
      ans+=0
      
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(map(str,input().split()))
li=[0]*n
ans=0
for i in range(0,n):
  li[i]=sorted(s[i])
  
for j in range(0,n-1):
  for k in range(j+1,n):
    if li[j]==li[k]:
      ans+=1
    else:
      ans+=0
      
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(map(input().split()))
li=[0]*n
ans=0
for i in range(0,n):
  li[i]=sorted(s[i])
  
for j in range(0,n-1):
  for k in range(j+1,n):
    if li[j]==li[k]:
      ans+=1
    else:
      ans+=0
      
print(ans)

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

li=[0]*n
ans=0
for i in range(0,n):
  s=list(input().split())
  li[i]=sorted(s[i])
for j in range(0,n-1):
  for k in range(j+1,n):
    if li[j]==li[k]:
      ans+=1
      
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(map(input().split()))
li=[0]*n
ans=0
for i in range(0,n):
  li[i]=sorted(s[i])
for j in range(0,n):
  for k in range(j+1,n):
    if li[j]==li[k]:
      ans+=1
      
print(ans)
Problem p02953 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
max=h[0]
for i in range(n):
    if h[i]>max:
        max=h[i]-1
    elif h[i]<max:
        print("No")    
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans=0
for i in range(0,n-1):
  if h[i]>=h[i+1]+2:
    ans+=1
    break
  elif h[i]==h[i+1]+1:
    if ans=1:
      break
    else:
      ans+=1
  else:
    ans=0
if ans==0:
  print("Yes")
else:
  print("No")

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

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

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(input().split()))
ans=0
for i in range(0,n-1):
    if h[i]<=h[i+1]:
        ans+=0
    elif h[i]>=h[i+1]+2:
        ans+=1
    else:
        if i<n-2:
            if h[i+1]<=h[i+2]:
                ans+=0
            else:
                ans+=1    
        else:
            ans+=0
        
if ans==0:
    print("Yes")
else:
    print("No")
Problem p02957 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=int(input().split())
c=a+b
if c%2==0:
  print(int(c/2))
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a,b=int(input().split())
c=a+b
if c%2==0:
  print(c/2)
else:
  print("IMPOSSIBLE")
Problem p02958 (python)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
cnt=0
for i in range(0,n):
  if p[i]==i+1:
    cnt+=0
  else:
    cnt+=1
    
if cnt<=2:
  print("YES")
else:
  print("NO")

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

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

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

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(int,input().split(), for _ in range(0,n))
x=max(a)
y=a.index(x)
del a[y]
z=max(a)

for i in range(0,n):
  if i!=y:
    print(x)
  else:
    print(z)
Problem p02971 (python)

Fixed submission:
n=int(input())
a=[]

for j in range(0,n):
  a.append(int(input()))
  
x=max(a)
y=a.index(x)
del a[y]
z=max(a)

for i in range(0,n):
  if i!=y:
    print(x)
  else:
    print(z)

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

for j in range(0,n):
  a.append(int,input())
  
x=max(a)
y=a.index(x)
del a[y]
z=max(a)

for i in range(0,n):
  if i!=y:
    print(x)
  else:
    print(z)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(int,input().split(), for _ in range(0,n))
x=max(a)
y=a.index(x)
del a[y]
z=max(a)

for i in range(0,n):
  if i!=y:
    print(x)
  else:
    print(z)

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

value=max(a)
index=a.index(max(a))

for i in range(n):
  if i==index:
    b=a.pop(i)
    print(max(a))
  else:
      print(value)

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

for i in range(0,n):
  if i==inx:
    del a[inx]
    print(max(a))
  else:
    print(val)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
x=max(a)
y=a.index(x)
del a[y]
z=max(a)

for i in range(0,n):
  if i!=y:
    print(x)
  else:
    print(z)

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

for i in range(0,n):
  if i!=y:
    print(x)
  else:
    del a[y]
    print(max(a))

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

for i in range(0,n):
  if i!=y:
    print(x)
  else:
    a.pop(y)
    print(max(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
x=max(a)
y=a.index(x)
for i in range(0,n):
  if i!=y:
    print(x)
  else:
    del a(x)
    print(max(a))
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
from math import sqrt
n,d=map(int, input().split())
x=[list(map(int, input().split())) for i in range(n)]

ans=0
tmp = 0

for i in range(n):
  for j in range(i+1, n):
    xi,xj = x[i],x[j]
    for k in range(d):
      tmp += (xi[k]-xj[k]) ** 2
      
    if sqrt(tmp)%1==0:
      ans += 1

print(ans)
Problem p02982 (python)

Fixed submission:
from math import sqrt
n,d=map(int,input().split())
x=[list(map(int,input().split())) for i in range(n)]

ans=0
tmp=0

for i in range(n):
  for j in range(i+1, n):
    xi,xj = x[i],x[j]
    for k in range(d):
      tmp += (xi[k]-xj[k]) ** 2  
    if sqrt(tmp)%1==0:
      tmp=0
      ans += 1
    else:
      tmp=0

print(ans)

Buggy submission (verdict: Runtime Error):
from math import sqrt
n,d=map(int, input().split())
x=[list(map(int, input().split())) for i in range(n)]

ans=0

for i in range(n):
  for j in range(i+1, n):
    xi,xj = x[i],x[j]
  tmp = 0
    for k in range(d):
      tmp += (xi[d]-xj[d]) ** 2
      if sqrt(tmp)%1==0:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
n,d=map(int, input().split())
x=[list(map(int, input().split())) for i in range(n)]

ans=0

for i in range(n):
    for j in range(i+1, n):
        xi,xj = x[i],x[j]
        tmp = 0
        for k in range(d):
            tmp += (xi[d]-xj[d]) ** 2
        if (tmp ** 0.5)%1==0:
            ans += 1

print(ans)