Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
t = input().split(" ")

N = int(t[0])
K = int(t[1])

p = list(map(int,input().split(" ")))

ans = 0
a =0

for i in range(len(p)):
    #a = list(range(1,p[i]+1))
    #print(a)
    p[i] = sum(list(range(1,p[i]+1)))/p[i]
    
    a += p[i]
    
    if i >= K-1:
        
        if i >= K:
            a += -(p[i-K])
        if a > ans:
            ans = a

print(ans)

    
    






Fixed submission:
t = input().split(" ")

N = int(t[0])
K = int(t[1])

p = list(map(int,input().split(" ")))

ans = 0
a =0

for i in range(len(p)):
    #a = list(range(1,p[i]+1))
    #print(a)
    p[i] = ((p[i]*(p[i]+1))/2)/p[i]
    a += p[i]
    
    if i >= K-1:
        
        if i >= K:
            a += -(p[i-K])
        if a > ans:
            ans = a

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
t = input().split(" ")

N = int(t[0])
K = int(t[1])

p = list(map(int,input().split(" ")))

for i in range(len(p)):
    #a = list(range(1,p[i]+1))
    #print(a)
    p[i] = sum(list(range(1,p[i]+1)))/p[i]

ans = 0
a =0
for i in range(N):
    

    a += p[i]
    
    if i >= K-1:
        
        if i >= K:
            a += -(p[i-K])
        if a > ans:
            ans = a

print(ans)

    
    






Fixed submission:
t = input().split(" ")

N = int(t[0])
K = int(t[1])

p = list(map(int,input().split(" ")))

ans = 0
a =0

for i in range(len(p)):
    #a = list(range(1,p[i]+1))
    #print(a)
    p[i] = ((p[i]*(p[i]+1))/2)/p[i]
    a += p[i]
    
    if i >= K-1:
        
        if i >= K:
            a += -(p[i-K])
        if a > ans:
            ans = a

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
t = input().split(" ")

N = int(t[0])
K = int(t[1])

p = list(map(int,input().split(" ")))

for i in range(len(p)):
    #a = list(range(1,p[i]+1))
    #print(a)
    p[i] = sum(list(range(1,p[i]+1)))/p[i]
#    print(p[i])

ans = 0
for i in range(N-K+1):
    
    a =0
#    print(i)
    for j in range(K):
#        print(p[i+j])
        a += p[i+j]

    if a > ans:
        ans = a

print(ans)

    
    






Fixed submission:
t = input().split(" ")

N = int(t[0])
K = int(t[1])

p = list(map(int,input().split(" ")))

ans = 0
a =0

for i in range(len(p)):
    #a = list(range(1,p[i]+1))
    #print(a)
    p[i] = ((p[i]*(p[i]+1))/2)/p[i]
    a += p[i]
    
    if i >= K-1:
        
        if i >= K:
            a += -(p[i-K])
        if a > ans:
            ans = a

print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a-2b>0:
  print(a-2b)
else:
  print("0")

Fixed submission:
a,b=map(int,input().split())
if a-2*b>0:
  print(a-2*b)
else:
  print("0")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>2*b:
  print(a-2b)
else:
  print(0)

Fixed submission:
a,b=map(int,input().split())
if a-2*b>0:
  print(a-2*b)
else:
  print("0")

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A>2*B:
  print(A-2B)
else:
  print(0)

Fixed submission:
a,b=map(int,input().split())
if a-2*b>0:
  print(a-2*b)
else:
  print("0")

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A>2*B:
  print(A-2B)
else:
  print(0)

Fixed submission:
a,b=map(int,input().split())
if a-2*b>0:
  print(a-2*b)
else:
  print("0")
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c=map(int,input().split())
ans=0
while 1:
    if b>0:
        a-=b
        ans+=1
    else:
        break
print(ans*c)

Fixed submission:
n,x,t=map(int,input().split())
if n%x==0:
    print(int(n/x*t))
else:
    print(int(n//x+1)*t)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,inout().split())
ans=0
while 1:
    if b>0:
        a-=b
        ans+=1
    else:
        break
print(ans*c)

Fixed submission:
n,x,t=map(int,input().split())
if n%x==0:
    print(int(n/x*t))
else:
    print(int(n//x+1)*t)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=0
r=int(n**0.5)+1
for i in range(2,r):
    if n%i==0:
        ans+=1
        n/=i
if ans==0 and not n==0:
    ans=1
print(ans)

Fixed submission:
a,b=map(int,input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
    if ans>1000000000000000000:
    ans=-1
    break
if 0 in lis:
    ans=0
else:
    print(ans)


Fixed submission:
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
    if ans>1000000000000000000:
        ans=-1
        break
if 0 in lis:
    ans=0

print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
    if ans>1000000000000000000:
    ans=-1
    break
else:
    print(ans)

Fixed submission:
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
    if ans>1000000000000000000:
        ans=-1
        break
if 0 in lis:
    ans=0

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
n=int(input())
lis=list(map(int,input().split()))
ans=reduce(mul,lis)
if ans>1000000000000000000:
    print(-1)
else:
    print(ans)

Fixed submission:
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
    if ans>1000000000000000000:
        ans=-1
        break
if 0 in lis:
    ans=0

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
if ans>1000000000000000000:
    print(-1)
else:
    print(ans)

Fixed submission:
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
    if ans>1000000000000000000:
        ans=-1
        break
if 0 in lis:
    ans=0

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
lis=list(map(int,input().split()))
ans=lis[0]
for i in range(1,n):
    ans*=lis[i]
if ans>1000000000000000000:
    print(-1)
else:
    print(ans)

Fixed submission:
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
    if ans>1000000000000000000:
        ans=-1
        break
if 0 in lis:
    ans=0

print(ans)
Buggy python submission (verdict: Runtime Error):
import math
a,b,h,m=map(float,input().split())
H=((h%12)*30)
M=(m*6)
x=abs(H-M)
y=360-x
l=[x,y]
l.sort()
sita=l[0]
sita=math.radians(sita)
c=a**2+b**2-2(*a*b*math.cos(sita))
c=math.sqrt(c)
print(c)

Fixed submission:
import math
a,b,h,m=map(int,input().split())
H=((h%12)*30)+0.5*m
M=(m*6)
x=abs(H-M)
y=360-x
l=[x,y]
l.sort()
sita=l[0]
sita=math.radians(sita)
c=a**2+b**2-2*(a*b*math.cos(sita))
c=math.sqrt(c)
print(c)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
lis=[i for i in range(1,n+1)]
for i in range(m):
    d=int(input())
    for j in range(d):
        a=int(input())
        if a in lis:
            lis.remove(a)
print(len(lis))

Fixed submission:
n,m=map(int,input().split())
lis=[i for i in range(1,n+1)]
for i in range(m):
    d=int(input())
    a=list(map(int,input().split()))
    for j in range(d):
        if a[j] in lis:
            lis.remove(a[j])
print(len(lis))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
H=list(map(int,input().split()))
ans=[i  for i in range(1,n+1)]
low=[]
load=[map(int,input().split()) for j in range(m)]
for i in range(m):
    if H[load[i][0]-1]==H[load[i][1]-1]:
        low.append(load[i][0])
        low.append(load[i][1])
    elif  H[load[i][0]-1]>H[load[i][1]-1]:
        low.append(load[i][1])
    else:
        low.append(load[i][0])
low=list(set(low))
for k in low:
    ans.remove(k)
print(len(ans))

Fixed submission:
n,m=map(int,input().split())
H=list(map(int,input().split()))
ans=[i  for i in range(1,n+1)]
low=[]
for i in range(m):
    x,y=map(int,input().split())
    if H[x-1]==H[y-1]:
        low.append(x)
        low.append(y)
    elif  H[x-1]>H[y-1]:
        low.append(y)
    else:
        low.append(x)
low=list(set(low))
print(len(ans)-len(low))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
H=list(map(int,input().split()))
ans=[i  for i in range(1,n+1)]
low=[]
for i in range(m):
    x,y=map(int,input().split())
    if H[x-1]==H[y-1]:
        low.append(x)
        low.append(y)
    elif  H[x-1]>H[y-1]:
        low.append(y)
    else:
        low.append(x)
low=list(set(low))
for k in low:
    ans.remove(k)
print(len(ans))

Fixed submission:
n,m=map(int,input().split())
H=list(map(int,input().split()))
ans=[i  for i in range(1,n+1)]
low=[]
for i in range(m):
    x,y=map(int,input().split())
    if H[x-1]==H[y-1]:
        low.append(x)
        low.append(y)
    elif  H[x-1]>H[y-1]:
        low.append(y)
    else:
        low.append(x)
low=list(set(low))
print(len(ans)-len(low))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
H=list(map(int,input().split()))
ans=[i  for i in range(1,n+1)]
low=[]
for i in range(m):
    x,y=map(int,input().split())
    if H[x-1]==H[y-1]:
        low.append(x)
        low.append(y)
    elif  H[x-1]>H[y-1]:
        low.append(y)
    else:
        low.append(x)
low=list(set(low))
for k in low:
    ans=ans.remove(k)
print(len(ans))

Fixed submission:
n,m=map(int,input().split())
H=list(map(int,input().split()))
ans=[i  for i in range(1,n+1)]
low=[]
for i in range(m):
    x,y=map(int,input().split())
    if H[x-1]==H[y-1]:
        low.append(x)
        low.append(y)
    elif  H[x-1]>H[y-1]:
        low.append(y)
    else:
        low.append(x)
low=list(set(low))
print(len(ans)-len(low))
Buggy python submission (verdict: Runtime Error):
import itertools
n,m,q=map(int,input().split())
lis=[i for i  in range(1,m+1)]
lis=list(itertools.combinations(lis,n))
box=[0 for j in range(len(lis))]
que=[list(map(int,input().split())) for k in range(q)]
for i in range(q):
    for j in range(len(lis)):
        if lis[j][que[i][1]-1]-lis[j][que[i][0]-1]==que[i][2]:
            box[j]+=que[i][3] 
print(max(box))


Fixed submission:
import itertools
n,m,q=map(int,input().split())
lis=[i for i  in range(1,m+1)]
lis=list(itertools.combinations_with_replacement(lis,n))
box=[0 for j in range(len(lis))]
for i in range(q):
    que=list(map(int,input().split()))
    for j in range(len(lis)):
        if lis[j][que[1]-1]-lis[j][que[0]-1]==que[2]:
            box[j]+=que[3] 
print(max(box))

Buggy python submission (verdict: Runtime Error):
import itertools
n,m,q=map(int,input().split())
lis=[i for i  in range(1,m+1)]
lis=list(itertools.combinations(lis,n))
box=[0 for j in range(len(lis))]
for i in range(q):
    que=list(map(int,input().split()))
    for j in range(len(lis)):
        if lis[j][que[1]-1]-lis[j][que[0]-1]==que[2]:
            box[j]+=que[3] 
print(max(box))

Fixed submission:
import itertools
n,m,q=map(int,input().split())
lis=[i for i  in range(1,m+1)]
lis=list(itertools.combinations_with_replacement(lis,n))
box=[0 for j in range(len(lis))]
for i in range(q):
    que=list(map(int,input().split()))
    for j in range(len(lis)):
        if lis[j][que[1]-1]-lis[j][que[0]-1]==que[2]:
            box[j]+=que[3] 
print(max(box))
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split)
lis=list(map(int, input().split()))
s=0
for i in lis:
    s+=i
if N-s<0:
    print("-1")
else:
    print(N-s)

Fixed submission:
N,M=map(int,input().split())
lis=list(map(int, input().split()))
s=0
for i in lis:
    s+=i
if N-s<0:
    print("-1")
else:
    print(N-s)
Buggy python submission (verdict: Runtime Error):
l=int(input())
if 7 in l:
    print("Yes")
else:
    print("No")

Fixed submission:
l=input()
if "7" in l:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
import math
from functools import reduce
def gcd_list(*numbers):#引数はリスト
    return reduce(math.gcd, numbers)
ans=n**2
for i in range(2,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            ans+=gcd_list(i,j,k)
print(ans)

Fixed submission:
n=int(input())
import math
ans=0
for i in range(1,n+1):
    for j in range(1,n+1):
        ij=math.gcd(i,j)
        if ij==1:
            ans+=n
        else:
            for k in range(1,n+1):
                ans+=math.gcd(ij,k)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
import math
from functools import reduce
def gcd_list(*numbers):#引数はリスト
    return reduce(math.gcd, numbers)
ans=n**2
for i in range(2,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            l=[i,j,k]
            ans+=gcd_list(*l)
print(ans)

Fixed submission:
n=int(input())
import math
ans=0
for i in range(1,n+1):
    for j in range(1,n+1):
        ij=math.gcd(i,j)
        if ij==1:
            ans+=n
        else:
            for k in range(1,n+1):
                ans+=math.gcd(ij,k)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
import math
from functools import reduce
def gcd_list(*numbers):#引数はリスト
    return reduce(math.gcd, numbers)
ans=0  
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            l=[i,j,k]
            ans+=gcd_list(*l)
print(ans)

Fixed submission:
n=int(input())
import math
ans=0
for i in range(1,n+1):
    for j in range(1,n+1):
        ij=math.gcd(i,j)
        if ij==1:
            ans+=n
        else:
            for k in range(1,n+1):
                ans+=math.gcd(ij,k)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
ans=10e20
if n%k==0:
    ans=0
else:
    while ans>=n:
        ans=abs(n-k)
        n=abs(n-k)
print(ans)

Fixed submission:
n,k=map(int,input().split())
ans=n%k
print(min(ans,abs(ans-k)))
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
s=a+b
if n%s==0:
    print(int(n/s)*a)
else:
    if n%s>=a:
        print(int(n//s+1)*a)
    else:
        print(int(n//s+)*a+n%s)

Fixed submission:
n,a,b=map(int,input().split())
s=a+b
if n%s==0:
    print(int(n/s)*a)
else:
    if n%s>=a:
        print(int(n//s+1)*a)
    else:
        print(int(n//s)*a+n%s)
Buggy python submission (verdict: Runtime Error):
19 99

Fixed submission:
a,b=map(int,input().split())
i=1
while 1:
    if int(i*0.08)==a:
        if int(i*0.1)==b:
            print(i)
            break
    else:
        if int(i*0.08)>a:
            print(-1)
            break
    i+=1
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=["0"]*n
n,m=map(int,input().split())
l=["0"]*n
f=[0]*n
frag=0
for i in range(m):
    s,c=map(int,input().split())
    if f[s-1]==0 or l[s-1]==str(c):
        l[s-1]=str(c)
        f[s-1]=1
    else:
        frag=1
        break
if frag==1 or (l[0]=="0" and n!=1):
    print(-1)
else:
    for j in l:
        
        print(j,end="")

Fixed submission:

n,m=map(int,input().split())
l=["0"]*n
l[0]="1"
l[-1]="0"
f=[0]*n
frag=0
for i in range(m):
    s,c=map(int,input().split())
    if f[s-1]==0 or l[s-1]==str(c):
        l[s-1]=str(c)
        f[s-1]=1
    else:
        frag=1
        break
if frag==1 or (l[0]=="0" and n!=1):
    print(-1)
else:
    for j in l:
        print(j,end="")
Buggy python submission (verdict: Runtime Error):
n.m=map(int,input().split())
print(round(n/m))

Fixed submission:
import math
n,m=map(int,input().split())
print(math.ceil(n/m))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=list(map(int,input().split()))
d=sum(l)
if n>l:
    print("No")
else:
    print("Yes")

Fixed submission:
n,m=map(int,input().split())
l=list(map(int,input().split()))
d=sum(l)
if n>d:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
n.m=map(int,input().split())
if 500*n>=m:
    print("Yes")
else:
    print("No")

Fixed submission:
n,m=map(int,input().split())
if 500*n >= m:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
c=math.gcd(a,b)
ans=a*b/c
print(int(ans))

Fixed submission:
import fractions
a,b=map(int,input().split())
c=fractions.gcd(a,b)
ans=a*b/c
print(int(ans))

Buggy python submission (verdict: Runtime Error):
from math import gcd
a,b=map(int,input().split())
c=gcd(a,b)
ans=a*b/c
print(int(ans))

Fixed submission:
import fractions
a,b=map(int,input().split())
c=fractions.gcd(a,b)
ans=a*b/c
print(int(ans))

Buggy python submission (verdict: Runtime Error):
from math import gcd
a,b=map(int,input().split())
c=gcd(a,b)
ans=a*b/c
print(int(ans))

Fixed submission:
import fractions
a,b=map(int,input().split())
c=fractions.gcd(a,b)
ans=a*b/c
print(int(ans))
Buggy python submission (verdict: Runtime Error):
n=int(input())
tako=list(map(int,input().split()))
ans=0
for i in range(n):
    for j in range(1,n+1):
        ans+=tako[i]*tako[j]
print(ans)

Fixed submission:
a,b=map(int,input().split())
if a-b*2>0:
    print(a-b*2)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n=int(input)
tako=list(map(int,input().split()))
ans=0
for i in range(n):
    for j in range(1,n+1):
        ans+=tako[i]*tako[j]
print(ans)


Fixed submission:
n=int(input())
tako=list(map(int,input().split()))
ans=0
for i in range(n-1):
    for j in range(1,n):
        if not j<=i:
            
          
            ans+=tako[i]*tako[j]
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
t=input()
ans=t[0]
for i in range(1,n):
    if ans[-1]==i:
        pass
    else:
        ans=ans+i
print(ans)


Fixed submission:
n=int(input())
t=input()
ans=t[0]
for i in range(1,n):
    if ans[-1]==t[i]:
        pass
    else:
        ans=ans+t[i]
print(len(ans))

Buggy python submission (verdict: Runtime Error):
n=int(input())
t=input()
ans=t[0]
for i in range(1,n):
    if ans[-1]==i:
        pass
    else:
        ans=ans+i
print(len(ans))

Fixed submission:
n=int(input())
t=input()
ans=t[0]
for i in range(1,n):
    if ans[-1]==t[i]:
        pass
    else:
        ans=ans+t[i]
print(len(ans))
Buggy python submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans=0
kari=0
inde=0
if n==1:
    print(0)
else:
    while 1:
        suuzi=h[inde]
        if h[inde+1]<=suuzi:
            kari+=1
        elif ans<kari:
            ans=kari
            kari=0
        inde+=1
        if inde==n-1:
            if ans<kari:
            ans=kari

            break
    print(ans)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
ans=0
kari=0
for i in range(n-1):
        if h[i+1]<=h[i]:
            kari+=1
        else:
            if ans<kari:
                ans=kari
            kari=0
        
       
print(max(ans,kari))

Buggy python submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans=0
kari=0
inde=0
while 1:
    suuzi=h[inde]
    if h[inde+1]<=suuzi:
        kari+=1
    elif ans<kari:
        ans=kari
        kari=0
    inde+=1
    if inde==n-1:
        if ans<kari:
          ans=kari

        break
print(ans)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
ans=0
kari=0
for i in range(n-1):
        if h[i+1]<=h[i]:
            kari+=1
        else:
            if ans<kari:
                ans=kari
            kari=0
        
       
print(max(ans,kari))

Buggy python submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans=0
kari=0
inde=0
while 1:
    suuzi=h[inde]
    if h[inde+1]<=suuzi:
        kari+=1
    elif ans<kari:
        ans=-kari
        kari=0
    if inde==n-1:
        break
    inde+=1
print(ans)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
ans=0
kari=0
for i in range(n-1):
        if h[i+1]<=h[i]:
            kari+=1
        else:
            if ans<kari:
                ans=kari
            kari=0
        
       
print(max(ans,kari))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=0
for i in range(1,n):
    ans+=i
print(ans)
          

Fixed submission:
n=int(input())
ans=n*(n-1)//2

print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=a+b
d=a-b
e=a*b
print(sum(c,d,e))

Fixed submission:
a,b=map(int,input().split())
c=a+b
d=a-b
e=a*b
print(max(c,d,e))
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=0
for i in range(1,n+1):
    if not len(i)%2==0:
        ans+=1
print(ans)

Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1):
    if not len(str(i))%2==0:
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input())
if a%2==b%2:
    print((a+b)/2)
else:
    print("IMPOSSIBLE")

Fixed submission:
a,b=map(int,input().split())
if a%2==b%2:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input.split()))
lis=l.sorted()
lis.reverse()
ans=0
for i ,j in zip(l,lis):
    if i!=j:
        ans+=1
if ans==2:
    print("YES")
else:
    print("NO")

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
lis=sorted(l)

ans=0
for i ,j in zip(l,lis):
   
    if i!=j:
        ans+=1
if ans<=2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=[int(input()) for i in range(n)]
for j in range(n):
    kari=l[j]
    l[j]=0
    print(max(l))
    l[j]=kari

Fixed submission:
n=int(input())
l=[int(input()) for i in range(n)]
ma=sorted(l)[-2:]
for j in l:
    if j==ma[1]:
        print(ma[0])
    else:
        print(ma[1])

Buggy python submission (verdict: Time Limit Exceeded):
import copy
n=int(input())
l=[int(input()) for i in range(n)]
for j in range(n):
    l2=copy.copy(l)
    l2[j]=0
    print(max(l2))

Fixed submission:
n=int(input())
l=[int(input()) for i in range(n)]
ma=sorted(l)[-2:]
for j in l:
    if j==ma[1]:
        print(ma[0])
    else:
        print(ma[1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for i in range(n)]
for j in range(n):
    l2=l
    l2[i]=0
    print(max(l2))


Fixed submission:
n=int(input())
l=[int(input()) for i in range(n)]
ma=sorted(l)[-2:]
for j in l:
    if j==ma[1]:
        print(ma[0])
    else:
        print(ma[1])
Buggy python submission (verdict: Runtime Error):
import math
n,d=map(int,input().split())
za=[list(map(int,input().split())) for i in range(n)]
ans=0
lon=0
for i in range(n):
    for j in range(i+1,n):
        for k in range(d):
            lon+=(za[i][d]-za[j][d])**2
            lon=math.sqrt(lon)
        else:
            if lon==int(lon):
                ans+=1
            lon=0
print(ans)

Fixed submission:
import math
n,d=map(int,input().split())
za=[list(map(int,input().split())) for i in range(n)]
ans=0
lon=0
for i in range(n):
    for j in range(i+1,n):
        for k in range(d):
            lon+=(za[i][k]-za[j][k])**2
        else:
            lon=math.sqrt(lon)
            if lon==int(lon):
                ans+=1
            lon=0
print(ans)
Buggy python submission (verdict: Runtime Error):
n=input()
m=set(n)
if len(m)==2 and n.count(m[0]):
    print("Yes")
else:
    print("No")

Fixed submission:
n=input()
m=set(n)
if len(m)==2 and n.count(n[0])==2:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n=input()
m=set(n)
a,b=0,0
for i in n:
    if len(m)!=2:
        print("No")
        break
    if i==m[0]:
        a+=1
    elif i==m[1]:
        b+=1
else:
    if a==2 and b==0:
        print("Yes")
    else:
        print("No")

Fixed submission:
n=input()
m=set(n)
if len(m)==2 and n.count(n[0])==2:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n=input()
m=set(sorted(n))
a,b=0,0
for i in n:
    if len(m)!=2:
        print("No")
        break
    if i==m[0]:
        a+=1
    elif i==m[1]:
        b+=1
else:
    if a==2 and b==0:
        print("Yes")
    else:
        print("No")

Fixed submission:
n=input()
m=set(n)
if len(m)==2 and n.count(n[0])==2:
    print("Yes")
else:
    print("No")