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

Fixed submission:
A, B, C, D, E, F=map(int, input().split())
wans=0
sans=0
for i in range(31):
    w=100*A*i
    s=0
    if s+w>F:
        break
    for j in range(31):
        w=100*A*i+100*B*j
        s=0
        if s+w>F:
            break
        for k in range(3001):
            w=100*A*i+100*B*j
            s=C*k
            if s+w>F:
                break
            for l in range(3001):
                w=100*A*i+100*B*j
                s=C*k+D*l
                if s+w>F:
                    break
                if w!=0 and s*(100+E)<=(s+w)*E and sans*(s+w)<=s*(sans+wans) and w+s<=F:
                    sans=s
                    wans=w
                #print(sans,sans+wans)
print(sans+wans,sans)

Buggy submission (verdict: Runtime Error):
A, B, C, D, E, F=map(int, input().split())
for i in range(31):
    w=100*A*i
    s=0
    if s+w>F:
        break
    for j in range(31):
        w=100*A*i+100*B*j
        s=0
        if s+w>F:
            break
        for k in range(3001):
            w=100*A*i+100*B*j
            s=C*k
            if s+w>F:
                break
            for l in range(3001):
                w=100*A*i+100*B*j
                s=C*k+D*l
                if s+w>F:
                    break
                if w!=0 and s*(100+E)<=(s+w)*E and sans*(s+w)<=s*(sans+wans) and w+s<=F:
                    sans=s
                    wans=w
                #print(sans,sans+wans)
print(sans+wans,sans)
Problem p03607 (python)

Fixed submission:
d={}
N = int(input())
    
for i in range(N):
    b=int(input().strip())
    if b in d:
        d.pop(b)
    else:
        d[b]=-1
print(len(d))

Buggy submission (verdict: Runtime Error):
a=[0]*1000000001
N = int(input())
for i in range(N):
    a[int(input().strip())]+=1
for i in range(len(a)):
    a[i]=a[i]%2
print(sum(a))
Problem p03608 (python)

Fixed submission:
import sys
input = sys.stdin.readline

#dojkstra
import itertools
import queue
G=[]
#infの値に注意
inf=3*10**15
V, E, R=map(int,input().strip().split(' '))
rlis=list(map(int,input().strip().split(' ')))

cost=[[inf]*V for i in range(V)]
for i in range(E):
    fr, to, co=map(int,input().strip().split(' '))
    cost[fr-1][to-1]=co
    cost[to-1][fr-1]=co
def dijkstra(s):
    d=[inf]*V
    used=[False]*V
    d[s]=0
    while True:
        v=-1
        for u in range(V):
            if used[u]==False and(v==-1 or d[u]<d[v]):
                v=u
        if v==-1:
            break
        used[v]=True
        for u in range(V):
            d[u]=min(d[u],d[v]+cost[v][u])
    return d

dist=[None] * V
for i in rlis:
    dist[i-1]=dijkstra(i-1)

ans=inf
for rperm in itertools.permutations(rlis):
    a_tmp=0
    for j in range(R-1):
        a_tmp+=dist[rperm[j]-1][rperm[j+1]-1]
    ans=min(ans,a_tmp)

print(ans)

Buggy submission (verdict: Runtime Error):
#dojkstra
import itertools
import queue
G=[]
#infの値に注意
inf=3*10**15
V, E, R=map(int,input().strip().split(' '))
rlis=list(map(int,input().strip().split(' ')))

cost=[[inf]*V for i in range(V)]
for i in range(E):
    fr, to, co=map(int,input().strip().split(' '))
    cost[fr-1][to-1]=co
    cost[to-1][fr-1]=co
def dijkstra(s):
    d=[inf]*V
    used=[False]*V
    d[s]=0
    while True:
        v=-1
        for u in range(V):
            if used[u]==False and(v==-1 or d[u]<d[v]):
                v=u
        if v==-1:
            break
        used[v]=True
        for u in range(V):
            d[u]=min(d[u],d[v]+cost[v][u])
    return d

dist=[]
for i in range(V):
    dist.append(dijkstra(i))

rperm=n_perm(rlis)

ans=inf
for rperm in itertools.permutations(rlis):
    a_tmp=0
    for j in range(R-1):
        a_tmp+=dist[rperm[j]-1][rperm[j+1]-1]
    ans=min(ans,a_tmp)
    
print(ans)

Buggy submission (verdict: Runtime Error):
#dojkstra (prioroty queue ver.)
import itertools
import queue
G=[]
#infの値に注意
inf=3*10**15
V, E, R=map(int,input().strip().split(' '))
rlis=list(map(int,input().strip().split(' ')))

for i in range(V):
    G.append([])
for i in range(E):
    at,bt,ct=map(int,input().strip().split(' '))
    G[at-1].append([ct,bt-1])
    G[bt-1].append([ct,at-1]) #無向グラフのときはon
'''
#入力が0-indexedのとき
    G[at].append([ct,bt])
    G[bt].append([ct,at]) #無向グラフのときはon
'''
#入力が1-indexedのとき

def dijkstra(s):
    d=[inf]*V
    d[s]=0
    q=queue.PriorityQueue()
    q.put([0,s])
    while q.empty()==False:
        dq,v=q.get()
        if d[v]<dq:
            continue
        for i in range(len(G[v])):
            ec, et=G[v][i]
            #print(ec,et)
            if d[et]>d[v]+ec:
                d[et]=d[v]+ec
                q.put([d[et],et])
    return d

dist=[]
for i in range(V):
    dist.append(dijkstra(i))

rperm=n_perm(rlis)

ans=inf
for rperm in itertools.permutations(rlis):
    a_tmp=0
    for j in range(R-1):
        a_tmp+=dist[rperm[j]-1][rperm[j+1]-1]
    ans=min(ans,a_tmp)
    
print(ans)
Problem p03633 (python)

Fixed submission:
a=[]
N = int(input())
for i in range(N):
    a.append(int(input().strip()))


def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)

if N!=1:
    for i in range(len(a)-1):
        pr=a[i]*a[i+1]
        lcm=pr//gcd(a[i],a[i+1])
        a[i+1]=lcm
else:
    lcm=a[0]

print(lcm)

Buggy submission (verdict: Runtime Error):
a=[]
N = int(input())
for i in range(N):
    a.append(int(input().strip()))


def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)

for i in range(len(a)-1):
    gcd(a[i],a[i+1])
    lcm=(a[i]*a[i+1])//gcd(a[i],a[i+1])

print(lcm)
Problem p03837 (python)

Fixed submission:
def dijkstra(s):
    d=[inf]*V
    used=[False]*V
    d[s]=0
    while True:
        v=-1
        for u in range(V):
            if used[u]==False and(v==-1 or d[u]<d[v]):
                v=u
        if v==-1:
            break
        used[v]=True
        for u in range(V):
            d[u]=min(d[u],d[v]+cost[v][u])
    return d



V, E=map(int,input().strip().split(' '))
inf=10**9
cost=[[inf]*V for i in range(V)]
edge=[]
for i in range(E):
    fr, to, co=map(int,input().strip().split(' '))
    cost[fr-1][to-1]=co
    cost[to-1][fr-1]=co
    edge.append([fr-1,to-1])
    
d=[]
for i in range(V):
    d.append(dijkstra(i))

cand=E
for i in range(E):
    fl=False
    for s in range(V):
        if d[s][edge[i][0]]+cost[edge[i][0]][edge[i][1]]==d[s][edge[i][1]]:
            cand-=1
            fl=True
            break

print(cand)

Buggy submission (verdict: Runtime Error):
#ダイクストラ法
V, E=map(int,input().strip().split(' '))
inf=10**9
cost=[[inf]*V for i in range(V)]
edge=[]
for i in range(E):
    fr, to, co=map(int,input().strip().split(' '))
    cost[fr-1][to-1]=co
    cost[to-1][fr-1]=co
    edge.append([fr-1,to-1])
    
d=[]
for i in range(V):
    d.append(dijkstra(i))

cand=E
for i in range(E):
    fl=False
    for j in range(V):
        for k in range(V):
            if d[j][edge[i][0]]==cost[edge[i][0]][edge[i][1]]+d[k][edge[i][1]]:
                cand-=1
                fl=True
                break
        if fl:
            break

print(cand)

def dijkstra(s):
    d=[inf]*V
    used=[False]*V
    d[s]=0
    while True:
        v=-1
        for u in range(V):
            if used[u]==False and(v==-1 or d[u]<d[v]):
                v=u
        if v==-1:
            break
        used[v]=True
        for u in range(V):
            d[u]=min(d[u],d[v]+cost[v][u])
    return d
Problem p02981 (python)

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

if A*N<B:
    ans=A*N
else:
    ans=B

print(ans)

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

if A*N<B:
    ans=a*N
else:
    ans=B

print(ans)
Problem p02988 (python)

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

count=0

for i in range(n-2):
    if p[i]<p[i+1]<p[i+2] or p[i]>p[i+1]>p[i+2]:
        count+=1

print(count)

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

for i in range(n-2):
    if p[i]<p[i+1]<p[i+2] or p[i]>p[i+1]>p[i+2]:
        count+=1

print(count)
Problem p02981 (python)

Fixed submission:
#スペース区切りの整数の入力
N, A, B  = map(int, input().split())

Train = A * N
Taxi = B

if Train > Taxi:
    print(Taxi)
else:
    print(Train)

Buggy submission (verdict: Runtime Error):
L,R=map(int, input().split())

if R-L+1>=2019:
    print(0)
else:
    L %= 2019
    R %= 2019
    if L<R:
        k=L*(L+1)
        print(k)
    else:
        print(0)
Problem p02983 (python)

Fixed submission:
L,R=map(int, input().split())
 
if R-L+1>=2019:
  print(0)
else:
  L %= 2019
  R %= 2019
  if L<R: 
    m = 2019
    for i in range(L,R+1):
      for j in range(i+1,R+1):
        m = min(m, (i*j)%2019)
    print(m)
  else:
    print(0)

Buggy submission (verdict: Runtime Error):
L,R=map(int, input().split())

if R-L+1>=2019:
    print(0)
else:
    L %= 2019
    R %= 2019
    if L<R:
        k=L*L(+1)
        print(k)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
L,R=map(int, input().split())

if R-L>=2019:
    print(0)
else:
    L %= 2019
        R %= 2019
            if L<R:
m = 2019
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            m = min(m, (i*j)%2019)
    print(m)
        else:
print(0)
Problem p03076 (python)

Fixed submission:
a = [int(input()) for i in range(5)]

b = []

for i in a:
    n = i % 10
    b.append(n)
sum = 0
if b == [0,0,0,0,0]:
    for j in a:
        sum += j
    print(sum)
else:
    c = [i for i in b if i > 0]
    c.sort()

    for j in a:
        sum += j
 
    n = 0
    for k in c:
        n += 10 - k

    N = sum + n + (c[0] - 10)
    print(N)

Buggy submission (verdict: Runtime Error):
a = [int(input()) for i in range(5)]

b = []

for i in a:
    n = i % 10
    b.append(n)

c = [i for i in b if i > 0]
c.sort()

sum = 0
for j in a:
  sum += j
 
n = 0
for k in c:
    n += 10 - k

N = sum + n + (c[0] - 10)
print(N)
Problem p03068 (python)

Fixed submission:
N = int(input())
S = input()
K = int(input())
target = S[K-1]
result = []
result2 = ''
for i in S:
    if i is target:
        result.append(i)
    else:
        result.append('*')
for i in result:
    result2 += i

print(result2)

Buggy submission (verdict: Runtime Error):
K = int(input())
target = S[K-1]
result = []
result2 = ''
for i in S:
    if i is target:
        result.append(i)
    else:
        result.append('*')
for i in result:
    result2 += i

print(result2)
Problem p03211 (python)

Fixed submission:
S = input()
ans = int(999)
diff = int(0)

for i in range(0, len(S) - 2):
    diff = abs(int(S[i:i+3]) - 753)
    if ans > diff:
        ans = diff
print(ans)

Buggy submission (verdict: Runtime Error):
S = int(input())
ans = int(999)
diff = int(0)

for i in range(0, len(S) - 2):
    diff = abs(int(S[i:i+3]) - 753)
    if ans > diff:
        ans = diff
print(ans)
Problem p03029 (python)

Fixed submission:
A,P=(int(i) for i in input().split())
print((P+3*A)//2)

Buggy submission (verdict: Runtime Error):
M=(P+3A)/2
M
Problem p03251 (python)

Fixed submission:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
xn.append(x)
ym.append(y)
flag = 0

if max(xn) < min(ym):
    print("No War")
else:
    print("War")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
flg = 0

if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flg = 1
        elif flg = 0 and i == y:
            print("War")
else:
    print("No War")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
flag = 0

if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
        if flag = 0 and i == y:
            print("War")
else:
    print("War")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("War")
        elif i = y:
            print("No War")
else:
    print("No War")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    for i in range(x, y+1)
        if max(xn) < i and min(ym)>=i:
            print("War")
        elif i = y:
            print("No War")
else:
    print("No War")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    for i in range(x, y+1)
        if max(xn) < i and min(ym)>=i:
            print("War")
            exit
    print("No War")
else:
    print("No War")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    for i in range(x, y+1)
        if max(xn) < i and min(ym)>=i:
            print("War")
            exit
    else:
        print("No War")
else:
    print("No War")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    z = range(x, y+1)
    if max(xn) < z and min(ym)>=z:
        print("War")
    else:
        print("No War")
else:
    print("No War")

Buggy submission (verdict: Runtime Error):
# coding: utf-8

n, m, x, y = map(int, input().split())
xn = list(map(int, input().split())
ym = list(map(int, input().split())

if x < y:
    if max(xn) < min(ym):
        print("War")
else:
    print("No War")
Problem p02999 (python)

Fixed submission:
x,a=map(int,input().split())
if x<a:print(0)
else:print(10)

Buggy submission (verdict: Runtime Error):
x,a=int(input().split())
if x>=a:print(10)
else:print(1)
Problem p03547 (python)

Fixed submission:
x,y=input().split()
lis=["A","B","C","D","E","F"]
for i in range(6):
    if x==lis[i]:x=i+10
    if y==lis[i]:y=i+10
if x<y:print("<")
elif x>y:print(">")
elif x==y:print("=")

Buggy submission (verdict: Runtime Error):
x,y=input().split()
if x=="A":x=10
elif x=="B":X=11
elif x=="C":x=12
elif x=="D":x=13
elif x=="E":x=14
elif x=="F":x=15
if y=="A":y=10
elif y=="B":y=11
elif y=="C":y=12
elif y=="D":y=13
elif y=="E":y=14
elif y=="F":y=15
if x-y<0:print("<")
elif x-y>0:print(">")
elif x-y==0:print("=")

Buggy submission (verdict: Runtime Error):
x,y=input().split()
if x=="A":
    x=10
if x=="B":
    X=11
if x=="C":
    x=12
if x=="D":
    x=13
if x=="E":
    x=14
if x=="F":
    x=15
if y=="A":
    y=10
if y=="B":
    y=11
if y=="C":
    y=12
if y=="D":
    y=13
if y=="E":
    y=14
if y=="F":
    y=15
if x<y:
    print("<")
elif x>y:
    print(">")
elif x==y:
    print("=")

Buggy submission (verdict: Runtime Error):
x,y=input().split()
if x=="A":x=10
if x=="B":X=11
if x=="C":x=12
if x=="D":x=13
if x=="E":x=14
if x=="F":x=15
if y=="A":y=10
if y=="B":y=11
if y=="C":y=12
if y=="D":y=13
if y=="E":y=14
if y=="F":y=15
if x<y:print("<")
elif x>y:print(">")
else:print("=")
Problem p03962 (python)

Fixed submission:
a=input().split()
b=set(a)
print(len(b))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==b==c:
    print(1)
elif a==b or b==c or a==b:
    print(2)
else:
    print(3)3 3 33
Problem p02981 (python)

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

train=a[0]*a[1]
taxi=a[2]
if (train<=taxi):
  print(train)
else:
  print(taxi)

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

train=A*N
taxi=B
if (train<=taxi):
  print(train)
else:
  print(taxi)

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

int train=A*N
int taxi=B
if (train<=taxi):
  print(train)
else:
  print(taxi)

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

int train=A*N
int taxi=B
if (train<=taxi):
  print(train)
else:
  print(taxi)
Problem p03543 (python)

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

Buggy submission (verdict: Runtime Error):
 = input()
if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[2] == N[3]):
    print("Yes")
else:
    print("No")
Problem p03573 (python)

Fixed submission:
a, b, c = map(int, input().split())
d = a + b + c

if a == b:
    print(c)
elif b == c:
    print(a)
elif c == a:
    print(b)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
d = a + b + c

if a = b:
    print(c)
elif b = c:
    print(a)
elif c = a:
    print(b)
Problem p03697 (python)

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

if c < 10:
    print(c)
else:
    print("error")

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

if c < 10:
    print(c)
else:
    print(error)
Problem p02993 (python)

Fixed submission:
S=int(input())
a=S
b=[]
for i in range(4):
    b.append(a%10)
    a//=10
if b[0]==b[1] or b[1]==b[2] or b[2]==b[3]:
    print("Bad")
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
S=int(input())
a=S
b=[]
while a>0:
    b.append(a%10)
    a//=10
if b[0]==b[1] or b[1]==b[2] or b[2]==b[3]:
    print("Bad")
else:
    print("Good")
Problem p03261 (python)

Fixed submission:
N=int(input())
W=[]
for i in range(N):
    w=input()
    W.append(w)
last=W[0][-1]
S=set()
S.add(W[0])
for i in range(1,N):
    if W[i][0]==last and not W[i] in S:
        pass
    else:
        print("No")
        exit()
    S.add(W[i])
    last=W[i][-1]
print("Yes")

Buggy submission (verdict: Runtime Error):
N=int(input())
W=[]
for i in range(N):
    w=input()
    W.append(w)
    last=W[0][-1]
    S=set()
    S.add(w[0])
for i in range(1,N):
    if W[i][0]==last and not W[i] in S:
        pass
    else:
        print("No")
        exit()
    S.add(w[i])
    last=w[i][-1] #ケツ追加した
print("Yes")
Problem p02983 (python)

Fixed submission:
L,R = map(int,input().split())
ans = 10000000000
for i in range(L,R + 1):
	if ans == 0:
		break
		
	for j in range(i + 1,R + 1):
		if ans > i*j % 2019:
			ans = i*j % 2019
			if ans == 0:
				break
print(ans)

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split())
ans = 1000000000
for i in range(L,R + 1):
	if ans == 0:
		break
		
	for j in range(i,R + 1):
		if ans > i*j % 2019:
			ans = i*j % 2019
			if ans == 0
				break
print(ans)
Problem p03047 (python)

Fixed submission:
a = list(map(int,input().split()))
print(a[0] - a[1] + 1)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
print(a - b + 1)
Problem p03416 (python)

Fixed submission:
a,b = map(str, input().split())
count = 0
num = a
sub = 0
line = int(b) - int(a) + 1

for i in range(line):
	if num[0] == num[4] and num[1] == num[3]:
		count = count + 1
	sub = int(num) + 1
	num = str(sub)
	
print(count)

Buggy submission (verdict: Runtime Error):
a,b = map(str, input().split())
count = 0
num = a
sub = 0
for i in range(a,b + 1):
	if num[0] == num[4] and num[1] == num[3]:
		count = count + 1
	sub = int(num) + 1
	num = str(sub)
	
print(count)
Problem p03543 (python)

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

Buggy submission (verdict: Runtime Error):
N=input()
if N[0]==N[1] and N[1]==N[2]:
	print("Yes")
elif N[2]==N[3] and N[3]==N[4]:
	print("Yes")
else:
	print("No")
Problem p03644 (python)

Fixed submission:
a = int(input())
c = 1

while (c <= a):
	c = c * 2

print(int(c/2))

Buggy submission (verdict: Runtime Error):
a = int(input())
c = 1

while (c <= a):
c = c * 2

print(int(c/2))
Problem p03000 (python)

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

count = 0
sum = 0

for i in range(len(l)):
  sum += l[i]
  if sum <= x:
    count+=1
print(count + 1)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
sum = 0

for i in range(len(l)):
  sum += l[i]
  if sum <= x
    count+=1
print(count + 1)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
sum = 0

for i in range(len(l)):
  sum += l[i]
  if sum < x
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
sum = 0

while sum <= x and count <= n:
  sum += l[count]
  count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
sum = 0

while sum <= x and count <= n + 1:
  sum += l[count]
  count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
sum = 0

while sum <= x or count == n + 1:
  sum += l[count]
  count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
sum = 0

while sum <= x or count == len(l) + 1:
  sum += l[count]
  count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
sum = 0

while sum <= x:
  sum += l[count]
  count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
sum = 0

while sum <= x:
  sum += l[count]
  count+=1
print(count + 1)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = int(input()).split()

count = 0
sum = 0

while sum <= x:
  sum += l[count]
  count+=1
print(count + 1)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = int(input().split())

count = 0
sum = 0

while sum <= x:
  sum += l[count]
  count+=1
print(count + 1)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = int(input().split())

count = 0
sum = 0

while sum <= x:
  sum += l[count]
  count++
print(count + 1)
Problem p03059 (python)

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

n = t // a
print(n * b)

Buggy submission (verdict: Runtime Error):
import functools
import fractions

N = int(input())
A = [int(i) for i in input().split()]

num = 1

if len(A) == 2:
  print(max(A))
else:
  for i in range(len(A)):
    g = functools.reduce(fractions.gcd, A[:i] + A[i+1:])
    num = g if g > num else num
  print(num)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
A = [int(i) for i in input().split()]

num = 1

if len(A) == 2:
  print(max(A))
else:
  for i in range(len(A)):
    B = A[ : i] + A[i + 1:]
    g = reduce(math.gcd, B)
    if (g > num):
      num = g
  print num

Buggy submission (verdict: Runtime Error):
import math
N = int(raw_input())
A = [int(i) for i in raw_input().split()]

num = 1

if len(A) == 2:
  print(max(A))
else:
  for i in range(len(A)):
    B = A[ : i] + A[i + 1:]
    g = reduce(math.gcd, B)
    if (g > num):
      num = g
  print num

Buggy submission (verdict: Runtime Error):
import functools
import math
N = int(input())
A = [int(i) for i in input().split()]
num = 1
for i in range(len(A)):
  B = A[:i] + A[i+1:]
  g = functools.reduce(math.gcd, B)
  if g > num:
    num = g    
print(num)
Problem p03062 (python)

Fixed submission:
import numpy as np

N = int(input())
A = [int(i) for i in input().split()]

ab = len([n for n in A if n <0]) % 2

B = np.sort(np.abs(A))
if ab == 0:
  print(sum(B))
else:
  print(sum(B[1 :]) - B[0])

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
A = [int(i) for i in input().split()]

ab = len([n for n in A if n <0]) % 2

B = np.sort(np.abs(A))
if ab == 0:
  print(sum(A))
else:
  print(sum(A[1 :] - A[0]))