Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
ans = 0
for i in range(len(s)-2):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    ans +=1
    s[i]="B"
    s[i+1]="C"
    s[i+2]="A"
    l=i-1
    while 0<=l and s[l]=="A":
      s[l]="B"
      s[l+1]="C"
      s[l+2]="A"
      ans+=1
      l-=1
print(ans)

Fixed submission:
s = list(input())
ans = 0
cnta = 0
flagb = 0
flabc= 0
for i in range(len(s)):
  if s[i]=="A":
    if flagb==0:
      cnta+=1
    else:
      cnta=1
      flagb=0
  if s[i]=="B":
    if flagb==0 and cnta:
      flagb=1
    else:
      flagb=0
      cnta=0
  if s[i]=="C":
    if flagb and cnta:
      ans+= cnta
      flagb=0
    else:
      cnta=0
      flagb=0
print(ans)
Buggy python submission (verdict: Runtime Error):
from bisect import bisect_left
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
b =[]
for i in range(M):
    B,C = map(int, input().split())
    b.extend([C for _ in range(B)])
bisec = bisect_left
ex = A.extend
b.sort()
b.reverse()
for i in range(N):
    if A[i]<b[-1]:
        l = bisec(b,A[i])
        A[i] = b[l]
        del b[l]
    else:
        break
print(sum(A))

Fixed submission:
A, B = map(int, input().split())
if A>=13:
    print(B)
elif A<=12 and A>=6:
    print(int(B/2))
else:
    print(int(0))
Buggy python submission (verdict: Runtime Error):
N,K = list(map(int,input().split()))
S = list(input())
S[K-1]．lower()
print("".join(S))

Fixed submission:
N,K = list(map(int,input().split()))
S = list(input())
S[K-1]=S[K-1].swapcase()
print("".join(S))
Buggy python submission (verdict: Time Limit Exceeded):
N,K = list(map(int,input().split()))
ans = 0
for i in range(N):
  a = i
  b = 1
  while a<K:
    a = a*2
    b = b*0.5
  ans += b*1/N
print(ans)
  
  

Fixed submission:
N,K = list(map(int,input().split()))
ans = 0
for i in range(N):
  a = i+1
  b = 1
  while a<K:
    a = a*2
    b = b*0.5
  ans += b*1/N
print(ans)
Buggy python submission (verdict: Runtime Error):
def dfs(p,v,c):
    ans[v]=c
    for i in E[v]:
        if i[0]==p:
            continue
        if i[1]%2==1:
            dfs(v,i[0],1-c)
        else:
            dfs(v,i[0],c)
N= int(input())
ans = [100]*(N+1)
memo = {i:False for i in range(1,N+1)}
E = {i: []for i in range(1,N+1)}
for i in range(N-1):
    u,v,w = list(map(int,input().split()))
    E[v].append((u,w))
    E[u].append([v,w])
dfs(-1,1,1)
for i in range(1,N+1):
    print(ans[i])

Fixed submission:
import sys
sys.setrecursionlimit(10**7)
def dfs(p,v,c):
    ans[v]=c
    for i in E[v]:
        if i[0]==p:
            continue
        if i[1]%2==1:
            dfs(v,i[0],1-c)
        else:
            dfs(v,i[0],c)
N= int(input())
ans = [100]*(N+1)
memo = {i:False for i in range(1,N+1)}
E = {i: []for i in range(1,N+1)}
for i in range(N-1):
    u,v,w = list(map(int,input().split()))
    E[v].append((u,w))
    E[u].append([v,w])
dfs(-1,1,1)
for i in range(1,N+1):
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = math.sqrt(n)
if int(a)<a:
  a=int(a)+1
else:
  a=int(a)
ans = 0
for i in range(1,a+1):
  if (n-i)%i==0 and n%((n-i)//i)==i:
    ans+=(n-i)//i
print(ans)

Fixed submission:
import math
n = int(input())
a = math.sqrt(n)
if int(a)<a:
  a=int(a)+1
else:
  a=int(a)
ans = 0
for i in range(1,a):
  if (n-i)%i==0 and n%((n-i)//i)==i:
    ans+=(n-i)//i
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
v = [int(x) for x in input().split()]
c = [int(x) for x in input().spplit()]
ans = [l-p for l,p in zip(v,c)]
ans1 = 0
for i in ans :
  ans1 += i if i>0 else 0
print(ans1)

Fixed submission:
N = int(input())
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
ans = [l-p for l,p in zip(v,c)]
ans1 = 0
for i in ans :
  ans1 += i if i>0 else 0
print(ans1)
Buggy python submission (verdict: Runtime Error):
N,K = list(map(int,input().split()))
A = input()
A = list(A)
A = list(map(int,A))
l = [0]
s = []

for i in range(N-1):
    if A[i] != A[i+1]:
        l.append(i+1)
        s.append(l[len(l)-1]-l[len(l)-2])
l.append(N)
s.append(l[len(l)-1]-l[len(l)-2])
a = 0
right = 0
left = 0
g = 0
su = 0
if A[0] == 0:
    for i in range(len(s)):
        print(right)
        su +=s[right]
        if right%2==0:
            g += 1
        right +=1
        if g<=K:
            a = max(a,su)
        else:
            while g>K:
              su -= s[left]
              if left%2==0:
                  g -=1
              left +=1
        a = max(a,su)
else:
    for i in range(len(s)):
        su +=s[right]
        if right%2==1:
            g += 1
        right +=1
        if g<=K:
            a = max(a,su)
        else:
            while g>K:
              su -= s[left]
              if left%2==1:
                  g -=1
              left +=1
        a = max(a,su)

print(a)

Fixed submission:
A,B = list(map(int,input().split()))
a = 0
for i in range(2):
    a= a+max(A,B)
    if A>B:
        A = A-1
    else:
        B = B-1
print(a)
Buggy python submission (verdict: Runtime Error):
S = input()
ans = 0
cnt = 0
for i in range(len(S)):
  if S[i] == "A" or S[i] =="G" or S[i] =="C" orS[i] =="T":
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(ans)

Fixed submission:
S = input()
ans = 0
cnt = 0
for i in range(len(S)):
  if S[i] == "A" or S[i] =="G" or S[i] =="C" or S[i] =="T":
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0

print(max(ans,cnt))
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans =0
for i in range(N):
  a,b = input().split()
  a = int(a)
  if b=="JPY":
    ans+=a
  else:
    ans +=a*380000
print(ans)

Fixed submission:
N = int(input())
ans =0
for i in range(N):
  a,b = input().split()
  a = float(a)
  if b=="JPY":
    ans+=a
  else:
    ans +=a*380000
print(ans)
Buggy python submission (verdict: Runtime Error):
def rec (i,a,b,c):
    if i==N:
        if a==0 and b==0 and c==0:
            return INF
        else:
            return abs(a-A)+abs(b-B)+abs(c-C)
    res = rec(i+1,a,b,c)
    
    res = min(res,rec(i+1,a+L[i],b,c)+(10 if a>0 else 0))
    res = min(res,rec(i+1,a,b+L[i],c)+(10 if b>0 else 0))
    res = min(res,rec(i+1,a,b,c+L[i])+(10 if c>0 else 0))
    
    return res
N,A,B,C = list(map(int,input().split()))
L = [int(input()) for _ in range(N)]
print(rec(0,0,0,0))

Fixed submission:
def rec (i,a,b,c):
    if i==N:
        if a==0 or b==0 or c==0:
            return INF
        else:
            return abs(a-A)+abs(b-B)+abs(c-C)
    res = rec(i+1,a,b,c)
    
    res = min(res,rec(i+1,a+L[i],b,c)+(10 if a>0 else 0))
    res = min(res,rec(i+1,a,b+L[i],c)+(10 if b>0 else 0))
    res = min(res,rec(i+1,a,b,c+L[i])+(10 if c>0 else 0))
    
    return res
N,A,B,C = list(map(int,input().split()))
INF=10**8
L = [int(input()) for _ in range(N)]
print(rec(0,0,0,0))
Buggy python submission (verdict: Runtime Error):
import fractions
N = int(input())
A = [int(x) for x in input().split()]
a = A[0]
for i in range(1,N):
  a =fractions.gcd(a,A[i])
print(a)

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

A = list(map(int,input().split()))
sorted(A)
B =[0,2,5,5,4,5,6,3,7,6]
C =[]
for i in A:
    C.append(B[i])
dp = [-1]*(N+1)
dp[0] = 0
for i in range(N+1):
    for a in range(len(C)):
        if i+C[a]<=N and 0<=dp[i]:
            dp[i+C[a]] = max(dp[i]*10+A[a],dp[i+C[a]])
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
N,K = [int(x) for x in input().split()]
A = [0]+[int(x) for x in input().split()]
dp = [10**9]*(N+1)
dp[1] = 0
for i in range(1,N):
  k =1
  while k<=K and i+k<=N:
    dp[i+k] = min(dp[i+k],dp[i]+abs(A[i]-A[i+k]))
    k+=1
print(dp[N])



Fixed submission:
N,K = [int(x) for x in input().split()]
A = [0]+[int(x) for x in input().split()]
dp = [10**9]*(N+1)
dp[1] = 0
for i in range(1,N):
  k =1
  while k<=K and i+k<=N:
    dp[i+k] = min(dp[i+k],dp[i]+abs(A[i]-A[i+k]))
    k+=1
print(dp[N])
Buggy python submission (verdict: Runtime Error):
N,M = [int(x) for x in input().split()]
E ={i: [] for i in range(1, N+1)}
for _ in range(M):
  u,v = [int(x) for x in input().split()]
  E[u].append(v)
#print(E)
dp =[-1]*(N+1)
def memo(v):
  if dp[v]!= -1:
    return dp[v]
  res = 0
  for nv in E[v]:
    res = max(res,memo(nv)+1)
  dp[v] =res
  return dp[v]
res = 0
for v in range(1,N+1):
  res = max(res,memo(v))
print(res)

Fixed submission:
import sys
sys.setrecursionlimit(4100000)
N,M = [int(x) for x in input().split()]
E ={i: [] for i in range(1, N+1)}
for _ in range(M):
  u,v = [int(x) for x in input().split()]
  E[u].append(v)
#print(E)
dp =[-1]*(N+1)
def memo(v):
  if dp[v]!= -1:
    return dp[v]
  res = 0
  for nv in E[v]:
    res = max(res,memo(nv)+1)
  dp[v] =res
  return dp[v]
res = 0
for v in range(1,N+1):
  res = max(res,memo(v))
print(res)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N ==1:
  print("Hello World")
else:
  A,B = [int(x) for x in input().split()]
  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):
N,T = [int(x) for x in input().split()]
ans =100000000
for i in range(N):
  c,t =[int(x) for x in input().split()]
  if t<=T:
    ans = min(c,ans)
if ans!=100000000
    print(ans)
else:
  print("TLE")

Fixed submission:
N,T = [int(x) for x in input().split()]
ans =100000000
for i in range(N):
  c,t =[int(x) for x in input().split()]
  if t<=T:
    ans = min(c,ans)
if ans!=100000000:
  print(ans)
else:
  print("TLE")
Buggy python submission (verdict: Runtime Error):
S = input()
for i in range(3):
  if S[i]=="9":
    S[i]="1"
  elif S[i]=="1":
    S[i] ="9"
print(S)

Fixed submission:
S = list(input())
for i in range(3):
  if S[i]=="9":
    S[i]="1"
  elif S[i]=="1":
    S[i] ="9"
print("".join(S))
Buggy python submission (verdict: Runtime Error):
import collections as col
N= int(input())
A = [int(x) for x in input().split()]
a = A[::2]
a = col.Counter(a)
b = A[1::2]
b = col.Counter(b)
ans = 0
i = 0
j = 0
#while a.most_common()[i][0]!=b.most_common()[j][0]:
if a.most_common(1)[0][0]!=b.most_common(1)[0][0]:
  ans += sum(a.values())+sum(b.values)-a.most_common(1)[0][1]-b.most_common(1)[0][1]
print(ans)

Fixed submission:
import collections as col
N= int(input())
A = [int(x) for x in input().split()]
a = A[::2]

a = col.Counter(a)
b = A[1::2]

b = col.Counter(b)
ans = 0
i = 0
j = 0
if len(a.most_common())==1 and len(b.most_common())==1 and a.most_common()[i][0]==b.most_common()[j][0]:
  print(N//2)
  exit()
while a.most_common()[i][0]==b.most_common()[j][0]:
  m=a.most_common()[i][1]
  n=b.most_common()[j][1]
  if m>n:
    j +=1
  elif m==n:
      if a.most_common()[i+1][1]>b.most_common()[j+1][1]:
        i+=1
      else:
        j +=1
  else:
    i +=1
#print(i,j,a,b)
ans += sum(a.values())+sum(b.values())-a.most_common()[i][1]-b.most_common()[j][1]
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [[input()] for _ in range(N)]
for i in range(N):
  if b==A[i][0]:
    b= A[i][-1]
  else:
    print("No")
    exit()
A.sort()
for i in range(N-1):
  if A[i]==A[i+1]:
    print("No")
    exit()
print("Yes")

Fixed submission:
N = int(input())
A = [input() for _ in range(N)]
b=A[0][0]
for i in range(N):
  if b==A[i][0]:
    b=A[i][-1]
  else:
    print("No")
    exit()
A.sort()
for i in range(N-1):
  if A[i]==A[i+1]:
    print("No")
    exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
H,W = [int(x) for x in input().split()]
ans = []
for i in range(H):
  cnt= 0
  S = list(input())
  for j in range(W):
    if S[j]==".":
      cnt +=1
  if cnt!=W:
    ans.append(S)
ans1 = []
for j in range(len(ans[0])):
  cnt = 0
  for i in range(len(ans)):
    if ans[i][j]==".":
      cnt+=1
  if cnt ==len(ans):
    ans1.append(j)
for i in range(len(ans)):
  for j in ans1:
    ans[i][j]=0
for i in range(len(ans)):
  for j in range(len(ans[0])):
    if ans[i][j] !=0:
    	print(ans[i][j],end"")
  print()

Fixed submission:
H,W = [int(x) for x in input().split()]
ans = []
for i in range(H):
  cnt= 0
  S = list(input())
  for j in range(W):
    if S[j]==".":
      cnt +=1
  if cnt!=W:
    ans.append(S)
ans1 = []
for j in range(len(ans[0])):
  cnt = 0
  for i in range(len(ans)):
    if ans[i][j]==".":
      cnt+=1
  if cnt ==len(ans):
    ans1.append(j)
for i in range(len(ans)):
  for j in ans1:
    ans[i][j]=0
for i in range(len(ans)):
  for j in range(len(ans[0])):
    if ans[i][j] !=0:
    	print(ans[i][j],end="")
  print()
Buggy python submission (verdict: Runtime Error):
N = list(input())
K = int(input())
for i in range(len(K)) :
  a = int(N[i])
  if a!=1:
    print(a)
    exit()
print(1)

Fixed submission:
N = list(input())
K = int(input())
for i in range(K) :
  a = int(N[i])
  if a!=1:
    print(a)
    exit()
print(1)

Buggy python submission (verdict: Runtime Error):
N = list(input())
K = int(input())
for i in range(len(K)) :
  a = int(i)
  if a!=1:
    print(a)
    exit()
print(1)

Fixed submission:
N = list(input())
K = int(input())
for i in range(K) :
  a = int(N[i])
  if a!=1:
    print(a)
    exit()
print(1)

Buggy python submission (verdict: Runtime Error):
N = list(input())
K = int(input())
for i in N :
  a = int(i)
  ans += a**(5*10**15)
  if ans>=K:
    print(a)

Fixed submission:
N = list(input())
K = int(input())
for i in range(K) :
  a = int(N[i])
  if a!=1:
    print(a)
    exit()
print(1)
Buggy python submission (verdict: Runtime Error):
def shakutori(a,M):
  left =0
  right = 0
  su = 0
  ans = 0
  for i in range(len(a)):
    su +=a[right]
    right +=1
    if su%M==0:
      ans+=1
      while su%M!=0:
        su -=a[left]
        left+=1
  return ans
from itertools import accumulate
N,M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A = list(accumulate(A))
A = list(map(lambda x: x%M,A))
ans = {}
ans1=0
for i in range(N):
  if A[i] in ans:
    ans[A[i]] +=1
  else:
    ans[A[i]] =1
  ans1 += ans[A[i]]-1
ans1 += ans[0]
print(ans1)

Fixed submission:
def shakutori(a,M):
  left =0
  right = 0
  su = 0
  ans = 0
  for i in range(len(a)):
    su +=a[right]
    right +=1
    if su%M==0:
      ans+=1
      while su%M!=0:
        su -=a[left]
        left+=1
  return ans
from itertools import accumulate
N,M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A = list(accumulate(A))
A = list(map(lambda x: x%M,A))
ans = {}
ans1=0
for i in range(N):
  if A[i] in ans:
    ans[A[i]] +=1
  else:
    ans[A[i]] =1
  ans1 += ans[A[i]]-1
if 0 in ans:
  ans1 += ans[0]
print(ans1)
Buggy python submission (verdict: Runtime Error):
for i in range(len(S)):
  if i==0 and S[i]!="A":
    print("WA")
    exit()
  if 2<=i<=len(S)-2 and S[i]=="C":
    cnt+=1
    if cnt>1:
      print("WA")
      exit()
  if 1<=i<=len(S)-1:
    if S[i]!="C" and S[i].isupper():
      print("WA")
      exit()
print("AC")

Fixed submission:
S = input()
cnt = 0
for i in range(len(S)):
  if i==0 and S[i]!="A":
    print("WA")
    exit()
  if 2<=i<=len(S)-2 and S[i]=="C":
    cnt+=1
    if cnt>1:
      print("WA")
      exit()
  if 1<=i<=len(S)-1:
    if S[i]!="C" and S[i].isupper():
      print("WA")
      exit()
if cnt<1:
  print("WA")
  exit()
print("AC")

Buggy python submission (verdict: Runtime Error):
S = input()
cnt = 0
for i in range(len(S)):
  if i==0 and S[i]!="A":
    print("WA")
    exit()
  if 2<=i<=len(i)-2 and S[i]=="C":
    cnt+=1
    if cnt>1:
      print("WA")
      exit()
  if 1<=i<=len(i)-1:
    if S[i]!="C" and S[i].isupper():
      print("WA")
      exit()
print("AC")
    

Fixed submission:
S = input()
cnt = 0
for i in range(len(S)):
  if i==0 and S[i]!="A":
    print("WA")
    exit()
  if 2<=i<=len(S)-2 and S[i]=="C":
    cnt+=1
    if cnt>1:
      print("WA")
      exit()
  if 1<=i<=len(S)-1:
    if S[i]!="C" and S[i].isupper():
      print("WA")
      exit()
if cnt<1:
  print("WA")
  exit()
print("AC")
Buggy python submission (verdict: Runtime Error):
N = input()
a = int(N)
for i in range(len(N)):
  b += int(N[i])
print("Yes" if a%b==0 else "No")

Fixed submission:
N = input()
a = int(N)
b = 0
for i in range(len(N)):
  b += int(N[i])
print("Yes" if a%b==0 else "No")
Buggy python submission (verdict: Time Limit Exceeded):
N,C =[int(x) for x in input().split()]
D = [[int(x) for x in input().split()] for _ in range(C)]
c = [[int(x) for x in input().split()] for _ in range(N)]
c1 = []
c2 = []
c3 = []
for i in range(1,N+1):
  for j in range(1,N+1):
    if (i+j)%3==0:
      c1.append(c[i-1][j-1])
    elif (i+j)%3==1:
      c2.append(c[i-1][j-1])
    elif (i+j)%3==2:
      c3.append(c[i-1][j-1])
su = 0
ans = 1000000
for i in range(C):
  for j in range(i+1,C):
    for k in range(j+1,C):
      for a,b,c in [[i,j,k],[j,i,k],[k,j,i],[i,k,j],[k,i,j],[j,k,i]]:
        su = 0
        for l in range(max(len(c1),len(c2),len(c3))):
          su += (0 if l>=len(c1) else D[c1[l]-1][a])+(0 if l>=len(c2) else D[c2[l]-1][b])+(0 if l>=len(c3) else D[c3[l]-1][c])
        ans = min(ans,su)
print(ans)

Fixed submission:
N,C =[int(x) for x in input().split()]
D = [[int(x) for x in input().split()] for _ in range(C)]
c = [[int(x) for x in input().split()] for _ in range(N)]
c1 = []
c2 = []
c3 = []
for i in range(1,N+1):
  for j in range(1,N+1):
    if (i+j)%3==0:
      c1.append(c[i-1][j-1])
    elif (i+j)%3==1:
      c2.append(c[i-1][j-1])
    elif (i+j)%3==2:
      c3.append(c[i-1][j-1])
su = 0
ans = 100000000000000
import collections as col
c1 = col.Counter(c1)
c2 = col.Counter(c2)
c3 = col.Counter(c3)
#print(c1,c2,c3)
for i in range(C):
  for j in range(i+1,C):
    for k in range(j+1,C):
      for a,b,c in [[i,j,k],[j,i,k],[k,j,i],[i,k,j],[k,i,j],[j,k,i]]:
        su = 0
        for l in range(1,C+1):
          #print(c1[l],c2[l],c3[l])
          su += D[l-1][a]*c1[l]+D[l-1][b]*c2[l]+D[l-1][c]*c3[l]
        ans = min(ans,su)
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,C = [int(x) for x in input().split()]
K = int(input())
ma = max(A,B,C)
mb = ma*2**K
print(sum(A,B,C)-ma+mb)

Fixed submission:
A= [int(x) for x in input().split()]
K = int(input())
ma = max(A)
mb = ma*2**K
print(sum(A)-ma+mb)
Buggy python submission (verdict: Runtime Error):
N,X = [int(x) for x in input().split()]
mi = 110000000
for i in range(N):
  x = int(input())
  ans +=x 
  mi = min(x,mi)
print(N+(X-ans)//mi)

Fixed submission:
N,X = [int(x) for x in input().split()]
mi = 110000000
ans = 0
for i in range(N):
  x = int(input())
  ans +=x 
  mi = min(x,mi)
print(N+(X-ans)//mi)
Buggy python submission (verdict: Runtime Error):
import bisect from bisect_left
N,M,X = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
b = bisect_left(A,X)
print(min(b,N-1-B))

Fixed submission:
from bisect import bisect_left
N,M,X = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
b = bisect_left(A,X)
if b==0:
  print(0)
  exit()
print(min(b,M-b))
Buggy python submission (verdict: Runtime Error):
S = input()
if all("a" in S,"b" in S ,"c" in S):
  print("Yes")
else:
  print("No")

Fixed submission:
S = input()
cnt = 0
for i in ["a","b","c"]:
  if i in S:
    cnt+=1
print("Yes" if cnt==3 else"No")
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = [int(x) for x in input().split()]
c = [i for i in range(A,B+1)]
d = c[:K]
d+=c[-K:]
d = list(set(d))
d.sort()
print(*d)

Fixed submission:
A,B,K = [int(x) for x in input().split()]
if B-A<K:
  c = [i for i in range(A,B+1)]
  print(*c)
  exit()
c = [i for i in range(A,A+K)]
d = [i for i in range(B-K+1,B+1)]
d =c+d
d = list(set(d))
d.sort()
print(*d)

Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = [int(x) for x in input().split()]
c = [i for i in range(A,B+1)]
d = c[:K]
d+=c[-K:]
d = list(set(d))
d.sort()
print(*d)

Fixed submission:
A,B,K = [int(x) for x in input().split()]
if B-A<K:
  c = [i for i in range(A,B+1)]
  print(*c)
  exit()
c = [i for i in range(A,A+K)]
d = [i for i in range(B-K+1,B+1)]
d =c+d
d = list(set(d))
d.sort()
print(*d)
Buggy python submission (verdict: Runtime Error):
A,B,C =[int(x) for x in input().split()]
d = max(A,B,C)
l = [d-A,d-B,d-C]
su = sum(l)
if l%2==0:
  print(l%2)
else:
  print(1+(l+1)//2)

Fixed submission:
A,B,C =[int(x) for x in input().split()]
d = max(A,B,C)
l = [d-A,d-B,d-C]
su = sum(l)
if su%2==0:
  print(su//2)
else:
  print(1+(su+1)//2)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.array([[int(x) for x in input().split()] for _ in range(2)])
ans = 0
for i in range(1,N+1):
  #print(A[0,:i],A[1,i-1:])
  ans = max(ans,sum(A[0,:i])+sum(A[1,i-1:]))
print(ans)

Fixed submission:
import numpy as np
N = int(input())
A = np.array([[int(x) for x in input().split()] for _ in range(2)])
ans = 0
for i in range(1,N+1):
  #print(A[0,:i],A[1,i-1:])
  ans = max(ans,sum(A[0,:i])+sum(A[1,i-1:]))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np
def main():
    input = sys.stdin.readline
    def gen_pattern(x):
        if x < K-1:
            return [[0, x+1], [x+K+1, 2*K]]
        else:
            return [[x-K+1, x+1]]
    def inputs():
        return [int(x) for x in input().split()]
    def inputstr():
        return list(input().split())
    N,K = inputs()
    BB = np.zeros((2*K+1,2*K+1))
    for i in range(N):
        x,y,c = inputstr()
        if c=="W":
            y = int(y)+K
        x = int(x)%(2*K)
        y = int(y)%(2*K)
        #BB[x,y] += 1
        for shift in [0,K]:
            for b,t in gen_pattern((y+shift)%(2*K)):
                for l,r in gen_pattern((x+shift)%(2*K)):
                    BB[b,l] +=1
                    BB[b,r] -=1
                    BB[t,l] -=1
                    BB[t,r] +=1
    ans = (np.max(np.cumsum(np.cumsum(BB, axis=1), axis=0)))
    #print(BB)
    print(int(ans))
main()

Fixed submission:
import sys
import numpy as np
def main():
    input = sys.stdin.readline
    def gen_pattern(x):
        if x < K-1:
            return [[0, x+1], [x+K+1, 2*K]]
        else:
            return [[x-K+1, x+1]]
    def inputs():
        return [int(x) for x in input().split()]
    def inputstr():
        return list(input().split())
    N,K = inputs()
    BB = [[0]*(2*K+1) for _ in range(2*K+1)]
    for i in range(N):
        x,y,c = inputstr()
        if c=="W":
            y = int(y)+K
        x = int(x)%(2*K)
        y = int(y)%(2*K)
        #BB[x,y] += 1
        for shift in [0,K]:
            for b,t in gen_pattern((y+shift)%(2*K)):
                for l,r in gen_pattern((x+shift)%(2*K)):
                    BB[b][l] +=1
                    BB[b][r] -=1
                    BB[t][l] -=1
                    BB[t][r] +=1
    ans = (np.max(np.cumsum(np.cumsum(BB, axis=1), axis=0)))
    #print(BB)
    print(int(ans))
main()
Buggy python submission (verdict: Runtime Error):
A,B = [int(x) for x in input().split()]
S = input()
for i in range(A+B+1):
  if i==A and S[i]!="-":
    print("No")
    exit()
  if i!=A and S[i]=="-" or int(S[i])>=10:
    print("No")
    exit()
print("Yes")

Fixed submission:
A,B = [int(x) for x in input().split()]
S = input()
for i in range(A+B+1):
  if i==A and S[i]!="-":
    print("No")
    exit()
  if i!=A and (S[i]=="-" or int(S[i])>=10):
    print("No")
    exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
A,B = [int(x) for x in input().split()]
S = input()
for i in range(A+B+1):
  if i==A and S[i]!="-":
    print("No")
  if i!=A and int(S[i])>=10:
    print("No")
print("Yes")

Fixed submission:
A,B = [int(x) for x in input().split()]
S = input()
for i in range(A+B+1):
  if i==A and S[i]!="-":
    print("No")
    exit()
  if i!=A and (S[i]=="-" or int(S[i])>=10):
    print("No")
    exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
import numpy as np
from collections import Counter
import collections
round = lambda x:(x*2+1)//2
a = list(map(float,input().split()))
a = np.array(a)
X = a[0]
Y = a[1]
i = 0
while(X=<Y):
  X * = 2
  i++
print(i)

Fixed submission:
import math
x,y=map(int,input().split())
i=0
while(x<=y):
  x*=2
  i+=1
print(i)