Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03494 (python)

Fixed submission:
def how_many(n):
  count = 0
  while n%2==0:
    n = n/2
    count += 1
  return count

N = int(input())
A = map(int, input().split())
print(min(map(how_many, A)))

Buggy submission (verdict: Runtime Error):
def how_many(n):
  count = 0
  while n%2==0:
    n /= 2
    count += 1
    return count

N = int(input())
A = map(int, input().split())
print(min(map(how_many, A)))

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

count = 0
while True:
  for i in range(len(A)):
    if A[i]%2==0:
      A[i] = A[i]/2
    count += 1  
    else:
      brake

Buggy submission (verdict: Runtime Error):
N = int(input())
A = sorted(map(int, input().split))

count = 0
while True:
  for i in range(len(A)):
    if A[i]%2==0:
      A[i] = A[i]/2
    count += 1  
    else:
      brake
Problem p03854 (python)

Fixed submission:
def main():
  S = input()
  while len(S)>=5:
    if len(S)>=7 and S[-7:]=="dreamer":
      S = S[:-7]
      continue
    
    elif len(S)>=6 and S[-6:]=="eraser":
      S = S[:-6]
      continue
    elif S[-5:]=="dream" or S[-5:]=="erase":
      S = S[:-5]
      continue
    else:
      break
  if len(S)==0:
    print('YES')
  else:
    print('NO')
    
main()

Buggy submission (verdict: Runtime Error):
スコード 

Copy
Copy
def main():
  S = input()
  while len(S)>=5:
    if len(S)>=7 and S[-7:]=="dreamer":
      S = S[:-7]
      continue
    
    elif len(S)>=6 and S[-6:]=="eraser":
      S = S[:-6]
      continue
    elif S[-5:]=="dream" or S[-5:]=="erase":
      S = S[:-5]
      continue
    else:
      break
  if len(S)==0:
    print('Yes')
  else:
    print('No')
    
main()
Problem p02741 (python)

Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(a[k-1])

Buggy submission (verdict: Runtime Error):
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(a[k+1])
Problem p02639 (python)

Fixed submission:
x = list(map(int,input().split()))
for j in range(0,5):
	if x[j] == 0:
		print(j+1)

Buggy submission (verdict: Runtime Error):
x = [0]
for i in range(1,6):
	x.append(int(input("Please input:\n")))
for j in range(1,5):
	if x[j] == 0:
		print(j)
Problem p02665 (python)

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

sita_maxi = [0 for i in range(n+1)]
sita_maxi[n] = a[n]
for i in range(n-1, -1, -1):
    sita_maxi[i] = sita_maxi[i+1] + a[i]

if a[0] > 1:
    print(-1)
    exit()

lst = [1]
for i in range(1, n+1):
    lst.append(min((lst[i-1]-a[i-1])*2, sita_maxi[i]))
    if lst[-1] < a[i]:
        print(-1)
        exit()

print(sum(lst))

Buggy submission (verdict: Runtime Error):
N = int(input())
a_list = [int(a) for a in input().split()]

if a[0] > 1:
    print(-1)
    exit()

ans = a_list[-1] + 1
temp1 = [""]*(N+1)
temp1[-1] = a_list[-1]
for n in range(N-1, 0, -1):
    temp1[n] = temp1[n+1]+a_list[n]
    
temp2 = 1
for n in range(1, N):
    temp2 = (temp2-a_list[n-1])*2
    ans_temp = min(temp2, temp1[n])
    
    if ans_temp < a_list[n]:
        print(-1)
        exit()
    
    ans += ans_temp
    
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
a_list = [int(a) for a in input().split()]

if a[0] > 1:
    print(-1)
    exit()

ans = a_list[-1] + 1
temp1 = [""]*(N+1)
temp1[-1] = a_list[-1]
for n in range(N-1, 0, -1):
    temp1[n] = temp1[n+1]+a_list[n]
    
temp2 = 1
for n in range(1, N):
    temp2 = (temp2-a_list[n-1])*2
    ans_temp = min(temp2, temp1[n])
    
    if ans_temp < a_list[n]:
        print(-1)
        exit()
    
    ans += ans_temp
    
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
a_list = [int(a) for a in input().split()]

if a[0] > 1:
    print(-1)
    exit()

ans = a_list[-1] + 1
temp1 = [""]*(N+1)
temp1[-1] = a_list[-1]
for n in range(N-1, 0, -1):
    temp1[n] = temp1[n+1]+a_list[n]
    
temp2 = 1
print(temp1)
for n in range(1, N):
    temp2 = (temp2-a_list[n-1])*2
    ans_temp = min(temp2, temp1[n])
    
    if ans_temp < a_list[n]:
        print(-1)
        exit()
    
    ans += ans_temp
    
print(ans)
Problem p03680 (python)

Fixed submission:
N = int(input())
a_list = []
for n in range(N):
    a_list.append(int(input()))

count = 0
pos = 1
for n in range(N):
    count += 1
    if a_list[pos-1]==2:
        print(count)
        break
    pos = a_list[pos-1]
    
if a_list[pos-1]!=2:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
a_list = []
for n in range(N):
    a_list.append(int(input()))

count = 0
pos = 1
for n in range(N):
    pos = a_list[pos-1]
    count += 1
    if a_list[pos-1]==2:
        print(count)
        break
if a_list[pos]!=2:
    print(-1)
Problem p03957 (python)

Fixed submission:
val = input()
count = 0
for i in range(len(val)):
    if val[i] == "C":
        for n in range(i+1, len(val)):
            if val[n] == "F" and count == 0:
                print("Yes")
                count += 1
if count == 0:
    print("No")

Buggy submission (verdict: Runtime Error):
val = input()
for i in range(len(val)):
  if val[i] == "C":
  	for n range(i+1, len(val)):
      if val[n] == "F":
      	print("Yes")
      else:
        print("No")
  else:
    print("No")
Problem p02612 (python)

Fixed submission:
N = int(input())

for i in range(1,11):
    x = 1000 * i - N
    if x < 0:
        continue
    else:
        print(x)
        exit()

Buggy submission (verdict: Runtime Error):
N = int(input())

for i in 11:
    x = 1000 * i - N
    if x < 0:
        continue
    else:
        exit()
ans = x % 1000
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())

for i in 11:
    ans = (1000*i - N) % 1000

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())

for i in 11:
    x = 1000*i - N
ans = x % 1000
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())

for i in 11:
    x = 1000*i - N
    ans = x % 1000
print(ans)
Problem p02812 (python)

Fixed submission:
n = int(input())
s = input()
ans = 0
for i in range(n-2):
  if s[i:i+3] == 'ABC':
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
ans = 0
for i in range(N-2):
  if s[i:i+3] == 'ABC':
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

count = 0
for i in range(n-2):
  if S[k:k+3] == "ABC":
    count +=1
print("%d"%(count))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())

count = 0
for i in range(N):
  if i == "ABC":
    count += 1
print("%d"%(count)
Problem p02952 (python)

Fixed submission:
N = int(input())
ans = 0
for i in range(1,N + 1):
    if(len(str(i)) % 2 == 1):
        ans += 1   
print("%d"%(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0

for i in N:
  if i % 2 == 1:
    ans += 1
print("%d"%(ans))
Problem p03086 (python)

Fixed submission:
s = input()
ans = 0
memo = 0
for i in s:
    if i == 'A' or i == 'T' or i == 'C' or i == 'G':
        memo += 1
    else:
        ans = max(ans, memo)
        memo = 0
print(max(ans, memo))

Buggy submission (verdict: Runtime Error):
S = input()
count = 0

for i in range(S):
  if i == "A" or i == "C" or i == "G" or i == "T":
    count += 1
print("%d"%(count))
Problem p03290 (python)

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 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)

Buggy 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)
Problem p03494 (python)

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 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)

Buggy 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)

Buggy 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)
Problem p03747 (python)

Fixed submission:
def main():
    N, L, T = map(int, input().split())
    collision = 0
    ants = []
    for i in range(N):
        x, w = map(int, input().split())
        if w == 1:
            collision += (x + T) // L
            a = (x + T) % L
        else:
            collision += (x - T) // L
            a = (x - T) % L
        ants.append(a)
 
    collision %= N
    ants.sort()
    ants = ants[collision:] + ants[:collision]
    for ant in ants:
        print(ant)
 
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
 
def main():
    N, L, T = map(int, readline().split())
    position = []
    count = 0
    for i in range(N):
        x,w = map(int, readline().split())
        if w==1:
        	count += (x+T)//L
            position.append((x+T)%L)
        else:
            if x-T<0:
                count += (x-T)//L
            position.append((x-T)%L)
    position.sort()
    count %= N
    ans = position[count:] + position[:count]
    for i in range(N):
        print(ans[i])

Buggy submission (verdict: Runtime Error):
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
 
def main():
    N, L, T = map(int, readline().split())
    position = []
    cnt = 0
    for i in range(N):
        x,w = map(int, readline().split())
        if w==1:
        	cnt += (x+T)//L
            position.append((x+T)%L)
        else:
            if x-T<0:
                cnt += (x-T)//L
            position.append((x-T)%L)
    position.sort()
    cnt %= N
    ans = position[cnt:] + position[:cnt]
    for i in range(N):
        print(ans[i])

Buggy submission (verdict: Runtime Error):
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
 
def main():
    N, L, T = map(int, readline().split())
    position = []
    cnt = 0
    for i in range(N):
        x,w = map(int, readline().split())
        if w==1:
        	cnt += (x+T)//L
            position.append((x+T)%L)
        else:
            if x-T<0:
                cnt += (x-T)//L
            position.append((x-T)%L)
    position.sort()
    cnt %= N
    ans = position[count:] + position[:count]
    for i in range(N):
        print(ans[i])

Buggy submission (verdict: Runtime Error):
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
 
def main():
    N, L, T = map(int, readline().split())
    position = []
    
    cnt = 0
    for i in range(N):
      x, w = map(int, input().split())
      if w == 1:
        cnt += (x - T)//L
        position.append((x-T)%L)
      else:
        if x-T < 0:
          cnt += (x - T)//L
        position.append((x - T)%L)
	position.sort()
    cnt %= N
    
    ans = position[cnt:] + position[:cnt]
    for i in range(N):
      print(ans[i])
Problem p04001 (python)

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 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)

Buggy 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)

Buggy 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)

Buggy 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)
Problem p02705 (python)

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

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

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

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

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

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

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

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

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

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 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()
Problem p02988 (python)

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 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)
Problem p03293 (python)

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 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')
Problem p03308 (python)

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

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

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

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

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

print(max(a) - min(a))
Problem p02645 (python)

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

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

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

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 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)
Problem p02909 (python)

Fixed submission:
s=input()

if s == "Sunny":
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
elif s == "Rainy":
    print("Sunny")

Buggy 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")
Problem p02993 (python)

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 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))
Problem p03000 (python)

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 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)

Buggy 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)

Buggy 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)

Buggy 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)

Buggy 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)

Buggy 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)
Problem p03001 (python)

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 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)
Problem p03860 (python)

Fixed submission:
s = input().split()
print(s[0][0]+s[1][0]+s[2][0])

Buggy submission (verdict: Runtime Error):
print(s[0][0]+s[1][0]+s[2][0])
Problem p02687 (python)

Fixed submission:
if(input().rstrip() == 'ABC'):
    print('ARC')
else:
    print('ABC')

Buggy submission (verdict: Runtime Error):
if(input().rstrip() == 'ABC':
   print('ARC')
else:
   print('ABC')
Problem p03239 (python)

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 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)