Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split(" ")))
total = 1

for i in A:
  total = total * i
if total > 10**18:
  print(-1)
else:
  print(total)

Fixed submission:
N = int(input())
A = list(map(int,input().split(" ")))
total = 1
A.sort()

for i in A:
  if i == 0:
    total = 0
    break
  elif total > 10**18:
    break
  total = total * i
if total > 10**18:
  print(-1)
else:
  print(total)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split(" ")))
total = 1
Triger = 0
for i in A:
  if total == 0:
    print(0)
    Triger = 1
    break
  else:
    total *= i

if total > 10**18:
  print(-1)
elif Triger == 0:
  print(total)

Fixed submission:
N = int(input())
A = list(map(int,input().split(" ")))
total = 1
A.sort()

for i in A:
  if i == 0:
    total = 0
    break
  elif total > 10**18:
    break
  total = total * i
if total > 10**18:
  print(-1)
else:
  print(total)

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

for i in A:
  total = total * i
if total > 10**18:
  print("-1")
else:
  print(total)

Fixed submission:
N = int(input())
A = list(map(int,input().split(" ")))
total = 1
A.sort()

for i in A:
  if i == 0:
    total = 0
    break
  elif total > 10**18:
    break
  total = total * i
if total > 10**18:
  print(-1)
else:
  print(total)
Buggy python submission (verdict: Runtime Error):
S = list(map(int,input().split()))
counter = 0
nuske = []

for k in range(S[0]):
  nuske.append(int(0))

for i in range(S[1]):
  roop = int(input())
  for j in range(roop):
    if roop == 1:
      temp = int(input())
      nuske[temp-1] = nuske[temp-1] + 1
    else:
      temp = list(map(int,input().split()))
      for l in temp:
        nuske[l-1] = nuske[l-1] + 1

for y in nuske:
  if y == 0:
    counter += 1
print(counter)
    

Fixed submission:
S = list(map(int,input().split()))
counter = 0
nuske = []

for k in range(S[0]):
  nuske.append(int(0))

for i in range(S[1]):
  roop = int(input())
  if roop == 1:
    temp = int(input())
    nuske[temp-1] = nuske[temp-1] + 1
  else:
    temp = list(map(int,input().split()))
    for l in temp:
      nuske[l-1] = nuske[l-1] + 1

for y in nuske:
  if y == 0:
    counter += 1
print(counter)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
S.append(input())
Triger = 0
temp = ""
for i in range(N-1):
  temp = input()
  for j in S:
    if j == temp:
      Triger += 1
      break
  if Triger == 0:
    S.append(temp)
  else:
    Triger = 0
print(len(S))

Fixed submission:
N = int(input())
S = []

for i in range(N):
  S.append(input())
S= set(S)
print(len(S))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(map(int,input().split()))
counter = int(0)
tmp = int(0)
breakPoint = int(0)

if N == 1:
  print("1")

else:
  for i in S:
    tmp = tmp + 1
    if tmp == 1:
      counter = counter + 1
      continue
    for j in range(0,tmp-1):
      if S[j] < i:
        breakPoint = 1
        break
      else:
        continue
    if breakPoint == 0:
      counter = counter + 1
    else:
      breakPoint = 0
  print(counter)

Fixed submission:
N = int(input())
S = list(map(int,input().split()))
counter = int(0)
minNum = S[0]

if N == 1:
  print("1")

else:
  for i in range(N):
    if minNum >= S[i]:
      minNum = S[i]
      counter = counter + 1
    
  print(counter)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(map(int,input().split()))
counter = int(0)
tmp = int(0)
breakPoint = int(0)

if N == 1:
  print("1")

else:
  for i in S:
    tmp = tmp + 1
    for j in range(0,tmp):
      if S[j] >= i:
        continue
      else:
        breakPoint = 1
        break
    if breakPoint == 0:
      counter = counter + 1
    else:
      breakPoint = 0
  print(counter)

Fixed submission:
N = int(input())
S = list(map(int,input().split()))
counter = int(0)
minNum = S[0]

if N == 1:
  print("1")

else:
  for i in range(N):
    if minNum >= S[i]:
      minNum = S[i]
      counter = counter + 1
    
  print(counter)
Buggy python submission (verdict: Runtime Error):
N = list(map(int,input().split(" ")))

if N[0]*500 >= N[1]:
  print("Yes")
elif:
  print("No")

Fixed submission:
N = list(map(int,input().split(" ")))
 
if N[0]*500 >= N[1]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
A,B,K = list(map(int,input().split(" ")))

takahashi = A
aoki = B

if A >= K:
  print(A-k, B)
elif A + B >= K:
  print(0, A+B-K)
else:
  print("0 0")

Fixed submission:
A,B,K = list(map(int,input().split(" ")))

if A >= K:
  print(A-K, B)
elif A + B >= K:
  print(0, A+B-K)
else:
  print("0 0")

Buggy python submission (verdict: Runtime Error):
A,B,K = list(map(int,input().split(" ")))

if A >= K:
  print(A-k, B)
elif A + B >= K:
  print(0, A+B-K)
else:
  print("0 0")

Fixed submission:
A,B,K = list(map(int,input().split(" ")))

if A >= K:
  print(A-K, B)
elif A + B >= K:
  print(0, A+B-K)
else:
  print("0 0")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = list(map(int,input().split()))
maxMove = 0
tempoMove = 0
for i in range(N):
  if N-len(range(i)) <= maxMove:
    break
  for j in range(N-i-1):
    if i < maxMove:
      break
    if H[i+j]>=H[i+j+1]:
      tempoMove = tempoMove + 1
    else:
      break
  if tempoMove > maxMove:
    maxMove = tempoMove
    tempoMove = 0
  else:
  	tempoMove = 0
print(maxMove)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
maxMove = 0
tempoMove = 0
for i in range(N):
  if N-len(range(i)) <= maxMove:
    break
  if tempoMove > 0:
    tempoMove = tempoMove - 1
    continue
  for j in range(N-i-1):
    if H[i+j]>=H[i+j+1]:
      tempoMove = tempoMove + 1
    else:
      break
  if tempoMove > maxMove:
    maxMove = tempoMove
print(maxMove)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = list(map(int,input().split()))
maxMove = 0
tempoMove = 0
for i in range(N):
  for j in range(N-i-1):
    if i < maxMove:
      break
    if H[i+j]>=H[i+j+1]:
      tempoMove = tempoMove + 1
    else:
      break
  if tempoMove > maxMove:
    maxMove = tempoMove
    tempoMove = 0
  else:
  	tempoMove = 0
print(maxMove)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
maxMove = 0
tempoMove = 0
for i in range(N):
  if N-len(range(i)) <= maxMove:
    break
  if tempoMove > 0:
    tempoMove = tempoMove - 1
    continue
  for j in range(N-i-1):
    if H[i+j]>=H[i+j+1]:
      tempoMove = tempoMove + 1
    else:
      break
  if tempoMove > maxMove:
    maxMove = tempoMove
print(maxMove)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
q = int(input())

import collections
a = collections.Counter(a)
for i in range(q):
    b,c = list(map(int,input().split()))
    d = a[b]
    a[b] = 0
    a[c] += d
    print(sum([key*value for key,value in a.items()]))

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

import collections
ans = sum(a)
a = collections.Counter(a)

for i in range(q):
    b,c = list(map(int,input().split()))
    d = a[b]
    ans -= d*b
    a[b] = 0
    ans += d*c
    a[c] += d
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
q = int(input())
for i in range(q):
    b,c = list(map(int,input().split()))
    a = [i if i!=b else c for i in a]
    print(sum(a))

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

import collections
ans = sum(a)
a = collections.Counter(a)

for i in range(q):
    b,c = list(map(int,input().split()))
    d = a[b]
    ans -= d*b
    a[b] = 0
    ans += d*c
    a[c] += d
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
print(ans if ans<=10**18 else -1)

Fixed submission:
import sys
n = int(input())
a = list(map(int,input().split()))
M = 10**18
a.sort(reverse=True)
ans = 1
if a[-1]==0:
    print(0)
else:
    for i in range(n):
        ans *= a[i]
        if ans >M:
            print(-1)
            sys.exit()
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

a,b,n = LI()
import math

ans = 0
for i in range(n+1):
    ans = max(ans, math.floor(a*i/b)-a*math.floor(i/b))
print(ans)

Fixed submission:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

a,b,n = LI()

m = min(b-1, n)
print(int(a*m/b)-a*int(m/b))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

a,b,n = LI()
import math

ans = 0
for i in range(n+1):
    m = math.floor(a*i/b)-a*math.floor(i/b)
    if m>ans:
        ans = m
print(ans)

Fixed submission:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

a,b,n = LI()

m = min(b-1, n)
print(int(a*m/b)-a*int(m/b))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
import math
from functools import reduce

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]

k = int(input())
def gcd(*numbers):
    return reduce(math.gcd, numbers)

count = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            count += gcd(i,j,l)
print(count)

Fixed submission:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
import math
from functools import reduce
import numpy as np

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]

k = int(input())
def gcd(*numbers):
    return reduce(math.gcd, numbers)

count = 0
a = []
for i in range(1,k+1):
    for j in range(1,k+1):
        a = math.gcd(i,j)
        for l in range(1,k+1):
            count += math.gcd(a,l)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
 
i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

n,x,y = i_l()
x -= 1
y -= 1
a = []

for i in range(n):
    for j in range(i+1, n):
        a.append(min(abs(i-j), abs(x-i)+1+abs(y-j), abs(y-j)+1+abs(y-i)))
for i in range(1, n):
    count = a.count(i)
    if count>0:
        print(count)
    else:
        print(0)

Fixed submission:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
 
i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

n,x,y = i_l()
x -= 1
y -= 1
a = [0]*n

for i in range(n):
    for j in range(i+1, n):
        b = min(abs(i-j), abs(x-i)+1+abs(y-j), abs(y-j)+1+abs(y-i))
        a[b] += 1
        
for i in a[1:]:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

s = input()
q = int(input())
# print(s,q)
head = True
for i in range(q):
    query = input().split(' ')
    # print(query)
    if query[0]=='1':
        head = not head
    else:
        if query[1]=='1':
            if head:
                s = query[2]+s
            else:
                s += query[2]
        else:
            if head:
                s += query[2]
            else:
                s = query[2]+s
    # print(s)
if head:
    print(''.join(s))
else:
    print(''.join(s[::-1]))

Fixed submission:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

s = input()
q = int(input())
# print(s,q)
head = True
right = ''
left = ''
for i in range(q):
    query = input().split(' ')
    # print(query)
    if query[0]=='1':
        head = not head
    else:
        if query[1]=='1':
            if head:
                left += query[2]
            else:
                right += query[2]
        else:
            if head:
                right += query[2]
            else:
                left += query[2]
    # print(left,  right)
s = left[::-1]+s+right
if head:
    print(s)
else:
    print(s[::-1])
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
x = [int(i) for i in input().split()]

_list = [-1 for i in range(100)]
if n==1:
    print(0)
else:
    for i in range(min(x), max(x), 1):
        a = 0
        for j in range(n):
            a += (x[j]-i)**2
        _list[i] = a
    _list = np.array(_list)
    print(min(_list[_list>=0]))

Fixed submission:
import numpy as np
n = int(input())
x = [int(i) for i in input().split()]

_list = [-1 for i in range(100)]
if min(x)==max(x):
    print(0)
else:
    for i in range(min(x), max(x), 1):
        a = 0
        for j in range(n):
            a += (x[j]-i)**2
        _list[i] = a
    _list = np.array(_list)
    print(min(_list[_list>=0]))

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
x = [int(i) for i in input().split()]

_list = [-1 for i in range(100)]
for i in range(min(x), max(x), 1):
    a = 0
    for j in range(n):
        a += (x[j]-i)**2
    _list[i] = a
_list = np.array(_list)
print(min(_list[_list>=0]))

Fixed submission:
import numpy as np
n = int(input())
x = [int(i) for i in input().split()]

_list = [-1 for i in range(100)]
if min(x)==max(x):
    print(0)
else:
    for i in range(min(x), max(x), 1):
        a = 0
        for j in range(n):
            a += (x[j]-i)**2
        _list[i] = a
    _list = np.array(_list)
    print(min(_list[_list>=0]))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

from collections import Counter
n = int(input())
s = Counter([input() for i in range(n)])
ans = [k for k,v in s.items() if v==max(s.values())]
print('\n'.join(sorted(ans)))

Fixed submission:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

from collections import Counter
n = int(input())
s = Counter([input() for i in range(n)])
high = max(s.values())
ans = [k for k,v in s.items() if v==high]
print('\n'.join(sorted(ans)))

Buggy python submission (verdict: Runtime Error):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

import pandas as pd
n = int(input())
s = [input() for i in range(n)]
d = pd.Series(s).value_counts()
print('\n'.join(sorted(list(d[d==max(d)].index))))

Fixed submission:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

from collections import Counter
n = int(input())
s = Counter([input() for i in range(n)])
high = max(s.values())
ans = [k for k,v in s.items() if v==high]
print('\n'.join(sorted(ans)))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

n = int(input())
d = {}
for i in range(n):
    s = input()
    if s not in d.keys():
        d[s] = 0
    d[s] += 1
# print(d)
# print(max(d.values()))
ans = [k for k,v in d.items() if v==max(d.values())]
print('\n'.join(sorted(ans)))

Fixed submission:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

from collections import Counter
n = int(input())
s = Counter([input() for i in range(n)])
high = max(s.values())
ans = [k for k,v in s.items() if v==high]
print('\n'.join(sorted(ans)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
b = [int(i) for i in input().split()]
a = [b[0]]
for i in range(n-2):
    c = min(b[i], b[i+1])
    a.append(c)
    
a.append(max(b[-2],b[-1]))
print(sum(a))

Fixed submission:
n = int(input())
b = [int(i) for i in input().split()]
a = [b[0]]
for i in range(n-2):
    c = min(b[i], b[i+1])
    a.append(c)
    
try:
    if b[-2]<=b[-1]:
        a.append(max(b[-2],b[-1]))
    else:
        a.append(min(b[-2],b[-1]))
except:
    a.append(b[0])
print(sum(a))
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = []
try:
    for i in range(n-1):
        if h[i]>=h[i+1]:
            count +=1
        else:
            c_list.append(count)
            count= 0
except:
    a =1
print(max(max(c_list), count))

Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = [0]
try:
    for i in range(n-1):
        if h[i]>=h[i+1]:
            count +=1
        else:
            c_list.append(count)
            count= 0
except:
    a =1
print(max(max(c_list), count))

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = []
try:
    for i in range(n-1):
        if h[i]>=h[i+1]:
            count +=1
        else:
            c_list.append(count)
            count= 0
except:
    break
print(max(max(c_list), count))

Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = [0]
try:
    for i in range(n-1):
        if h[i]>=h[i+1]:
            count +=1
        else:
            c_list.append(count)
            count= 0
except:
    a =1
print(max(max(c_list), count))

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = []
for i in range(n-1):
    if h[i]>=h[i+1]:
        count +=1
    else:
        c_list.append(count)
        count= 0
print(max(max(c_list), count))

Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = [0]
try:
    for i in range(n-1):
        if h[i]>=h[i+1]:
            count +=1
        else:
            c_list.append(count)
            count= 0
except:
    a =1
print(max(max(c_list), count))

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = []
for i in range(n-1):
    if h[i]>=h[i+1]:
        count +=1
    else:
        c_list.append(count)
        count= 0
print(max(max(c_list), count))

Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = [0]
try:
    for i in range(n-1):
        if h[i]>=h[i+1]:
            count +=1
        else:
            c_list.append(count)
            count= 0
except:
    a =1
print(max(max(c_list), count))
Buggy python submission (verdict: Runtime Error):
s = [i for i in input()]
count = 1
s0 = s[0]
flag = 0
for i in range(1, len(s)):
    if flag==1:
        flag = 0
        continue
    if s0==s[i]:
        s0 = s[i] + s[i+1]
        flag = 1
    else:
        s0 = s[i]
    count += 1
print(count)

Fixed submission:
s = [i for i in input()]
count = 1
s0 = s[0]
flag = 0
for i in range(1, len(s)):
    try:
        if flag==1:
            flag = 0
            continue
        if s0==s[i]:
            s0 = s[i] + s[i+1]
            flag = 1
        else:
            s0 = s[i]
        count += 1
    except:
        continue
print(count)

Buggy python submission (verdict: Runtime Error):
s = [i for i in input()]
count = 1
s0 = s[0]
flag = 0
for i in range(1, len(s)):
    if flag==1:
        flag = 0
        continue
    if s0==s[i]:
        s0 = s[i] + s[i+1]
        flag = 1
    else:
        s0 = s[i]
    count += 1
    print(s0)
print(count)

Fixed submission:
s = [i for i in input()]
count = 1
s0 = s[0]
flag = 0
for i in range(1, len(s)):
    try:
        if flag==1:
            flag = 0
            continue
        if s0==s[i]:
            s0 = s[i] + s[i+1]
            flag = 1
        else:
            s0 = s[i]
        count += 1
    except:
        continue
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
L, R = [int(i) for i in(input().split(' '))]
minn=2019
for i in range(L,R):
    for j in range(i+1,R+1):
        mo = i*j
        amari = mo%2019
        minn = min(amari,minn)
        if minn==0:
          break
print(minn)

Fixed submission:
L, R = [int(i) for i in(input().split(' '))]
minn=2019
if R-L+1>2019:
  print(0)
  exit()
for i in range(L,R):
    for j in range(i+1,R+1):
        mo = i*j
        amari = mo%2019
        minn = min(amari,minn)
        if minn==0:
          break
print(minn)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = [int(i) for i in(input().split(' '))]
minn=2019
for i in range(L,R):
    for j in range(i+1,R+1):
        mo = i*j
        amari = mo%2019
        minn = min(amari,minn)
print(minn)

Fixed submission:
L, R = [int(i) for i in(input().split(' '))]
minn=2019
if R-L+1>2019:
  print(0)
  exit()
for i in range(L,R):
    for j in range(i+1,R+1):
        mo = i*j
        amari = mo%2019
        minn = min(amari,minn)
        if minn==0:
          break
print(minn)
Buggy python submission (verdict: Runtime Error):
n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
count = 0
for i, c in enumerate(l):
    count += c
    if count>x:
        p = i+1
        break
print(p)

Fixed submission:
n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
count = 0
try:
    for i, c in enumerate(l):
        count += c
        if count>x:
            p = i+1
            break
    print(p)
except:
    print(n+1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
data=input().split()

count=0
for i in range(1,n-1):
  if int(data[i])>int(data[i-1]) and int(data[i])<=int(data[i+1]):
    count=+1
  elif int(data[i])<int(data[i-1]) and int(data[i])>=int(data[i+1]):
    count+=1

print(count)


Fixed submission:
data=input()
if data[0]==data[1] and data[2]==data[3] and data[0]!=data[2]:
  print("Yes")
elif data[0]==data[2] and data[1]==data[3] and data[0]!=data[1]:
  print("Yes")
elif data[0]==data[3] and data[1]==data[2] and data[0]!=data[1]:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
data=input().split()
if data[0]==data[1] and data[2]==data[3]:
  print("Yes")
elif data[0]==data[2] and data[1]==data[3]:
  print("Yes")
elif data[0]==data[3] and data[1]==data[2]:
  print("Yes")
else:
  print("No")

Fixed submission:
data=input()
if data[0]==data[1] and data[2]==data[3] and data[0]!=data[2]:
  print("Yes")
elif data[0]==data[2] and data[1]==data[3] and data[0]!=data[1]:
  print("Yes")
elif data[0]==data[3] and data[1]==data[2] and data[0]!=data[1]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
d_s=input().split()
d_i=[int(x) for x in d_s]
d=sorted(d_i)
k=d[n/2]
t=d[n/2-1]
print(k-t)

Fixed submission:
n=int(input())
d_s=input().split()
d_i=[int(x) for x in d_s]
d=sorted(d_i)
k=d[int(n/2)]
t=d[int(n/2)-1]
print(k-t)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
d_s=input().split()
d=[int(x) for x in d_s]
judge=0
count=0
for i in range(1,100000):
  for x in d:
    if x==i:
      count+=1
  if count==n/2:
    judge+=1
  elif count>n/2:
    break
print(judge)

Fixed submission:
n=int(input())
d_s=input().split()
d_i=[int(x) for x in d_s]
d=sorted(d_i)
k=d[int(n/2)]
t=d[int(n/2)-1]
print(k-t)