Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from itertools import product
D, G = map(int, input().split())
P, C = zip(*[map(int, input().split()) for _ in range(D)])
INF = 10**18
ans = INF
for bit in product((0, 1), repeat=D):
    p = list(P)
    cnt = 0
    score = 0
    for i in range(D):
        if bit[i]:
            score += C[i]
            score += P[i]*100*(i+1)
            cnt += P[i]
            p[i] = 0


        if score+sum(p[i]*100*(i+1) for i in range(D)) < G:
        	continue
 
    idx = D-1
    while score < G:
        while not p[idx]:
            idx -= 1
        score += 100*(idx+1)
        p[idx] -= 1
        cnt += 1
    if cnt < ans:
        ans = cnt
print(ans)


Fixed submission:
from itertools import product
D, G = map(int, input().split())
P, C = zip(*[map(int, input().split()) for _ in range(D)])
INF = 10**18
ans = INF
for bit in product((0, 1), repeat=D):
    p = list(P)
    cnt = 0
    score = 0
    for i in range(D):
        if bit[i]:
            score += C[i]
            score += P[i]*100*(i+1)
            cnt += P[i]
            p[i] = 0
 
    if score+sum(p[i]*100*(i+1) for i in range(D)) < G:
        continue
 
    idx = D-1
    while score < G:
        while not p[idx]:
            idx -= 1
        score += 100*(idx+1)
        p[idx] -= 1
        cnt += 1
    if cnt < ans:
        ans = cnt
print(ans)

Buggy python submission (verdict: Runtime Error):
from itertools import product
D, G = map(int, input().split())
P, C = zip(*[map(int, input().split()) for _ in range(D)])
INF = 10**18
ans = INF
for bit in product((0, 1), repeat=D):
    p = list(P)
    cnt = 0
    score = 0
    for i in range(D):
        if bit[i]:
            score += C[i]
            score += P[i]*100*(i+1)
            cnt += P[i]
            p[i] = 0


        if score+sum(p[i]*100*(i+1) for i in range(D)) < G:
        continue
 
    idx = D-1
    while score < G:
        while not p[idx]:
            idx -= 1
        score += 100*(idx+1)
        p[idx] -= 1
        cnt += 1
    if cnt < ans:
        ans = cnt
print(ans)

Fixed submission:
from itertools import product
D, G = map(int, input().split())
P, C = zip(*[map(int, input().split()) for _ in range(D)])
INF = 10**18
ans = INF
for bit in product((0, 1), repeat=D):
    p = list(P)
    cnt = 0
    score = 0
    for i in range(D):
        if bit[i]:
            score += C[i]
            score += P[i]*100*(i+1)
            cnt += P[i]
            p[i] = 0
 
    if score+sum(p[i]*100*(i+1) for i in range(D)) < G:
        continue
 
    idx = D-1
    while score < G:
        while not p[idx]:
            idx -= 1
        score += 100*(idx+1)
        p[idx] -= 1
        cnt += 1
    if cnt < ans:
        ans = cnt
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
input()
x = np.array(input().split(), dtype=np.int32)

ans = 0
while ( x % 2 == 0 ).all():
 	x //= 2
	ans += 1
print(ans)    

Fixed submission:
import numpy as np
input()
x = np.array(input().split(),dtype=np.int32)

ans = 0
while (x%2==0).all():
  x //= 2
  ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
input()
x = np.array(input().split(), dtype=np.int32)

ans = 0
while ( x % 2 == 0 ).all():
  	x //= 2
	ans += 1
print(ans)    


Fixed submission:
import numpy as np
input()
x = np.array(input().split(),dtype=np.int32)

ans = 0
while (x%2==0).all():
  x //= 2
  ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
input()
x = np.array(input().split(), dtype=np.int32)

ans = 0
while ( x % 2 == 0 ).all():
  	x //= 2
    ans += 1
print(ans)    

Fixed submission:
import numpy as np
input()
x = np.array(input().split(),dtype=np.int32)

ans = 0
while (x%2==0).all():
  x //= 2
  ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
K, S = map(int, input().split())

cnt = 0
for x, y, z in range(K+1):
  if x + y + z == S:
    cnt += 1
print(cnt)    

Fixed submission:
K, S = map(int, input().split())

cnt = 0
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
      cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
K, S = map(int, input().split())

cnt = 0
for x, y, z in range(K):
  if x+y+z == S:
    cnt += 1
print(cnt)    

Fixed submission:
K, S = map(int, input().split())

cnt = 0
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
      cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
from itertools import *
A = list(map(int, list(input()))

ans = 0
N = len(A)-1
for p in product([0,1], repeat = N):
	now = A[0]
    for i in range(N):
      if p[i] == 0:
        now = now*10 + A[i+1]
      else:
        ans += now
        now = A[i+1]
	ans += now
print(ans)    


Fixed submission:
A = list(map(int, list(input())))
 
ans = 0
from itertools import *
N = len(A)-1
for p in product([0,1],repeat=N):
    now = A[0]
    for i in range(N):
        if p[i] == 0:
            now = now*10+A[i+1]
        else:
            ans += now
            now = A[i+1]
    ans += now
print(ans)

Buggy python submission (verdict: Runtime Error):
from itertools import *
A = list(map(int, list(input()))

ans = 0
N = len(A)-1
for p in product([0,1], repeat = N):
	now = A[0]
	for i in range(N):
      if p[i] == 0:
        now = now*10 + A[i+1]
      else:
        ans += now
        now = A[i+1]
	ans += now
print(ans)    


Fixed submission:
A = list(map(int, list(input())))
 
ans = 0
from itertools import *
N = len(A)-1
for p in product([0,1],repeat=N):
    now = A[0]
    for i in range(N):
        if p[i] == 0:
            now = now*10+A[i+1]
        else:
            ans += now
            now = A[i+1]
    ans += now
print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools
A = list(map(int, list(input()))

ans = 0
N = len(A)-1
for p in product([0,1], repeat = N):
	now = A[0]
    for i in range(N):
      if p[i] == 0:
        now = now*10 + A[i+1]
      else:
        ans += now
        now = A[i+1]
	ans += now
print(ans)    


Fixed submission:
A = list(map(int, list(input())))
 
ans = 0
from itertools import *
N = len(A)-1
for p in product([0,1],repeat=N):
    now = A[0]
    for i in range(N):
        if p[i] == 0:
            now = now*10+A[i+1]
        else:
            ans += now
            now = A[i+1]
    ans += now
print(ans)

Buggy python submission (verdict: Runtime Error):
from itertools import *
A = list(map(int, list(input()))

ans = 0
N = len(A)-1
for p in product([0,1], repeat = N):
	now = A[0]
    for i in range(N):
      if p[i] == 0:
        now = now*10 + A[i+1]
      else:
        ans += now
        now = A[i+1]
	ans += now
print(ans)    

Fixed submission:
A = list(map(int, list(input())))
 
ans = 0
from itertools import *
N = len(A)-1
for p in product([0,1],repeat=N):
    now = A[0]
    for i in range(N):
        if p[i] == 0:
            now = now*10+A[i+1]
        else:
            ans += now
            now = A[i+1]
    ans += now
print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
  import math
  print(2 * a * math.pi)

  

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

Buggy python submission (verdict: Runtime Error):
a = int(input())
  print(2 * a * 3.1415926)

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

Buggy python submission (verdict: Runtime Error):
print(2 * R * 3.141592)

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

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

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

Buggy python submission (verdict: Runtime Error):
import math
return math.pi*2*R

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

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

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

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

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

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


Fixed submission:
import math
a = int(input())
print(2 * a * math.pi)
Buggy python submission (verdict: Runtime Error):
"""
https://atcoder.jp/contests/abc136/tasks/abc136_c
"""

import numpy as np


def calc(N: int, values: np.ndarray) -> bool:
    # 要素が1つなら確定でOK
    if len(values) == 1:
        return True

    # 2つ以上下がっている部分があるとNG
    gradient = np.diff(values)
    if np.min(gradient) <= -2:
        return False

    # 要素が2つでならこの時点でOK確定
    if len(values) == 2:
        return True

    # 1つ下がってから、上がる前に、1つ下がるとNG
    gradient_without_zero = gradient[gradient != 0]
    gradient_without_last = gradient_without_zero[:-1]
    gradient_without_first = gradient_without_zero[1:]
    if np.min(gradient_without_first + gradient_without_last) <= -2:
        return False
    return True


def load_input_as_int_array() -> np.ndarray:
    return np.array([int(v) for v in input().split(" ")])


def main() -> None:
    N, = load_input_as_int_array()
    values = load_input_as_int_array()
    result = calc(N, values)
    print("Yes" if result else "No")


main()


Fixed submission:
"""
https://atcoder.jp/contests/abc136/tasks/abc136_c
"""

import numpy as np


def calc(N: int, values: np.ndarray) -> bool:
    # 要素が1つなら確定でOK
    if len(values) == 1:
        return True

    # 2つ以上下がっている部分があるとNG
    gradient = np.diff(values)
    if np.min(gradient) <= -2:
        return False

    # 要素が2つでならこの時点でOK確定
    if len(values) == 2:
        return True

    # 1つ下がってから、上がる前に、1つ下がるとNG
    gradient_without_zero = gradient[gradient != 0]
    if len(gradient_without_zero) == 0:
        return True
    gradient_without_last = gradient_without_zero[:-1]
    gradient_without_first = gradient_without_zero[1:]
    if np.min(gradient_without_first + gradient_without_last) <= -2:
        return False
    return True


def load_input_as_int_array() -> np.ndarray:
    return np.array([int(v) for v in input().split(" ")])


def main() -> None:
    N, = load_input_as_int_array()
    values = load_input_as_int_array()
    result = calc(N, values)
    print("Yes" if result else "No")


main()
Buggy python submission (verdict: Runtime Error):
def ok(s: str): str:
    char_count = {}
    for c of s:
      if c not in char_count:
        char_count[c] = 0
      if c in char_count.keys():
        chars[c] += 1
    
    yes = all([count == 2 for count in char_count.values()])
    if yes:
      return 'Yes'
    else:
      return 'No'


Fixed submission:
def ok(s: str) -> str:
    char_count = {}
    for c in s:
      if c not in char_count:
        char_count[c] = 0
      if c in char_count.keys():
        char_count[c] += 1
    
    return all([count == 2 for count in char_count.values()])

numbers_str = input()
result = ok([c for c in numbers_str])
if result:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
def counting(numbers: int[]): int:
    count = 0
    for i in range(1, len(numbers) - 1):
        pre = numbers[i-1]
        curr = numbers[i]
        next_ = numbers[i+1]
        if pre < curr < next_:
          count += 1
      return count

_ = input()
numbers_str = input()
result = counting(numbers_str.split(' '))
print(result)


Fixed submission:
def counting(numbers) -> int:
    count = 0
    for i in range(1, len(numbers) - 1):
        pre = numbers[i-1]
        curr = numbers[i]
        next_ = numbers[i+1]
        if pre < curr and curr == next_:
            count += 1
        elif next_ < curr and curr == pre:
            count += 1
        elif pre < curr < next_ or next_ < curr < pre:
            count += 1
    return count
 
_ = input()
numbers_str = input()
result = counting([int(c) for c in numbers_str.split(' ')])
print(result)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

for i in range(len(S)):
    if S == T:
        print('Yes')
        break
    else:
        S[:] = T[-1] + T[1:]
else:
    print('No')

Fixed submission:
S = input()
T = input()

for i in range(len(S)):
    if S == T:
        print('Yes')
        break
    else:
        S = S[-1] + S[0:-1]
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = map(int, input().split)

print(max(a) - min(a))

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

print(max(a) - min(a))

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split))

print(max(a) - min(a))

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

print(max(a) - min(a))
Buggy python submission (verdict: Runtime Error):
import random
S = input()
rand = random.randrange(0, len(S) - 1)
print(S[rand] + S[rand + 1] + S[rand + 2])


Fixed submission:
import random
S = input()
rand = random.randrange(0, len(S) - 2)
print(S[rand] + S[rand + 1] + S[rand + 2])

Buggy python submission (verdict: Runtime Error):
import random
S = input()
rand = random.randrange(0, len(S) - 1)  # 最後から２つは入れないため
print(S[rand] + S[rand + 1] + S[rand + 2])


Fixed submission:
import random
S = input()
rand = random.randrange(0, len(S) - 2)
print(S[rand] + S[rand + 1] + S[rand + 2])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(input().split())
ans = 1
lim = 18
Leng = ''.join(A)
flag = False

if Leng < lim:
    flag = True

for i in A:
    ans *= int(i)

if not flag and "0" not in A:
    print('-1')
else:
    print(ans)

# print(ans, lim)


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

ans = 1
if 0 in a:
    print(0)
    exit()

for i in a:
    ans *= i
    if ans > 1e18:
        break

if ans > 1e18:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(input().split())
ans = 1
lim = 10 ** 18


for i in range(len(A)):
    ans *= int(A[i])
if lim < ans and "0" not in A:
    print('-1')
else:
    print(ans)

# print(ans, lim)


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

ans = 1
if 0 in a:
    print(0)
    exit()

for i in a:
    ans *= i
    if ans > 1e18:
        break

if ans > 1e18:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())
ans = [int(a * x / b) - a * int(x / b) for x in range(n+1)]
print(max(ans))


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

x = min(B-1, N)
print(A*x // B - A * (x//B))
Buggy python submission (verdict: Runtime Error):
n,k,q = map(int,input().split())
a = [] # 順番
for _ in range(q):
    a.append(int(input()))


point = [k] * n


for win in a:         # 勝った人(a[win-1])以外を下げる
    point[win-1] += 1
    for i in range(n):
        point[i] -= 1
#        print(point)

#print(point)


for i in point:
    if i <= 0:
        print("No")
    elif i >= 1:
        print("Yes")



Fixed submission:
s=input()

if s == "Sunny":
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
elif s == "Rainy":
    print("Sunny")
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = map(int,input().split())
a = [] # 順番
for _ in range(q):
    a.append(int(input()))


point = [k] * n


for win in a:         # 勝った人(a[win-1])以外を下げる
    point[win-1] += 1
    for i in range(n):
        point[i] -= 1
#        print(point)

#print(point)


for i in point:
    if i <= 0:
        print("No")
    elif i >= 1:
        print("Yes")



Fixed submission:
n,k,q = map(int,input().split()) #N人、Kpoint、Q回答
a = [] # 順番
for _ in range(q):
    a.append(int(input()))

# 最初に回数分引く
point = [k-q] * n

for win in a:
    point[win-1] += 1

#print(point)


for i in point:
    if i <= 0:
        print("No")
    elif i >= 1:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
str=list(input())
if str.count(str[0])==2 and str.count(str[1])==2:
    print("Yes")
elif str.count(str[0])==2 and str.count(str[2])==2:
else:
    print("No")
    

Fixed submission:
s=input()
for i in s:
    if s.count(i)!=2:
        print('No')
        break
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
A, B, C, D = map(int, input().split())
def solve(N):
    ans = N
    ans -= N//C
    ans -= N//D
    ans += N//(C*D//gcd(C, D))
    return ans
print(solve(B) - solve(A-1))


Fixed submission:
s = list(input())

for i in range(3):
    if s[i] == s[i+1]:
        ans = "Bad"
        break
    else:
        ans = "Good"
        
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d = map(int,input().split())
cnt = 0
for i in range(a,b+1):
    if i % c != 0 and i % d != 0:
        cnt += 1
           
print(cnt)           

Fixed submission:
from fractions import gcd
A, B, C, D = map(int, input().split())
def solve(N):
    ans = N
    ans -= N//C
    ans -= N//D
    ans += N//(C*D//gcd(C, D))
    return ans
print(solve(B) - solve(A-1))
Buggy python submission (verdict: Runtime Error):
# -*- Coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

ans = 1
p = 0
p += L[ans]
while p <= X:
    p += L[ans]
    ans += 1

print(ans) 



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

ans = 1 #位置0も1にカウントするから
p = 0 #今のポジション
for i in range(N):
    p += L[i]
    if p <= X:
         ans += 1
    else:
        break

print(ans)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))

ans = 1
sum = 0

for i in range(N):
    sum += L[i]
    if sum <= X:
        num += 1
    else:
        break

print(ans)



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

ans = 1 #位置0も1にカウントするから
p = 0 #今のポジション
for i in range(N):
    p += L[i]
    if p <= X:
         ans += 1
    else:
        break

print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- Coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

index = 0
Sum = 0
while Sum <= X:
    Sum += L[index]
    index += 1

print(index) 



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

ans = 1 #位置0も1にカウントするから
p = 0 #今のポジション
for i in range(N):
    p += L[i]
    if p <= X:
         ans += 1
    else:
        break

print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- Coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

index = 0
Sum = 0
while Sum <= X:
    Sum += L[index]
    index += 1

print(index+1) 


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

ans = 1 #位置0も1にカウントするから
p = 0 #今のポジション
for i in range(N):
    p += L[i]
    if p <= X:
         ans += 1
    else:
        break

print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- Coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

index = 0
Sum = L[0]
while Sum <= X:
    Sum += L[index+1]
    index += 1

print(index+1) 



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

ans = 1 #位置0も1にカウントするから
p = 0 #今のポジション
for i in range(N):
    p += L[i]
    if p <= X:
         ans += 1
    else:
        break

print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- Coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

index = 1
Sum = L[0]
while Sum <= X:
    Sum += L[index]
    index += 1

print(index) 



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

ans = 1 #位置0も1にカウントするから
p = 0 #今のポジション
for i in range(N):
    p += L[i]
    if p <= X:
         ans += 1
    else:
        break

print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- Coding: utf-8 -*-
N, X = map(int, input().split())
L = list(map(int,input().split()))

index = 0
Sum = 0
while Sum <= X:
    Sum += L[index]
    index += 1

print(index+1) 


Fixed submission:
# -*- Coding: utf-8 -*-
W,H,x,y = map(int,input().split())


if (W/2 == x) and (H/2 == y):# 中心の場合無限だから1
    print("{:.9f}".format(W*H/2),1)
else:
    print("{:.9f}".format(W*H/2),0)
Buggy python submission (verdict: Runtime Error):
print(s[0][0]+s[1][0]+s[2][0])

Fixed submission:
s = input().split()
print(s[0][0]+s[1][0]+s[2][0])
Buggy python submission (verdict: Runtime Error):
if(input().rstrip() == 'ABC':
   print('ARC')
else:
   print('ABC')	

Fixed submission:
if(input().rstrip() == 'ABC'):
    print('ARC')
else:
    print('ABC')
Buggy python submission (verdict: Time Limit Exceeded):
a = []
n = int(input())
for i in range(n):
    a.append(int(input()))
for i in range(n):
    if i == 0 : print(max(a[1:]))
    elif i == n - 1 : print(max(a[:i]))
    else:
        maxa = max(a[:i])
        maxb = max(a[i + 1:])
        print(max(maxa, maxb))

    


Fixed submission:
a = []
c = []
n = int(input())
max_i = 0
max_s = 0
b = False
for i in range(n):
    aa = int(input())
    a.append(aa) 
    c.append(aa)   
    if max_i < aa : max_i = aa

c.remove(max_i)
max_s = max(c)

for i in range(n):
    if a[i] != max_i : print(max_i)
    else:print(max_s)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split(" ")))
a = 0
for r in range(min(p) - 1, max(p)+1):
    abc = list(filter(lambda x: x < r, p))
    arc = list(filter(lambda x: x >= r, p))
    if len(abc) == len(arc) :
        a += 1
print(a)

Fixed submission:
n = int(input())
p = list(map(int, input().split(" ")))
a = 0
p.sort()
n_2 = int(n / 2)
abc = p[:n_2]
arc = p[n_2:]
a = arc[0] - (abc[len(abc) - 1]) 
print(a)
Buggy python submission (verdict: Runtime Error):
N = d[0]
T = d[1]
min = 10000
for i in range(0, N-1):
    d = list(map(int,input().strip().split(' ')))
    c = d[0]
    t = d[1]
    if t <= T:
        if min >= c:
            min = c
if min == 10000:
    print("TLE")
    exit()
print(min)


Fixed submission:
d = list(map(int,(input().strip().split(' '))))
N = d[0]
T = d[1]
min = 100000000
for i in range(0, N):
    d = list(map(int,input().strip().split(' ')))
    c = d[0]
    t = d[1]
    if t <= T:
        if min >= c:
            min = c
if min == 100000000:
    print("TLE")
else:
    print(min)
Buggy python submission (verdict: Runtime Error):
s = raw_input()
abcd = map(int, s.split())
if abcd[0] > abcd[2]:
	begin = abcd[0]
else:
	begin = abcd[2]
if abcd[1] > abcd[3]:
	end = abcd[3]
else:
	end = abcd[1]

if (end - begin) >= 0:
	print(end - begin)
else:
	print(0)


Fixed submission:
s = raw_input()
abcd = map(int, s.split())
if abcd[0] > abcd[2]:
	begin = abcd[0]
else:
	begin = abcd[2]
if abcd[1] > abcd[3]:
	end = abcd[3]
else:
	end = abcd[1]

if (end - begin) >= 0:
	print(end - begin)
else:
	print(0)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())

for i in range(q):
  qi = input()
  if qi[0] == "1":
    s = s[::-1]
  else:
    t, f, c = qi.split() 
    if f == "1":
      s = c + s
    else:
      s = s + c
print(s)

Fixed submission:
s = input()
q = int(input())
zengo = True
mae = []
usiro = []
for i in range(q):
  qi = input()
  if qi[0] == "1":
    if zengo:
      zengo = False
    else:
      zengo = True
  else:
    t, f, c = qi.split() 
    if zengo:
      if f == "1":
        mae.append(c)
      else:
        usiro.append(c)
    else:
      if f == "1":
        usiro.append(c)
      else:
        mae.append(c)
mae = mae[::-1]
s = ''.join(mae) + s + ''.join(usiro)
if zengo:
  print(s)
else:
  print(s[::-1])
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
sum = a[0] + a[1] + a[2]
if sum >= 22
	print("bust")
else:
	print("win")

Fixed submission:
a = list(map(int,input().split()))
sum = a[0] + a[1] + a[2]
if sum >= 22:
	print("bust")
else:
	print("win")

Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
sum = a[0] + a[1] + a[2]
if sum <= 21
	print("win")
else
	print("bust")

Fixed submission:
a = list(map(int,input().split()))
sum = a[0] + a[1] + a[2]
if sum >= 22:
	print("bust")
else:
	print("win")

Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
sum = a[0] + a[1] + a[2]
if sum >= 22
	print("bust")
else
	print("win")

Fixed submission:
a = list(map(int,input().split()))
sum = a[0] + a[1] + a[2]
if sum >= 22:
	print("bust")
else:
	print("win")