Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print("delicious" if b=c else "safe" if c-b-1<=a else "dangerous")

Fixed submission:
a,b,c = map(int,input().split())
print("delicious" if b>=c else "safe" if c-b-1<a else "dangerous")
Buggy python submission (verdict: Runtime Error):

import sys
input=sys.stdin.readline

def atc(atc):
    result=["1","2","3","4","5","6","7","8","9"][atc//400]
    return result
num=0
L1=[]
n=int(input())
L=list(map(int,input().split()))
for i in L:
    a=atc(i)
    if a=="9":
        num+=1
    else:L1.append(a)
b=len(set(L1))
print(b,b+num)

Fixed submission:
import sys
input=sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))

l = [0] * 9
mn = 0
for i in A:
    t = min(i // 400, 8)
    l[t] += 1
for i in range(8):
    if l[i] != 0:
        mn += 1
if mn == 0:
    mn = 1
    mx = l[8]
else:
    mx = mn + l[8]

print(mn, mx)

Buggy python submission (verdict: Runtime Error):

import sys
input=sys.stdin.readline

def atc(atc):
    result=["1","2","3","4","5","6","7","8","9"][atc//400]
    return result
num=0
L1=[]
n=int(input())
L=list(map(int,input().split()))
for i in L:
    a=atc(i)
    if a=="9":
        num+=1
    else:L1.append(a)
b=len(set(L1))
print(b,b+num)

Fixed submission:
import sys
input=sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))

l = [0] * 9
mn = 0
for i in A:
    t = min(i // 400, 8)
    l[t] += 1
for i in range(8):
    if l[i] != 0:
        mn += 1
if mn == 0:
    mn = 1
    mx = l[8]
else:
    mx = mn + l[8]

print(mn, mx)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
L=[list(map(str,input())) for i in rage(a)]
L.insert(0,[*]*(a+2))])
L.insert(-1,[*]*(a+2))])
for i in L
print("".join(i))

Fixed submission:
import sys
input = sys.stdin.readline
h,w=map(int,input().split())
answer=["#"*(w+2)]
for _ in range(h):
    answer.append("#"+input()[:-1]+"#")
answer.append("#"*(w+2))
print(*answer,sep="\n")
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N=int(input())
L=[]
for i in range(N):
   L.append(list(input()))
L1=Counter(L[0])&Counter(L[1])
for i in range(2,N):
    L1=Counter(L[i])&L1
ans=[i*L1[i] for i in L1]
print("".join((ans)))


Fixed submission:
from collections import Counter
n=int(input())
s=Counter(input())
for i in range(n-1):
    s&=Counter(input())
print("".join(sorted(s.elements())))
Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
print([_+y+z for _ in range(a+1) for y in range(a+1) for z in range(a+1)].count(b))



Fixed submission:
k,s=map(int,input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0<=s-y-z<=k]))

Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
print([_+y+z for _ in range(a+1) for y in range(a+1) for z in range(a+1)].count(b))

Fixed submission:
k,s=map(int,input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0<=s-y-z<=k]))

Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
l = [x+y+z for x in range(a+1) for y in range(a+1) for z in range(a+1)]
print(l.count(b))

Fixed submission:
k,s=map(int,input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0<=s-y-z<=k]))
Buggy python submission (verdict: Runtime Error):
S=list(input())
stack=[]
for s in S:
    if s!="B":
        stack.append(s)
    else:
        stack.pop()
print("".join(stack))

Fixed submission:
S=list(input())
stack=[]
for s in S:
    if s!="B":
        stack.append(s)
    elif len(stack)!=0:
        stack.pop()


print("".join(stack))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np
input = sys.stdin.buffer.readline
a,b=map(int,input().split())
L=[i for i in range(a,b+1)]
L1=np.array(L)
L2=np.prod(L1)
print("Positive" if L2>0 else "Zero" if L2==0 else "Negative")

Fixed submission:
import sys
input = sys.stdin.buffer.readline
a,b=map(int,input().split())
if a>0:
    print("Positive")
    exit(0)
elif a<=0 and 0<=b:
    print("Zero")
    exit(0)
elif a<0 and b<0:
    num=b-a+1
    if num%2==0:
        print("Positive")
        exit(0)
    else:
        print("Negative")
        exit(0)
Buggy python submission (verdict: Runtime Error):
import math

N, K = map(int, input().split(" "))
A = list(map(int, input().split(" ")))

for i in range(min(math.ceil(math.log(N))+10, K)):
  B = [0] * N
  for n, A_n in enumerate(A):
    B_min = max(0, n-A_n)
    b_max = min(N-1, n+A_n)
    B[B_min] += 1
    if b_max+1 < N:
      B[b_max+1] -= 1
  
  sum = 0
  for n in range(len(A)):
    sum += B[n]
    A[n] = sum

print(" ".join(list(map(str, A))))

Fixed submission:
S = input()
print(S[:3])

Buggy python submission (verdict: Runtime Error):
import math

N, K = map(int, input().split(" "))
A = list(map(int, input().split(" ")))

for i in range(min(math.ceil(math.log(N)+5), K)):
  B = [0] * N
  for n, A_n in enumerate(A):
    B_min = max(0, n-A_n)
    b_max = min(N-1, n+A_n)
    B[B_min] += 1
    if b_max+1 < N:
      B[b_max+1] -= 1
  
  sum = 0
  for n in range(len(A)):
    sum += B[n]
    A[n] = sum

print(" ".join(list(map(str, A))))

Fixed submission:
S = input()
print(S[:3])
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split(" "))
A = list(map(int, input().split(" ")))

for i in range(K):
  a = [0] * N
  for n, A_n in enumerate(A):
    b_min = 0 if n-A_n < 0 else n-A_n
    b_max = N-1 if n+A_n > N-1 else n+A_n

    b = [0] * (b_min) + [1] * (b_max+1 - b_min) + [0] * (N - b_max - 1)
    a = [ x + y for (x, y) in zip(a, b)]
  A = a

print(" ".join(list(map(str, A))))

Fixed submission:
import math

N, K = map(int, input().split(" "))
A = list(map(int, input().split(" ")))

for i in range(min(41, K)):
  B = [0] * N
  for n, A_n in enumerate(A):
    B_min = max(0, n-A_n)
    b_max = min(N-1, n+A_n)
    B[B_min] += 1
    if b_max+1 < N:
      B[b_max+1] -= 1
  
  sum = 0
  for n in range(len(A)):
    sum += B[n]
    A[n] = sum

print(" ".join(list(map(str, A))))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split(" "))
A = list(map(int, input().split(" ")))

for i in range(K):
  a = [0] * N
  for n, A_n in enumerate(A):
    b = [0] * N
    b_min = 0 if n-A_n < 0 else n-A_n
    b_max = N-1 if n+A_n > N-1 else n+A_n

    for j in range(b_min, b_max+1):
      b[j] = 1
    a = [ x + y for (x, y) in zip(a, b)]
  A = a

print(" ".join(list(map(str, A))))

Fixed submission:
import math

N, K = map(int, input().split(" "))
A = list(map(int, input().split(" ")))

for i in range(min(41, K)):
  B = [0] * N
  for n, A_n in enumerate(A):
    B_min = max(0, n-A_n)
    b_max = min(N-1, n+A_n)
    B[B_min] += 1
    if b_max+1 < N:
      B[b_max+1] -= 1
  
  sum = 0
  for n in range(len(A)):
    sum += B[n]
    A[n] = sum

print(" ".join(list(map(str, A))))
Buggy python submission (verdict: Runtime Error):
R, G, B, N = map(int, input().split())
R, G, B = sorted([R, G, B])

i = 0
for r in range(N // R + 1):
    for g in range((N - r) // G + 1):
        bb = (N - r*R - g*G)
        if bb >= 0 and bb % B == 0:
            i += 1

print(i)

Fixed submission:
N, M = map(int, input().split())
print(N-M+1)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, imput().split())
i = 0

for j in range(2):
	if A > B:
	  i += A
	  A -= 1
	else:
	  i += B
	  B -= 1

print(i)

Fixed submission:
A, B = map(int, input().split())
i = 0
 
for j in range(2):
	if A > B:
	  i += A
	  A -= 1
	else:
	  i += B
	  B -= 1
 
print(i)
Buggy python submission (verdict: Runtime Error):
s = list(map(int, input().split()))
l = len(s)

s1 = [ ((-1)^i + 1)/2 for i in range(l)]
s2 = [ ((-1)^(i+1) + 1)/2 for i in range(l)]

m = 0
n = 0
for i in range(l):
  m += (s[i] - s1[i])^2
  n += (s[i] - s2[i])^2

print(min(m,n))

Fixed submission:
s = input()
l = len(s)

s1 = [ ((-1)**i + 1)//2 for i in range(l)]
s2 = [ ((-1)**(i+1) + 1)//2 for i in range(l)]

m = 0
n = 0
for i in range(l):
  m += (int(s[i]) - s1[i])**2
  n += (int(s[i]) - s2[i])**2

print(min([m,n]))

Buggy python submission (verdict: Runtime Error):
s = input()
l = len(s)

s1 = [ ((-1)^i + 1)/2 for i in range(l)]
s2 = [ ((-1)^(i+1) + 1)/2 for i in range(l)]

m = 0
n = 0
for i in range(l):
  m += (s[i] - s1[i])^2
  n += (s[i] - s2[i])^2

print(min(m,n))

Fixed submission:
s = input()
l = len(s)

s1 = [ ((-1)**i + 1)//2 for i in range(l)]
s2 = [ ((-1)**(i+1) + 1)//2 for i in range(l)]

m = 0
n = 0
for i in range(l):
  m += (int(s[i]) - s1[i])**2
  n += (int(s[i]) - s2[i])**2

print(min([m,n]))
Buggy python submission (verdict: Runtime Error):
a = []
for i in range(5):
	a.append(int(input().split()))
k = int(input().split())

for i in range(4):
  if a[i+1] - a[i] > k :
    print(": (")
    exit()

print("Yay!")

Fixed submission:
a = []
for i in range(5):
	a.append(int(input()))
k = int(input())
 
for i in range(4):
  for j in range(i+1, 5): 
    if a[j] - a[i] > k :
      print(":(")
      exit()
 
print("Yay!")
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
K = int(input())

l = {s}
for n in range(1, len(s)):
    for i in range(0, len(s)-n+1):
        l.add(s[i:i+n])

l = list(l)

l.sort()

print(l[K-1])

Fixed submission:
s = input()
K = int(input())

l = {s}
for n in range(1, K+1):
    for i in range(0, len(s)-n+1):
        l.add(s[i:i+n])

l = list(l)

l.sort()

print(l[K-1])
Buggy python submission (verdict: Runtime Error):
if X>=30:
  print('Yes')
else:
  print('No')

Fixed submission:
X = int(input())
if X>=30:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
x = int(input)
if x>=30:
  print('Yes')
else:
  print('No')

Fixed submission:
X = int(input())
if X>=30:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
input()
vs=list(map(int, input().split(" ")))
k = 0
for i in range(0, len(vs)-1):
	if vs[i] - vs[i+1] >= 2:
		k = 100
		break
	if vs[i] - vs[i+1] == 1:
		k += 1
		if k >= 2:
			break
	elif vs[i+1] - vs[i] >= 1:
		k = 0
if k > 1:
	print("No")
else:
	print("Yes")


Fixed submission:
a, b, c = map(int, input().split(" "))
print(max(0, c - (a - b)))
Buggy python submission (verdict: Runtime Error):
n, k = int(input())
print(n % k)

Fixed submission:
n, k = map(int, input().split())
n %= k
m = n
m -= k
m = abs(m)
n = min(n, m)
print(n)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
m = Q - K + 1
A = [input() for _ in range(Q)]
Ans = []
for i in range(N):
    if m <= 0:
        Ans.append("Yes")
    elif A.count(str(i+1)) < m:
        Ans.append("No")
    else:
        Ans.append("Yes")

for i in range(N):
    print(Ans[i])

Fixed submission:
import collections

N, K, Q = map(int, input().split())
m = Q - K + 1
A = [input() for _ in range(Q)]
C = collections.Counter(A)
Ans = []
for i in range(N):
    if m <= 0:
        Ans.append("Yes")
    elif C[str(i+1)] < m:
        Ans.append("No")
    else:
        Ans.append("Yes")

for i in range(N):
    print(Ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
M = [x+1 for x in range(N)]
print(sum(set(M))-N)

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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
M = [x+1 for x in range(N)]
print(sum(M)-N)

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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 0
for i in range(N):
    ans += i
print(ans)

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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 0
P = []
P.append(N)
for i in range(N-1):
    P.append(i+1)

for i in range(N):
    ans = ans + (P[i] % (i+1))

print(ans)

Fixed submission:
N = int(input())
ans = N*(N-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
v=int(input()).split()
V=v.sort()
cnt=0
while cnt<N-1:
    v[0]=(int(v[0])+int(v[cnt+1]))/2
    cnt+=1
print(v[0])


Fixed submission:
N=int(input())
v=[int(x) for x in input().split()]
cnt=0
while cnt<N-1:
    v.sort()
    v[0]=(v[0]+v.pop(1))/2
    cnt+=1
print(v[0])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = []
ans = 0
i=0
for n in range(N):
    S=input()
    tmp=list(S)
    tmp.sort()
    s.append("".join(tmp))

while i<N:
    j = i + 1
    while j<N:
        if s[i] == s[j]:
            ans += 1
        j += 1
    i += 1

print(ans)

Fixed submission:
import collections

N = int(input())
s = ["".join(sorted(input())) for _ in range(N)]
c = collections.Counter(s)
ans = sum(x*(x-1)//2 for x in c.values())
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
v=[int(x) for x in input().split()]
cnt=0
while cnt<N-1:
    v.sort()
    v[0]=(v[0]+v.pop(1))/2
    cnt+=1
print(v[0])

Fixed submission:
h,w=map(int,input().split())
s=[input() for _ in range(h)]
for i in range(h):
    l=""
    for j in range(w):
        if s[i][j]=="#":
            l+="#"
        else:
            l+=str(sum([t[max(0,j-1):min(w,j+2)].count("#") for t in s[max(0,i-1):min(h,i+2)]]))
    print(l)
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
if x==y:
    print('-1')
    break
for i in range(x,10**9//x,x):
    if i%y!=0:
        print(i)
        break


Fixed submission:
x,y=map(int,input().split())
if y==1:
    print('-1')
    exit()
elif x%y==0:
    print('-1')
    exit()
for i in range(x,10**18//x,x):
    if i%y!=0:
        print(i)
        break
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import itertools
a=input()
n=len(a)
delete=int(0)
dup=list(Counter(a).values())
num=list(itertools.combinations(a,2))
count=Counter(a).values()
print((n*(n-1)-sum([i*(i-1) for i in count]))//2 +1)


Fixed submission:
from collections import Counter
import itertools
a=input()
n=len(a)
delete=int(0)
count=Counter(a).values()
print((n*(n-1)-sum([i*(i-1) for i in count]))//2 +1)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

ans=[]

for i in range(1,n):
    snuke=sum(a[0:i])
    raccoon=sum(a)-snuke
    ans.append(abs(snuke-raccoon))

print(min(ans))


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
X=sum(a)

ans=[]
snuke=0

for i in range(n-1):
    snuke+=a[i]
    ans.append(abs(X-2*snuke))

print(min(ans))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

ans=[]

for i in range(1,n):
    snuke=sum(a[0:i])
    raccoon=sum(a[i:])
    ans.append(abs(snuke-raccoon))

print(min(ans))


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
X=sum(a)

ans=[]
snuke=0

for i in range(n-1):
    snuke+=a[i]
    ans.append(abs(X-2*snuke))

print(min(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in range(n):
    if (n-1)%2==i%2:
        ans.insert(0,a[i])
    else:
        ans.insert(len(ans),a[i])
print(" ".join(map(str,ans)))


Fixed submission:
from collections import deque
n=int(input())
a=list(map(int,input().split()))
ans=deque([a[0]])
for i in range(1,n):
    if (n-1)%2==i%2:
        ans.appendleft(a[i])
    else:
        ans.append(a[i])
print(" ".join(map(str,ans)))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in range(n):
    if (n-1)%2==i%2:
        ans.insert(0,a[i])
    else:
        ans.insert(len(ans),a[i])
for i in range(len(ans)):
    print(ans[i],end=' ')


Fixed submission:
from collections import deque
n=int(input())
a=list(map(int,input().split()))
ans=deque([a[0]])
for i in range(1,n):
    if (n-1)%2==i%2:
        ans.appendleft(a[i])
    else:
        ans.append(a[i])
print(" ".join(map(str,ans)))
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())

count=0
xlist=[x,-x,x,-x]
ylist=[y,y,-y,-y]
numlist=[0,1,1,2]
ans=10**9+7

for i in range(4):
    if xlist[i] <= ylist(i):
        ans=min(ans,numlist[i]+ylist[i]-xlist[i])

print(ans)


Fixed submission:
x,y=map(int,input().split())

count=0
xlist=[x,-x,x,-x]
ylist=[y,y,-y,-y]
numlist=[0,1,1,2]
ans=10**9+7

for i in range(4):
    if xlist[i] <= ylist[i]:
        ans=min(ans,numlist[i]+ylist[i]-xlist[i])

print(ans)
Buggy python submission (verdict: Runtime Error):
c=str(input())
print(['consonant','vowel'][c=='a'or'i'or'u'or'e'or'o'])


Fixed submission:
c=str(input())
if(c=='a'):
    print('vowel')
elif(c=='i'):
    print('vowel')
elif(c=='u'):
    print('vowel')
elif(c=='e'):
    print('vowel')
elif(c=='o'):
    print('vowel')
else:
    print('consonant')
Buggy python submission (verdict: Time Limit Exceeded):
import heapq
from math import ceil
N, K = list(map(int, input().split()))

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

hp = []

for log in A:
    heapq.heappush(hp, (-log, log, 1))

for i in range(K):
    cur_length, length, count = heapq.heappop(hp)
    cur_length = -cur_length
    new_length = length / (count + 1)
    heapq.heappush(hp, (-new_length, length, count + 1))

print(ceil(-hp[0][0]))



Fixed submission:
from math import ceil
N, K = list(map(int, input().split()))

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

def possible(A, K, target):
    count = 0

    for a in A:
        count += ceil(a / target) - 1
    return count <= K

left = 1
right = max(A)

while left < right:
    mid = (left + right) // 2
    if possible(A, K, mid):
        right = mid
    else:
        left = mid + 1

print(right)
Buggy python submission (verdict: Runtime Error):
import random
from bisect import bisect_left, bisect_right
from typing import List
import collections
import bisect
import itertools
import functools
from fractions import gcd
import heapq
from math import ceil, sqrt, floor

# import sys
# sys.setrecursionlimit(50000)
from collections import defaultdict, deque

import collections

s = input()

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")


Fixed submission:

s = input()

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):

N = int(input())
A = list(map(int, input().split()))

ct = collections.Counter(A)

ret = []
total = 0
for k,count in ct.items():
    if count > 1:
        total += count * (count-1) // 2

for i,v in enumerate(A):
    if ct[v] > 1:
        count = ct[v]
        adjust = (count-1) * (count-2) // 2 - (count-1) * count // 2
        val = str(total + adjust)
    else:
        val = '0'
    print(val)
    

Fixed submission:

import collections

N = int(input())
A = list(map(int, input().split()))

ct = collections.Counter(A)

ret = []
total = 0
for k,count in ct.items():
    if count > 1:
        total += count * (count-1) // 2

for i,v in enumerate(A):
    if ct[v] > 1:
        count = ct[v]
        adjust = (count-1) * (count-2) // 2 - (count-1) * count // 2
        val = total + adjust
    else:
        val = total
    print(val)
Buggy python submission (verdict: Runtime Error):
from bisect import bisect_left, bisect_right
from typing import List
import collections
import bisect
import itertools
import functools
from fractions import gcd
import heapq
from math import ceil, sqrt, floor

import sys
sys.setrecursionlimit(50000)

import collections

from collections import defaultdict, deque
import collections

import bisect
import collections
from sortedcontainers import SortedList, SortedDict


H, W = list(map(int, input().split()))

areas = [ceil(H / 2), H // 2]

ret = areas[0] * (ceil(W / 2)) + areas[1] * (W // 2)

print(ret)



Fixed submission:

from math import ceil, sqrt, floor


H, W = list(map(int, input().split()))

if H == 1 or W == 1:
    print(1)
    exit(0)

areas = [ceil(H / 2), H // 2]

ret = areas[0] * (ceil(W / 2)) + areas[1] * (W // 2)

print(ret)

Buggy python submission (verdict: Runtime Error):


H, W = list(map(int, input().split()))

areas = [ceil(H / 2), H // 2]

ret = areas[0] * (ceil(W / 2)) + areas[1] * (W // 2)

print(ret)



Fixed submission:

from math import ceil, sqrt, floor


H, W = list(map(int, input().split()))

if H == 1 or W == 1:
    print(1)
    exit(0)

areas = [ceil(H / 2), H // 2]

ret = areas[0] * (ceil(W / 2)) + areas[1] * (W // 2)

print(ret)

Buggy python submission (verdict: Runtime Error):


H, W = list(map(int, input().split()))

areas = [ceil(H / 2), H // 2]

ret = areas[0] * (ceil(W / 2)) + areas[1] * (W // 2)

print(ret)



Fixed submission:

from math import ceil, sqrt, floor


H, W = list(map(int, input().split()))

if H == 1 or W == 1:
    print(1)
    exit(0)

areas = [ceil(H / 2), H // 2]

ret = areas[0] * (ceil(W / 2)) + areas[1] * (W // 2)

print(ret)
Buggy python submission (verdict: Runtime Error):
from sortedcontainers import SortedList, SortedDict

s = input()

print('YES' if len(set(s)) == 2 else 'NO')

Fixed submission:

S = input()

if len(set(S)) == 1:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):


A, B = list(map(int, input().split()))

for i in range(1, 2000):
    if floor(i * 0.08) == A and floor(i*0.1) == B:
        print(i)
        exit(0)
print(-1)


Fixed submission:


from math import ceil, sqrt, floor

A, B = list(map(int, input().split()))

for i in range(1, 2000):
    if floor(i * 0.08) == A and floor(i*0.1) == B:
        print(i)
        exit(0)
print(-1)
Buggy python submission (verdict: Runtime Error):
ions

S = input()
Q = int(input())

rev = False
deque = collections.deque()
for c in S:
    deque.append(c)
for _ in range(Q):
    read = input()
    if read == '1':
        rev = not rev
    else:
        _, f, c = read.split()
        if not rev:
            if f == '1':
                deque.appendleft(c)
            else:
                deque.append(c)
        else:
            if f == '1':
                deque.append(c)
            else:
                deque.appendleft(c)

ret = ''.join(deque if not rev else reversed(deque))
print(ret)


Fixed submission:


import collections

S = input()
Q = int(input())

rev = False
deque = collections.deque()
for c in S:
    deque.append(c)
for _ in range(Q):
    read = input()
    if read == '1':
        rev = not rev
    else:
        _, f, c = read.split()
        if not rev:
            if f == '1':
                deque.appendleft(c)
            else:
                deque.append(c)
        else:
            if f == '1':
                deque.append(c)
            else:
                deque.appendleft(c)

ret = ''.join(deque if not rev else reversed(deque))
print(ret)

Buggy python submission (verdict: Runtime Error):
from typing import List
import collections

import bisect
import itertools
import functools
from collections import defaultdict
import collections

from fractions import gcd
import heapq
from math import ceil, sqrt, floor

import sys
sys.setrecursionlimit(50000)
from collections import defaultdict


S = input()
Q = int(input())

rev = False
deque = collections.deque()
deque.append(S)
for _ in range(Q):
    read = input()
    if read == '1':
        rev = not rev
    else:
        _, f, c = read.split()
        if f == '1':
            if not rev:
                deque.appendleft(c)
            else:
                deque.append(c)
        else:
            if rev:
                deque.appendleft(c)
            else:
                deque.append(c)
ret = ''.join(deque if not rev else reversed(deque))
print(ret)


Fixed submission:


import collections

S = input()
Q = int(input())

rev = False
deque = collections.deque()
for c in S:
    deque.append(c)
for _ in range(Q):
    read = input()
    if read == '1':
        rev = not rev
    else:
        _, f, c = read.split()
        if not rev:
            if f == '1':
                deque.appendleft(c)
            else:
                deque.append(c)
        else:
            if f == '1':
                deque.append(c)
            else:
                deque.appendleft(c)

ret = ''.join(deque if not rev else reversed(deque))
print(ret)