Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N=(stdin.readline().rstrip())
def str_del(str,index):
    str = str[:index]+str[index+1:]
    return str
ans=0
for i in range(100000000000):
    index=N.find("W")
    if index==-1:
        break
    ans=ans+index
    N=str_del(N,index)
print(ans)

Fixed submission:
from sys import stdin
N=(stdin.readline().rstrip())
N=list(N)
cnt=0
ans=0
for i in N:
    if i=="B":
        cnt+=1
    else:
        ans+=cnt
print(ans)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
N=(stdin.readline().rstrip())
ans=0
for i in range(10000):
    index=N.find("W")
    if index==-1:
        break
    ans=ans+index
    N=str_del(N,index)
print(ans)

Fixed submission:
from sys import stdin
N=(stdin.readline().rstrip())
N=list(N)
cnt=0
ans=0
for i in N:
    if i=="B":
        cnt+=1
    else:
        ans+=cnt
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N=(stdin.readline().rstrip())
ans=0
for i in range(1000000):
    cnt=N.count("BW")
    ans=ans+cnt
    N=N.replace("BW","WB")
    N=N.lstrip("W")
    N=N.rstrip("B")
    if cnt==0:
        break
print(ans)

Fixed submission:
from sys import stdin
N=(stdin.readline().rstrip())
N=list(N)
cnt=0
ans=0
for i in N:
    if i=="B":
        cnt+=1
    else:
        ans+=cnt
print(ans)

Buggy python submission (verdict: Runtime Error):
ans=0
for i in range(1000000):
    cnt=N.count("BW")
    ans=ans+cnt
    N=N.replace("BW","WB")
    N=N.lstrip("W")
    N=N.rstrip("B")
    if cnt==0:
        break
print(ans)

Fixed submission:
from sys import stdin
N=(stdin.readline().rstrip())
N=list(N)
cnt=0
ans=0
for i in N:
    if i=="B":
        cnt+=1
    else:
        ans+=cnt
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N=(stdin.readline().rstrip())
ans=0
for i in range(1000000):
    cnt=N.count("BW")
    ans=ans+cnt
    N=N.replace("BW","WB")
    if cnt==0:
        break
print(ans)

Fixed submission:
from sys import stdin
N=(stdin.readline().rstrip())
N=list(N)
cnt=0
ans=0
for i in N:
    if i=="B":
        cnt+=1
    else:
        ans+=cnt
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
from sys import stdin
N,K=[int(x) for x in stdin.readline().rstrip().split()]
data=[]
for i in range(N):
    data.append(int(input()))
data.sort()
data.reverse()
ans=float("inf")
for i in range(N-K+1):
    tmp=data[i]-data[i+K-1]
    if ans > tmp:

Fixed submission:
import numpy as np
from sys import stdin
N,K=[int(x) for x in stdin.readline().rstrip().split()]
data=[]
for i in range(N):
    data.append(int(input()))
data.sort()
data.reverse()
ans=float("inf")
for i in range(N-K+1):
    tmp=data[i]-data[i+K-1]
    if ans > tmp:
        ans=tmp
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N=int(stdin.readline().rstrip())
cnt=0
for i in range(N+1):
    if set(list(str(i)))=={"3","5","7"}:
        cnt+=1
print(cnt)

Fixed submission:
import itertools
from sys import stdin
N=int(stdin.readline().rstrip())
ans=0
for i in range(3,11):
    for j in list(itertools.product("753",repeat=i)):
        if int("".join(j)) <= N and len(set("".join(j)))==3:
            ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
n,k=[int(x) for x in stdin.readline().rstrip().split()]
data=[int(x) for x in stdin.readline().rstrip().split()]

tmp=[]
cnt=0
for i in range(len(data)):
    for j in range(len(data)-i):
        tmp.append(((sum(data[i:1+i+j]))))
        cnt+=1
beat_v=sorted(tmp)
tmp2 = list(map(lambda x: len(bin(x)), beat_v))

#同じ桁のbit列がK個以上あるか探索
cnt2=0
maxbit=tmp2[-1]
res=0
for l in reversed(tmp2):
    if maxbit==l:
        cnt2+=1
    maxbit=l
    if cnt2==k:
        res=maxbit
        break
cnt3=0
for m in reversed(tmp2):
    if m != res:
        cnt3+=1
    else :
        break
        
res_=list(reversed(beat_v))[cnt3:cnt3+k]
result=res_[0]
for g in res_:
    result=result&g
print(result)

Fixed submission:
from sys import stdin
N=int(stdin.readline().rstrip())
data=[int(x) for x in stdin.readline().rstrip().split()]
from statistics import mean
data_mean=mean(data)
def calc_(n):
    return abs(n-data_mean)
 
data2 = list(map(calc_, data))
data3=list(data2)
result=data3.index(min(data3))
print(result)
Buggy python submission (verdict: Runtime Error):
for sys import stdin
N=int(stdin.readline().rstrip())
T,A=[int(x) for x in stdin.readline().rstrip().split()]
elev=[int(x) for x in stdin.readline().rstrip().split()]
cnt=0
comp=10000
for i in elev:
    cnt+=1
    temperature=T-(i*0.006)
    tmp=abs(A-temperature)
    if comp > tmp:
        comp=tmp
        ans=cnt
print(ans)

Fixed submission:
from sys import stdin
N=int(stdin.readline().rstrip())
T,A=[int(x) for x in stdin.readline().rstrip().split()]
elev=[int(x) for x in stdin.readline().rstrip().split()]
cnt=0
comp=10000
for i in elev:
    cnt+=1
    temperature=T-(i*0.006)
    tmp=abs(A-temperature)
    if comp > tmp:
        comp=tmp
        ans=cnt
print(ans)

Buggy python submission (verdict: Runtime Error):
for sys import stdin
N=int(stdin.readline().rstrip())
T,A=[int(x) for x in stdin.readline().rstrip().split()]
elev=[int(x) for x in stdin.readline().rstrip().split()]
cnt=0
comp=10000
for i in elev:
    cnt+=1
    tmperature=T-(i*0.006)
    tmp=abs(A-temperature)
    if comp > tmp:
        comp=tmp
        ans=cnt
pritn(ans)

Fixed submission:
from sys import stdin
N=int(stdin.readline().rstrip())
T,A=[int(x) for x in stdin.readline().rstrip().split()]
elev=[int(x) for x in stdin.readline().rstrip().split()]
cnt=0
comp=10000
for i in elev:
    cnt+=1
    temperature=T-(i*0.006)
    tmp=abs(A-temperature)
    if comp > tmp:
        comp=tmp
        ans=cnt
print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
A = []
for i in range(N):
    A.append(int(input()))

A.sort()


if N % 2 != 0:
    ans1 = 0
    tmp = [-1,-1] + [2]*((N-1)//2) + [-2]*((N-2)//2)
    for i,j in zip(sorted(tmp),A):
        ans1 += (i*j)
    
    ans2 = 0
    tmp = [1,1] + [2]*((N-2)//2) + [-2]*((N-1)//2)
    for i,j in zip(sorted(tmp),A):
        ans2 += (i*j)
    print(max(ans1,ans2))
else:
    tmp = [-1,1] + [2]*((N-2)//2) + [-2]*((N-2)//2)
    for i,j in zip(sorted(tmp),A):
        ans += (i*j)
    print(ans)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
A = []
for i in range(N):
    A.append(int(input()))

A.sort()


if N % 2 != 0:
    ans1 = 0
    tmp = [-1,-1] + [2]*((N-1)//2) + [-2]*((N-2)//2)
    for i,j in zip(sorted(tmp),A):
        ans1 += (i*j)
    
    ans2 = 0
    tmp = [1,1] + [2]*((N-2)//2) + [-2]*((N-1)//2)
    for i,j in zip(sorted(tmp),A):
        ans2 += (i*j)
    print(max(ans1,ans2))
else:
    ans = 0
    tmp = [-1,1] + [2]*((N-2)//2) + [-2]*((N-2)//2)
    for i,j in zip(sorted(tmp),A):
        ans += (i*j)
    print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=int(input())
B=int(input())
if N==1:
  print("Hello World")
else:
  print(A+B)

Fixed submission:
N=int(input())
if N == 1:
  print("Hello World")
else:
  A=int(input())
  B=int(input())
  print(A+B)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
import collections
N=int(stdin.readline().rstrip())
data=[(x) for x in stdin.readline().rstrip().split()]
ans=0
if len(set(data)) == 1:
    ans=len(set(data[1::2]))
else:
    evenc = collections.Counter(data[0::2])
    even_num = evenc.most_common()[0][1]
    alle_num=len(data[0::2])
    
    oddc = collections.Counter(data[1::2])
    odd_num = oddc.most_common()[0][1]
    allo_num=len(data[1::2])
    
    if evenc.most_common()[0][0] == oddc.most_common()[0][0]:
        ans=min((N-(evenc.most_common()[1][1]+odd_num)),(N-(oddc.most_common()[1][1]+eve_num)))
    
    else:
        ans=N-(even_num+odd_num)
            
    
print(ans)

Fixed submission:
from sys import stdin
import collections
N=int(stdin.readline().rstrip())
data=[(x) for x in stdin.readline().rstrip().split()]
ans=0
if len(set(data)) == 1:
    ans=len((data[1::2]))
else:
    evenc = collections.Counter(data[0::2])
    even_num = evenc.most_common()[0][1]
    alle_num=len(data[0::2])
    
    oddc = collections.Counter(data[1::2])
    odd_num = oddc.most_common()[0][1]
    allo_num=len(data[1::2])
    
    if evenc.most_common()[0][0] == oddc.most_common()[0][0]:
        ans=min((N-(evenc.most_common()[1][1]+odd_num)),(N-(oddc.most_common()[1][1]+even_num)))
    
    else:
        ans=N-(even_num+odd_num)
            
    
print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
a,b,c=[x for x in stdin.readline().rstrip().split()]
print(max(int(a)+int(b+c),int(a+b)+int(c))

Fixed submission:
from sys import stdin
a,b,c=[x for x in stdin.readline().rstrip().split()]
print(max(int(a)+int(b+c),int(a+b)+int(c),int(c+b)+int(a)))
Buggy python submission (verdict: Runtime Error):
N,M,X,Y=[int(x) for x in stdin.readline().rstrip().split()]
datax=[int(x) for x in stdin.readline().rstrip().split()]
datay=[int(x) for x in stdin.readline().rstrip().split()]
if sorted(datax)[-1] < sorted(datay)[0]:
    print("No War")
else:
    print("War")

Fixed submission:
from sys import stdin
N,M,X,Y=[int(x) for x in stdin.readline().rstrip().split()]
datax=[int(x) for x in stdin.readline().rstrip().split()]
datay=[int(x) for x in stdin.readline().rstrip().split()]
if sorted(datax)[-1]+1 <= sorted(datay)[0] and  X < sorted(datax)[-1]  and sorted(datay)[0] <=Y: 
    print("No War")
else:
    print("War")
Buggy python submission (verdict: Runtime Error):
import numpy as np
from sys import stdin
N,K=[int(x) for x in stdin.readline().rstrip().split()]
data=[]
for i in range(N):
    data.append([ 1 if x == "#" else 0 for x in list(input())])
data=np.array(data)
index_col=[]
for j in range(N):
    if sum(data[:,j]) == 0:
        index_col.append(j)
data=np.delete(data, index_col, 1)

index_row=[]
for k in range(K):
    if sum(data[k]) == 0:
        index_row.append(k)
data=np.delete(data,index_row,0)
for l in data:
    tmp=""
    for m in l:
        if m == 1:
            tmp=tmp+"#"
        else:
            tmp=tmp+"."
    print(tmp)

Fixed submission:
import numpy as np
from sys import stdin
H,W=[int(x) for x in stdin.readline().rstrip().split()]
data=[]
for i in range(H):
    data.append([ 1 if x == "#" else 0 for x in list(input())])
data=np.array(data)
index_col=[]
for j in range(W):
    if sum(data[:,j]) == 0:
        index_col.append(j)
data=np.delete(data, index_col, 1)

index_row=[]
for k in range(H):
    if sum(data[k]) == 0:
        index_row.append(k)
data=np.delete(data,index_row,0)
for l in data:
    tmp=""
    for m in l:
        if m == 1:
            tmp=tmp+"#"
        else:
            tmp=tmp+"."
    print(tmp)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = int(i)
        break
if cnt == K:
    ans = 1
print(ans)

Fixed submission:
from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = int(i)
        break
if cnt >= K:
    ans = 1
print(ans)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = i
if cnt == K:
    ans = 1
print(ans)

Fixed submission:
from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = int(i)
        break
if cnt >= K:
    ans = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
moji=(stdin.readline().rstrip())
N=int(stdin.readline().rstrip())
ans=moji[0]
for i in range(1,len(moji)):
    if i*N > len(moji):
        break
    ans=ans+moji[i*N]
print(ans)

Fixed submission:
from sys import stdin
moji=(stdin.readline().rstrip())
N=int(stdin.readline().rstrip())
ans=moji[0]
ite=len(moji)
for i in range(1,ite+1):
    if i*N > len(moji)-1:
        break
    ans=ans+moji[i*N]
print(ans)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
moji=stdin.readline().rstrip()
N=int(stdin.readline().rstrip())
ite=(len(moji)//N)
ans=moji[0]
for i in range(1,ite+1):
    ans=ans+moji[i*N]
print(ans)

Fixed submission:
from sys import stdin
moji=(stdin.readline().rstrip())
N=int(stdin.readline().rstrip())
ans=moji[0]
ite=len(moji)
for i in range(1,ite+1):
    if i*N > len(moji)-1:
        break
    ans=ans+moji[i*N]
print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
data=[int(x) for x in stdin.readline().rstrip().split()]
data=sorted(data)
print(abs(data[0]-data[-1])

Fixed submission:
from sys import stdin
N=int(stdin.readline().rstrip())
data=[int(x) for x in stdin.readline().rstrip().split()]
data=sorted(data)
print(abs(data[0]-data[-1]))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
D,N=[int(x) for x in stdin.readline().rstrip().split()]
if N%100=0:
  ans=100**D*(N+1)
else:
  if D==0:
      ans=N
  else:
      ans=100**D*N
print(ans)

Fixed submission:
from sys import stdin
D,N=[int(x) for x in stdin.readline().rstrip().split()]
if N%100==0:
  ans=100**D*(N+1)
else:
  if D==0:
      ans=N
  else:
      ans=100**D*N
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
from sys import stdin
N=int(stdin.readline().rstrip())
a=[]
for i in range(N):
    a.append([int(x) for x in stdin.readline().rstrip().split()])

res = np.cumsum(data)
res=np.insert(res,0,0)
ans=0
tmp=float("inf")
for i in sorted(res):
    if i == tmp:
        ans+=1
    tmp=i
print(ans)

Fixed submission:
import numpy as np
from sys import stdin
N=int(stdin.readline().rstrip())
data=[int(x) for x in stdin.readline().rstrip().split()]
res = np.cumsum(data)
res=np.insert(res,0,0)
cnt=1
ans=0
tmp=float("inf")
ite=np.append(sorted(res),float("inf"))
for j in ite:
    if j == tmp:
        cnt+=1
    else:
        ans=ans+((cnt*(cnt-1))/2)
        cnt=1
    tmp=j
print(int(ans))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
A,B,C,X,Y = [int(x) for x in stdin.readline().rstrip().split()]
if A + B <= 2*C:
    ans = A*X + B*Y
    
elif A > 2*C and B > 2*C:
    ans = C*2*max(X,Y)

elif A > B:
    ans = 2*C*X + B*max(Y-X,0)

elif B > A:
    ans = A*max(X-Y,0) + 2*C*Y

print(ans)

Fixed submission:
from sys import stdin
A,B,C,X,Y = [int(x) for x in stdin.readline().rstrip().split()]
ans = 10**9
for i in range(0,2*(max(X,Y)+1)):
    total = A*max((X-(i//2)),0) + B*max((Y-(i//2),0)) + i*C
    #print(total,i)
    if total > 0 and total < ans:
        ans = total
print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
lst = list(range(A,B+1))
for i in sorted(set(lst[:K]+lst[-K:])):
    print(i)

Fixed submission:
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
ran = range(A,B+1)
for i in sorted(set(ran[:K])|set(ran[-K:])):
    print(i)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
lst = list(range(A,B+1))
for i in sorted(list(set(lst[:K]+lst[-K:]))):
    print(i)

Fixed submission:
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
ran = range(A,B+1)
for i in sorted(set(ran[:K])|set(ran[-K:])):
    print(i)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
lst = list(range(A,B+1))
for i in sorted(list(set([:K]+[-K:]))):
    print(i)

Fixed submission:
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
ran = range(A,B+1)
for i in sorted(set(ran[:K])|set(ran[-K:])):
    print(i)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
lst = list(range(A,B+1))
for i in lst[:K]:
    print(i)
for j in lst[-K:]:
    print(j)

Fixed submission:
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
ran = range(A,B+1)
for i in sorted(set(ran[:K])|set(ran[-K:])):
    print(i)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]
d = sorted([A,B,C])

a = A % 2
b = B % 2
c = C % 2

if a == b == c:
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    
elif a == b:
    A += 1
    B += 1
    d = sorted([A,B,C])
    ans += 1
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    
elif a == c:
    A += 1
    C += 1
    d = sorted([A,B,C])
    ans += 1
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2

elif c == b:
    A += 1
    C += 1
    d = sorted([A,B,C])
    ans += 1
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2

print(ans)

Fixed submission:
from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]
d = sorted([A,B,C])
 
a = A % 2
b = B % 2
c = C % 2
 
if a == b == c:
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    
elif a == b:
    A += 1
    B += 1
    d = sorted([A,B,C])
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    ans += 1
    
elif a == c:
    A += 1
    C += 1
    d = sorted([A,B,C])
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    ans += 1
 
elif c == b:
    B += 1
    C += 1
    d = sorted([A,B,C])
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    ans += 1
 
    
print(ans)
Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
D=int(input())
print(min(A+C,A+D,B+c,B+D))

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
print(min(A+C,A+D,B+C,B+D))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
data = []
for _ in range(N):
    data.append([int(x) for x in stdin.readline().rstrip().split()])
ans = str(data[0][0]) + str(data[1][1]) + str(data[2][2])
print(ans)

Fixed submission:
from sys import stdin
data = []
for _ in range(3):
    data.append(input())
ans = data[0][0] + data[1][1] + data[2][2]
print(ans)
Buggy python submission (verdict: Runtime Error):
N = input()
print(N//3)

Fixed submission:
N = int(input())
print(N//3)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
a,b=[int(x) for x in stdin.readline().rstrip().split()]
if (a*b)%2==0:
  print(Even)
else:
  print(Odd)

Fixed submission:
from sys import stdin
a,b=[int(x) for x in stdin.readline().rstrip().split()]
if (a*b)%2==0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
from sys import stdin
N,Y = [int(x) for x in stdin.readline().rstrip().split()]
flag = False
for x in range(N+1):
    for y in range(N+1):
        z = N - x - y
        if Y == 10000 * x + 5000 * y + 1000 * z:
            flag = True
            break
    else:
        continue
    break
if flag:
    print(x,y,z)
else:
    print(-1,-1,-1)

Fixed submission:
from sys import stdin
S = (stdin.readline().rstrip())
S = "2018" + S[4:]
print(S)
Buggy python submission (verdict: Runtime Error):
A,B=[int(x) for x in stdin.readline().rstrip().split()]
S=(stdin.readline().rstrip())
flag=True
if S[:A].isdecimal() != True:
    flag = False
elif S[A:A+1] != "-":
    flag = False
elif S[A+1:].isdecimal() != True:
    flag = False

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

Fixed submission:
from sys import stdin
A,B=[int(x) for x in stdin.readline().rstrip().split()]
S=(stdin.readline().rstrip())
flag=True
if S[:A].isdecimal() != True:
    flag = False
elif S[A:A+1] != "-":
    flag = False
elif S[A+1:].isdecimal() != True:
    flag = False

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

Buggy python submission (verdict: Runtime Error):
A,B=[int(x) for x in stdin.readline().rstrip().split()]
S=(stdin.readline().rstrip())
flag=True
if S[0:A].isdecimal() != True:
    flag = False
elif S[A:B] != "-":
    flag = False
elif S[B:].isdecimal() != True:
    flag = False

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

Fixed submission:
from sys import stdin
A,B=[int(x) for x in stdin.readline().rstrip().split()]
S=(stdin.readline().rstrip())
flag=True
if S[:A].isdecimal() != True:
    flag = False
elif S[A:A+1] != "-":
    flag = False
elif S[A+1:].isdecimal() != True:
    flag = False

if flag:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
from sys import stdin
s = "".join(sorted(list(stdin.readline().rstrip())))
t = "".join(reversed((sorted(list(stdin.readline().rstrip()))))
if s < t:
    print("Yes")
else:
    print("No")

Fixed submission:
from sys import stdin
s = "".join(sorted(list(stdin.readline().rstrip())))
t = "".join(reversed((sorted(list(stdin.readline().rstrip())))))
if s < t:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]
data = sorted(data) + [0]

if N == 1 and data[0] == 1:
    print(0)

elif N == 1 and data[0] != 1:
    print(1)

else:
    ans = 0
    num = data[0]
    cnt = 0
    for i in range(N+1):
        if data[i] == num:
            cnt += 1
        else:
            if cnt < data[i-1]:
                ans += cnt
            else:
                ans += (cnt-data[i-1])
            cnt = 1
            num = data[i]
print(ans)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]
data = sorted(data) + [0]

if N == 1 and data[0] == 1:
    print(0)

elif N == 1 and data[0] != 1:
    print(1)

else:
    ans = 0
    num = data[0]
    cnt = 0
    for i in range(N+1):
        if data[i] == num:
            cnt += 1
        else:
            if cnt < data[i-1]:
                ans += cnt
            else:
                ans += (cnt-data[i-1])
            cnt = 1
            num = data[i]
    print(ans)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]
data = sorted(data) + [0]

if N == 1 and data[0] == 1:
    print(0)

elif N == 1 and data[0] != 1:
    print(1)

else:
    ans = 0
    num = data[0]
    cnt = 0
    for i in range(N+1):
        if data[i] == num:
            cnt += 1
        else:
            ans += min(abs(cnt-num),cnt)
            cnt = 1
            num = data[i]
print(ans)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]
data = sorted(data) + [0]

if N == 1 and data[0] == 1:
    print(0)

elif N == 1 and data[0] != 1:
    print(1)

else:
    ans = 0
    num = data[0]
    cnt = 0
    for i in range(N+1):
        if data[i] == num:
            cnt += 1
        else:
            if cnt < data[i-1]:
                ans += cnt
            else:
                ans += (cnt-data[i-1])
            cnt = 1
            num = data[i]
    print(ans)
Buggy python submission (verdict: Runtime Error):
# 1-index
from sys import stdin
import numpy as np
N,C = [int(x) for x in stdin.readline().rstrip().split()]
imos = [[0]*(10**5+2) for i in range(C+1)]
 
for i in range(N):
    s,t,c = [int(x) for x in stdin.readline().rstrip().split()]
    imos[c][s] += 1
    imos[c][t+1] -= 1
 
imos = np.array(imos)[:,:-1]
#print(np.cumsum(imos,axis=1))
ans = max(np.cumsum(imos,axis=1).sum(axis=0))
print(ans)

Fixed submission:
from sys import stdin
N,A,B = [int(x) for x in stdin.readline().rstrip().split()]
print(min(A*N,B))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
N=(stdin.readline().rstrip())
if sum(list(map(int,list(N)))) % N == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
from sys import stdin
N=(stdin.readline().rstrip())
if int(N) % sum(list(map(int,list(N)))) == 0:
    print("Yes")
else:
    print("No")