Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
h = list(input() for x in range(N))
a = []
c = 0
for i in range(0, N):
    if h[i] in a:
        c += 1
    else:
        a.append(h[i])
print(N - c)

Fixed submission:
import collections

N = int(input())
h = list(input() for x in range(N))
c = collections.Counter(h)
print(len(c))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
h = list(input() for x in range(N))
a = []
for i in range(0, N):
    if h[i] not in a:
        a.append(h[i])
print(len(a))

Fixed submission:
import collections

N = int(input())
h = list(input() for x in range(N))
c = collections.Counter(h)
print(len(c))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
h = [input() for x in range(N)]
a = []
for i in range(0, N):
    if h[i] not in a:
        a.append(h[i])
print(len(a))

Fixed submission:
import collections

N = int(input())
h = list(input() for x in range(N))
c = collections.Counter(h)
print(len(c))
Buggy python submission (verdict: Runtime Error):
import fractions
pi = fractions.pi
R = int(input())
print(2*pi*R)

Fixed submission:
import math
R = int(input())
print(2*math.pi*R)

Buggy python submission (verdict: Runtime Error):
import fractions
R = int(input())
print(2*math.pi*R)

Fixed submission:
import math
R = int(input())
print(2*math.pi*R)

Buggy python submission (verdict: Runtime Error):
R = int(input())
print(2*math.pi*R)

Fixed submission:
import math
R = int(input())
print(2*math.pi*R)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
h=list(map(int,input().split()))
c = 0
A = [h[0]]
for i in range(0,N):
    A.append(h[i])
    if min(A) >= h[i]:
        c += 1
print(c)

Fixed submission:
N = int(input())
h=list(map(int,input().split()))
c = 0
a = h[0]
for i in range(0,N):
    if a > h[i]:
        a = h[i]
    if a >= h[i]:
        c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
h=list(map(int,input().split()))
c = 0
a = h[0]
for i in range(0,N):
    s = 0
    if h[i] > a:
        a = h[i]
    else:
        for j in range(0,i):
            if h[j] >= h[i]:
                s += 1
        if s == i:
            c += 1
print(c)

Fixed submission:
N = int(input())
h=list(map(int,input().split()))
c = 0
a = h[0]
for i in range(0,N):
    if a > h[i]:
        a = h[i]
    if a >= h[i]:
        c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
h=list(map(int,input().split()))
c = 0
for i in range(0,N):
    s = 0
    for j in range(0,i):
        if h[j] >= h[i]:
            s += 1
    if s == i:
        c += 1
print(c)

Fixed submission:
N = int(input())
h=list(map(int,input().split()))
c = 0
a = h[0]
for i in range(0,N):
    if a > h[i]:
        a = h[i]
    if a >= h[i]:
        c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
K,X=input().split()
if 500 * K >= X:
  return 'Yes'
else:
  return 'No'

Fixed submission:
K,X=(int(x) for x in input().split())
if 500 * K >= X:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())
c = 0
for i in range(0,N):
    if S[i] == 'A' and S[i+1]== 'B' and S[i+2] == 'C':
        c += 1
print(c)

Fixed submission:
N = int(input())
S = str(input())
c = 0
for i in range(0,N):
    if S[i:i+3] == 'ABC':
        c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())
c = 0
for i in range(0,len(S)):
    if S[i] == 'A' and S[i+1]== 'B' and S[i+2] == 'C':
        c += 1
print(c)

Fixed submission:
N = int(input())
S = str(input())
c = 0
for i in range(0,N):
    if S[i:i+3] == 'ABC':
        c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
input(A),split(B)
print(A-2*B)

Fixed submission:
A,B=map(int,input().split())
s=A-2*B
if s<0:
  print(0)
else:
  print(s)
Buggy python submission (verdict: Runtime Error):
N=int(input())
d=[input() for i in range(N)]
s=0
for i in range(0,len(d)):
  t=0
  for j in range(0,len(d)):
    t+=d[i]*d[j]
  s+=t
print(s)

Fixed submission:
N=int(input().rstrip())
d = list(map(int, input().split())) 
a=0
t=0
for i in range(N-1):
  t+=1
  for j in range(t,N):
    a+=d[i]*d[j]
print(a)
Buggy python submission (verdict: Runtime Error):
N=int(print())
if N % 2 == 1:
  print(((N+1)/2)/N)
else:
  print((N/2)/N)


Fixed submission:
N=int(input())
if N % 2 == 1:
  print(((N+1)/2)/N)
else:
  print((N/2)/N)

Buggy python submission (verdict: Runtime Error):
N=int(print())
if N % 2 == 1:
  print((N+1)/2)
else:
  print(N/2)

Fixed submission:
N=int(input())
if N % 2 == 1:
  print(((N+1)/2)/N)
else:
  print((N/2)/N)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
sum=0
a=list(map(int, input().split()))
for i in range(n):
  for j in range(i+1, n):
    #print(i,j)
    sum+=a[i]*a[j]
  sum = sum%((10**9)+7)

print(sum)


Fixed submission:
n=int(input())
sums=0
a=list(map(int, input().split()))
b = sum(a)
for i in range(n):
  b -= a[i]
  sums += a[i]*b
  sums = sums%((10**9)+7)
print(sums)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
sum=0
a=list(map(int, input().split()))
for i in range(n):
  for j in range(i+1, n):
    #print(i,j)
    sum+=a[i]*a[j]
    sum = sum%((10**9)+7)

print(sum)


Fixed submission:
n=int(input())
sums=0
a=list(map(int, input().split()))
b = sum(a)
for i in range(n):
  b -= a[i]
  sums += a[i]*b
  sums = sums%((10**9)+7)
print(sums)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
sum=0
a=list(map(int, input().split()))
for i in range(n):
  for j in range(i+1, n):
    #print(i,j)
    sum+=a[i]*a[j]
    sum = sum%((10**9)+7)

print(sum)

Fixed submission:
n=int(input())
sums=0
a=list(map(int, input().split()))
b = sum(a)
for i in range(n):
  b -= a[i]
  sums += a[i]*b
  sums = sums%((10**9)+7)
print(sums)
Buggy python submission (verdict: Runtime Error):
s=input()
if s=='RRR':
  print(3)
elif s=='SSS':
  print(0)
elif (s=='SRR' or s=='RRS'):
  prinr(2)
else:
  print(1)

Fixed submission:
s=input()
if s=='RRR':
  print(3)
elif s=='SSS':
  print(0)
elif (s=='SRR' or s=='RRS'):
  print(2)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
r_c = 0
ch = 0
for i in S:
  if i == "R":
    r_c += 1
for i in range(r_c):
  if i == "W"
    ch += 1
print(ch)

Fixed submission:
N = int(input())
S = input()
r_c = 0
ch = 0
for i in S:
  if i == "R":
    r_c += 1
for i in range(r_c):
  if S[i] == "W":
    ch += 1
print(ch)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = [0]*(N+1)
RANGE = 333
for i in range(1, RANGE):
  if i**2 <= N+1:
    for j in range(1, RANGE):
      if i**2 + j**2 + i*j <= N+1:
        for k in range(1, RANGE):
          wd = i**2 + j**2 + k**2 + i*j + j*k + k*i
          if wd <= N+1:
            #print(wd)
            #print(i, j, k)
            ans[wd] += 1
          else:
            break
      else:
        break
  else:
    break
    
for i in range(1,N+1):
  print(ans[i])

Fixed submission:
N = int(input())
ans = [0]*(N+1)
RANGE = 333
for i in range(1, RANGE):
  if i**2 <= N+1:
    for j in range(1, RANGE):
      if i**2 + j**2 + i*j <= N+1:
        for k in range(1, RANGE):
          wd = i**2 + j**2 + k**2 + i*j + j*k + k*i
          if wd < N+1:
            #print(wd)
            #print(i, j, k)
            ans[wd] += 1
          else:
            break
      else:
        break
  else:
    break
    
for i in range(1,N+1):
  print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = [0]*(N+1)
RANGE = 333
for i in range(1, RANGE):
  for j in range(1, RANGE):
    if i**2 + j**2 < N:
      for k in range(1, RANGE):
        wd = i**2 + j**2 + k**2 + i*j + j*k + k*i
        if wd < N:
          #print(wd)
          #print(i, j, k)
          ans[wd] += 1
for i in range(1,N+1):
  print(ans[i])

Fixed submission:
N = int(input())
ans = [0]*(N+1)
RANGE = 333
for i in range(1, RANGE):
  if i**2 <= N+1:
    for j in range(1, RANGE):
      if i**2 + j**2 + i*j <= N+1:
        for k in range(1, RANGE):
          wd = i**2 + j**2 + k**2 + i*j + j*k + k*i
          if wd < N+1:
            #print(wd)
            #print(i, j, k)
            ans[wd] += 1
          else:
            break
      else:
        break
  else:
    break
    
for i in range(1,N+1):
  print(ans[i])
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
prinr(a*b)

Fixed submission:
a, b = map(int, input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
import math
A, B = input().split()
B *= 100
print((A*B)/100))


Fixed submission:
A, B = input().split()
BA, BB = B.split(".")
#print(A, BA, BB)
print((int(A)*(int(BA)*100+int(BB))//100))
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(s[:-1])
if k == 3:
  print('bon')
elif k in [0, 1, 6, 8]:
  print('pon')
else:
  print('hon')

Fixed submission:
s = input()
k = int(s[-1])
if k == 3:
  print('bon')
elif k in [0, 1, 6, 8]:
  print('pon')
else:
  print('hon')
Buggy python submission (verdict: Runtime Error):
i = int(input())
count=0
while i < p:
  p = p*1.01
  count +=1
print(count)

Fixed submission:
X = int(input())

Y = 100
count = 0

while (X > Y):
  Y += int(0.01*Y)
  count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
10
1 1 1 1 1 1 1 1 1

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

k = [0]*N

for i in a:
  k[i-1] += 1

for i in k:
  print(i)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = list(map(int, input().split()))

a.sort(reverse = True)
sum = sum(a)

p = []

for i in a:
  #print(i, sum)
  if i > (sum // ( M * 4 )):
    p.append(i)

if len(p) >= M:
  print('Yes')
else:
  Print("No")


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

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

ksum= sum(k)
k.sort(reverse=True)
#print(k)
p = 'Yes'
for i in range(b):
    #print(i)
    if k[i] < ksum/4/b:
        p = 'No'
        break
print(p)
Buggy python submission (verdict: Runtime Error):
(red, blue) = list(input().split())
(p, q) = list(input().split())
st = input()

if red == st:
  print( p-1+ " " +q )
else:
  print( p+ " " +q-1 )


Fixed submission:
(red, blue) = list(input().split())
(p, q) = list(map(int, input().split()))
st = input()

if red == st:
  print( str(p-1)+ " " +str(q) )
else:
  print( str(p)+ " " +str(q-1) )
Buggy python submission (verdict: Runtime Error):
(a, b) = list(map(int, input().split()))

if a == b:
  print("Yes")
rlse:
  print("No")

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

if a == b:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = int(input())
k = list(map(int, input().split()))

count = 1

for i in range(1,len(k)+1):
  if k[i-1] > k[i]:
    count += 1

print(count)


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

count = 0
min =99999999

for i in range(len(k)):
  if min > k[i]:
    min= k[i]
    count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
a, b = list(map(int, input().split())
if a * 500  < b :
  print('No')
else:
  print('Yes')


Fixed submission:
a, b = list(map(int, input().split()))
if a * 500  < b :
            print('No')
else:
            print('Yes')
Buggy python submission (verdict: Runtime Error):
A, B = list(map(int, (input().split())))
k = -1
if A <= 9 && B <= 9:
  k = A * B
print(str(k))


Fixed submission:
A, B = list(map(int, (input().split())))
k = -1
if (A <= 9 ) and ( B <= 9):
  k = A * B
print(str(k))

Buggy python submission (verdict: Runtime Error):
A, B = list(map(int, (input().split())))
k = -1
if A <= 9 && B <= 9:
  k = A * B
print(k)


Fixed submission:
A, B = list(map(int, (input().split())))
k = -1
if (A <= 9 ) and ( B <= 9):
  k = A * B
print(str(k))
Buggy python submission (verdict: Runtime Error):
A, B = list(map(int,(input().split())))
C = A - 2 * B
if C < 0:
  return 0
else :
  return C


Fixed submission:
A, B = list(map(int,(input().split())))
C = A - 2 * B
if C < 0:
	C = 0
else :
	pass
print(C)

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

Fixed submission:
A, B = list(map(int,(input().split())))
C = A - 2 * B
if C < 0:
	C = 0
else :
	pass
print(C)
Buggy python submission (verdict: Runtime Error):
S = {"Sunny":"Cloudy", "Cloudy":"Cloudy", "Cloudy":"Sunny"}
k = input()

print(S[k])


Fixed submission:
S = input()
if S == 'Sunny' :
	print('Cloudy')
	
elif S == 'Cloudy':
	print('Rainy')
else:
	print('Sunny')

Buggy python submission (verdict: Runtime Error):
S = input()
if S eq 'Sunny' :
	print('Cloudy')
	
elif S eq 'Cloudy':
	print('Rainy')
else:
	print('Sunny')


Fixed submission:
S = input()
if S == 'Sunny' :
	print('Cloudy')
	
elif S == 'Cloudy':
	print('Rainy')
else:
	print('Sunny')
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
a = [K]*N
for i in range(Q):
  b = [1]*N
  s = int(input())
  b[s-1] = 0
  for j in range(N):
    a[j] -= b[j]

for i in a:
  if i > 0:
    print("Yes")
  else:
    print("No")


Fixed submission:
N, K, Q = map(int, input().split())
a = [-1*Q]*N
for i in range(Q):
  s = int(input())
  a[s-1] += 1

for i in a:
  #print(i)
  if K + i > 0:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())

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

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

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

sum = 0
tmpBox = N+1

for item in AryA:
	sum += AryB[item]
	if (item == tmpBox + 1):
		sum += AryC[tmpBox]

print sum

Fixed submission:
N = int(input())
AryA = list(map(int, input().split()))
AryB = list(map(int, input().split()))
AryC = list(map(int, input().split()))

sum = 0
tmpBox = N+1

for item in AryA:
	sum += AryB[item-1]
	if (item == tmpBox + 1):
		sum += AryC[tmpBox-1]
	tmpBox = item
print(sum)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,inpu().split()))
bef=99999999999999
count=0
for i in range(N):
  l=A.pop()
  if l > bef:
    count +=1
  else:
    count=0
  if max<=count:
    max=count
  bef=l
print(max)
    

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
bef=99999999999999
count=0
max=0
for i in range(N):
  l=A.pop()
  if l >= bef:
    count +=1
  else:
    count=0
  if max <= count:
    max=count
  bef=l
print(max)
Buggy python submission (verdict: Runtime Error):
a= input()
b= input()

if (int(a) >= 3200)
b = 'red'

print(b)

Fixed submission:
a= input()
b= input()

if (int(a) < 3200):
    b = 'red'

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

Fixed submission:
a, b, c = list(map(int, input().split()))
d = c - (a - b)
if d > 0:
  print(d)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
inputs = list(map(int, inpit().split()))

A = input[0]
B = input[1]
T = input[2]

Q = int(T / A)
print(Q)
X = Q* B
print(X)


Fixed submission:
inputs = list(map(int, input().split()))
 
A = inputs[0]
B = inputs[1]
T = inputs[2]
 
Q = int(T / A)
#print(Q)
X = Q* B
print(X)
Buggy python submission (verdict: Runtime Error):
N = int(input())

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

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

P = 0

for i in range(0,N+1):
  Y = V[i] - C[i]
  if Y >0:
    P += Y
print(Y)


Fixed submission:
N = int(input())

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

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

P = 0

for i in range(N):
  Y = V[i] - C[i]
  if Y >0:
    P += Y
print(P)
Buggy python submission (verdict: Runtime Error):
input1 = input().split()
N = input1[0]
Q = input1[1]
S = input()

flag = 0
count = 0
result = []

for q in range(int(Q)):
	
	input3 = input().split()
	
	l = int(input3[0])
	r = int(input3[1])+1
	
	for s in (range(l,r)):
		
		#print(s)
		if S[s-1] == 'A':
			flag += 1
			
		elif ((S[s-1] == 'C') and (flag == 1)):
			count += 1
			flag = 0
			
		else:
			flag = 0
			
	result.append(count)
	
	count = 0
	flag = 0
	
for i in result:
	print(i)

Fixed submission:
input = input()

a = {'A':'T', 'T':'A','C':'G','G':'C'}

print(a[input])
Buggy python submission (verdict: Runtime Error):
(a, b) = list(map(int, input().split()))
(c, d) = list(map(int, input().split()))

print(str((a-c)*(b-d))))

Fixed submission:
input1 = input().split()
input2 = input().split()

W = int(input1[0])
w = int(input2[0])
H = int(input1[1])
h = int(input2[1])

print(str((W-w)*(H-h)))
Buggy python submission (verdict: Runtime Error):
ソースコード
1
N = int(input())
2
a = list(map(int, input().split()))
3
dp = []
4
​
5
def mins(minval, val):
6
  if minval < val:
7
    return minval
8
  else:
9
    return val
10
​
11
for i in range(N):
12
  dp.append(10000000)
13
​
14
for i in range(len(a)):
15
  if i == 0:
16
    dp[0] = 0
17
  if i == 1:
18
    dp[1]= a[1] - a[0]
19
  dp[i] = min(dp[i], dp[i-1] + abs(a[i-1] - a[i]))
20
  dp[i] = min(dp[i], dp[i-2] + abs(a[i-2] - a[i]))
21
​
22

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
dp = []

def mins(minval, val):
	if minval < val:
			return minval
	else:
			return val

for i in range(N):
	dp.append(1000000000000)

for i in range(len(a)):
	if i == 0:
		dp[0] = 0
	if i == 2:
		dp[1]= abs(a[1] - a[0])
	
	
	dp[i] = min(dp[i], dp[i-1] + abs(a[i-1] - a[i]))
	dp[i] = min(dp[i], dp[i-2] + abs(a[i-2] - a[i]))
#print(dp)
print(dp[N-1])
Buggy python submission (verdict: Runtime Error):
N, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
count = 0
p = x

for i in a:
  if x - i >= 0:
    x -= i
    count += 1
if x > 0 and count != 0 and p >= a.sum() :
  count -= 1
print(count)

Fixed submission:
N, x = map(int, input().split())
a = list(map(int, input().split()))
p = x
a.sort()
count = 0

for i in a:
  if x - i >= 0:
    x -= i
    count += 1
if x > 0 and count != 0  and p > sum(a):
  count -= 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
min = 100000000000000
for i in range(1, (N+1)//2):
   A = str(i)
  B = str(N - i)
  ref = 0
  for a in A:
    ref += int(a)
  for b in B:
    ref += int(b)
  if ref < min:
    min = ref
print(min)

Fixed submission:
N = int(input())
min = 100000000000000
for i in range(1, N):
  A = str(i)
  B = str(N - i)
  ref = 0
  for a in A:
    ref += int(a)
  for b in B:
    ref += int(b)
  if ref < min:
    min = ref
print(min)
Buggy python submission (verdict: Time Limit Exceeded):
N, Y = map(int, input().split())
nn = Y // 10000 if (Y // 10000) < N else N
mm = Y // 5000  if (Y // 5000)  < N else N
ll = Y // 1000  if (Y // 1000)  < N else N

#print(nn, mm, ll)
ans = "-1 -1 -1"
for i in range(nn+1):
  for j in range(mm+1):
    if i + j > N:
      break
    for k in range(ll+1):
      if i + j + k > N:
        break
      if i + j + k != N:
        next
      else:
        #print(i, j, k)
        if (i * 10000 + j * 5000 + k * 1000) == Y:
          ans = str(i)+" "+str(j)+" "+str(k)
          break
print(ans)
  

Fixed submission:
N, Y = map(int, input().split())
nn = Y // 10000 if (Y // 10000) < N else N
mm = Y // 5000  if (Y // 5000)  < N else N
ll = Y // 1000  if (Y // 1000)  < N else N

#print(nn, mm, ll)
ans = "-1 -1 -1"
for i in range(nn+1):
  for j in range(mm+1):
    if i + j > N:
      break
    if (i * 10000 + j * 5000 + (N-i-j) * 1000) == Y:
          ans = str(i)+" "+str(j)+" "+str(N-i-j)
          break
print(ans)
Buggy python submission (verdict: Runtime Error):
a = sorted(input(), reverse=True)
b = sorted(input(), reverse=True)
aa = ''.join(a)
bb = ''.join(b)
ans = 'No'
for i in range(len(aa)):
  if aa[i] == bb[i]: continue
  if aa[i] < bb[i]:
    ans = 'Yes'
    break
  else:
    ans = 'No'
    break
print(ans)

Fixed submission:
a = sorted(input())
b = sorted(input(), reverse=True)
aa = ''.join(a)
bb = ''.join(b)
if aa < bb:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
a = sorted(input(), reverse=True)
b = sorted(input(), reverse=True)
aa = ''.join(a)
bb = ''.join(b)
ans = 'Yes'
for i in range(len(aa)):
  if aa[i] == bb[i]: continue
  if aa[i] < bb[i]:
    break
  else:
    ans = 'No'
    break
print(ans)

Fixed submission:
a = sorted(input())
b = sorted(input(), reverse=True)
aa = ''.join(a)
bb = ''.join(b)
if aa < bb:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
for i in N:
  sum += i
if sum % N == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
N = input()
sum = 0
for i in N:
  sum += int(i)
if int(N) % sum == 0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
k={}
def y(p):
  if p in k.keys():
    return k[p]
  if p == 0:
    return 2
  elif p == 1:
    return 1
  else:
    return y(p-2)+y(p-1)
print(y(N))

Fixed submission:
N=int(input())
k={}
def y(p):
  if p in k.keys():
    return k[p]
  if p == 0:
    return 2
  elif p == 1:
    return 1
  else:
    k[p] = y(p-2)+y(p-1)
    return k[p]
print(y(N))
Buggy python submission (verdict: Runtime Error):
a,b,c=list(input().split())
if a[-1]==b[1] and b[-1]==c[1]:
  print("Yes")
else:
  print("No")


Fixed submission:
a,b,c=input().split()
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
if a[-1]==b[1] and b[-1]==c[1]:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b,c=input().split()
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
class SegmentTreeMax():
  def __init__(self,n,init):
    self.offset=2**((n-1).bit_length())
    self.tree=[init]*(2*self.offset)
    self.init=init
  def update(self,pos,val):
    pos+=self.offset
    self.tree[pos]=val
    while pos>1:
      pos=pos//2
      self.tree[pos]=max(self.tree[2*pos],self.tree[2*pos+1])
  def query(self,l,r):
    l+=self.offset
    r+=self.offset
    ret=self.init
    while l<=r:
      ret=max(ret,self.tree[r])
      r=(r-1)//2
      ret=max(ret,self.tree[l])
      l=(l+1)//2
    return ret

n,k=map(int,input().split())
arr=[int(input()) for _ in range(n)]
lim=max(arr)
st=SegmentTreeMax(lim,0)
for val in arr:
  l=max(0,val-k)
  r=min(lim,val+k)
  tmp=st.query(l,r)
  st.update(val,tmp+1)
print(st.query(0,lim))

Fixed submission:
class SegmentTreeMax():
  def __init__(self,n,init):
    self.offset=2**((n-1).bit_length())
    self.tree=[init]*(2*self.offset)
    self.init=init
  def update(self,pos,val):
    pos+=self.offset
    self.tree[pos]=val
    while pos>1:
      pos=pos//2
      self.tree[pos]=max(self.tree[2*pos],self.tree[2*pos+1])
  def query(self,l,r):
    l+=self.offset
    r+=self.offset
    ret=self.init
    while l<=r:
      ret=max(ret,self.tree[r])
      r=(r-1)//2
      ret=max(ret,self.tree[l])
      l=(l+1)//2
    return ret

n,k=map(int,input().split())
arr=[int(input()) for _ in range(n)]
lim=max(arr)
st=SegmentTreeMax(lim,0)
for val in arr:
  l=max(0,val-k)
  r=min(lim,val+k)
  tmp=st.query(l,r)
  st.update(val,tmp+1)
print(st.query(0,lim))
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

import sys
input=sys.stdin.readline

n=int(input())
ans=0
for a in range(1,n+1):
    for b in range(1,n+1):
        if a*b>=n:
            break
        ans+=1
print(ans)

Fixed submission:
#!/usr/bin/env python3

import sys
input=sys.stdin.readline

n=int(input())
ans=0
for a in range(1,n+1):
    for b in range(1,n+1):
        if a*b>=n:
            break
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
ans=-10**18
if a<=0<=b or c<=0<=d:
  ans=0
ans=max(ans,a*c,a*d,b*c,b*d)
print(ans)

Fixed submission:
#!/usr/bin/env python3

import sys
input=sys.stdin.readline

a,b,c,d=map(int,input().split())
ans=-10**18
#x=0 or y=0
if a<=0<=b or c<=0<=d:
    ans=max(ans,0)
#x<0 and y>0
ans=max(ans,b*c)
#x>0 and y>0
ans=max(ans,b*d)
#x<0 and y<0
ans=max(ans,a*c)
#x>0 and y<0
ans=max(ans,a*d)
print(ans)