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

Fixed submission:
N=int(input())
X=[list(map(int,input().split())) for i in range(N)]
X=sorted(X,key=lambda x:x[1])
s=0
t=0
for i in range(N):
  s+=X[i][0]
  if s>X[i][1]:
    print("No")
    break
  else:
    t+=1
if t==N:
  print("Yes")

Buggy submission (verdict: Runtime Error):
N=input()
X=[list(map(int,input().split())) for i in range(N)]
X=sorted(X,key=lambda x:x[1])
s=0
t=0
for i in range(N):
  s+=X[i][0]
  if s>X[i][1]:
    print("No")
    break
  else:
    t+=1
if t==N:
  print("Yes")
Problem p02999 (python)

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

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D.append(0)
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)
Problem p03000 (python)

Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D.append(0)
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D[0]=0
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+1):
  t=D[i-1]+L[i-1]
  D.append(t)
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+1):
  D.append((D[i-1]+L[i-1]))
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(len(D)):
  if D[j]<=X:
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D.append(0)
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=0
for j in D:
  if j<=X:
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
#i回目に跳ねる座標のリスト
D=[]
D.append(0)
for i in range(1,N+2):
  D.append(D[i-1]+L[i-1])
s=count(j for j in D if j<=X)
print(s)
Problem p03029 (python)

Fixed submission:
A,P=map(int,input().split())
c=(A*3+P)//2
print(c)

Buggy submission (verdict: Runtime Error):
A,P=map(int,input())
print((A*3+P)//2)
Problem p03087 (python)

Fixed submission:
N,Q=map(int,input().split())
S=input()
t=[0]*(N+1)
for i in range(N):
  t[i+1]=t[i]+(1 if S[i:i+2]=="AC" else 0)
for i in range(Q):
  l,r=map(int,input().split())
  print(t[r-1]-t[l-1])

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
t=[0]*N+1
for i in range(N):
  t[i+1]=t[i]+(1 if S[i:i+2]=="AC" else 0)
for i in range(Q):
  l,r=map(int,input().split())
  print(t[r-1]-t[l-1])

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
A=[0]*N+1
for i in range(N):
  t[i+1]=t[i]+(1 if S[i:i+2]=="AC" else 0)
for i in range(Q):
  l,r=map(int,input().split())
  print(t[r-1]-t[l-1])

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
l,r=[map(int,input().split()) for i in range(Q)]
for j in range(Q):
  print(S.count("AC",l[j],r[j]+1))

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
L=[]
R=[]
for i in range(Q):
  l,r=map(int,input().split())
  L.append(l)
  R.append(r)
for j in range(Q):
  print(str.count("AC",L[j].R[j]+1)

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
for i in range(Q):
  l,r=[list(map(int,input().split()))]
for j in range(Q):
  print(str.count("AC",l[j].r[j]+1)

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
for i in range(Q):
  l,r=list(map(int,input().split()))
for j in range(Q):
  print(str.count("AC",l[j].r[j]+1))

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=int(input())
l,r=[list(map(int,input().split())) for i in range(Q)]
for j in range(Q):
  print(str.count("AC",l[j].r[j]+1))

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
l,r=list(map(int,input().split())) for i in range(Q)
def main():
  for i in range(Q):
    T=S[l[i]:r[i]+1]
    c=T.count('AC')
    print(c)
main()
Problem p03103 (python)

Fixed submission:
N,M=map(int,input().split())
k=M
s=0
A=[list(map(int,input().split())) for i in range(N)]
A=sorted(A,key=lambda x:x[0])
while k>0:
  for i in range(N):
    if k>A[i][1]:
      s+=A[i][0]*A[i][1]
      k=k-A[i][1]
    else:
      s+=A[i][0]*k
      k=0
print(s)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]
A=sorted(A,key=lambda x:x[0])
cnt=0 #本数
ans=0 #値段
for i in range(N):
  cnt+=A[i][1]
  if cnt>=m:
    over=cnt-m
    ans+=over*A[i][0]
    cnt+=over
  else:
    ans+=A[i][0]*A[i][1]
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
k=M
s=0
A=[list(map(int,input().split())) for i in range(N)]
A=sorted(A,key=lambda x:x[0])
for i in range(N):
while k>0:
  for i in range(N):
    if k>A[i][1]:
      s+=A[i][0]*A[i][1]
      k=k-A[i][1]
    else:
      s+=A[i][0]*k
      k=0
print(s)
Problem p03160 (python)

Fixed submission:
N=int(input())
h=list(map(int,input().split()))
DP=[0]*N
DP[0]=0
DP[1]=abs(h[0]-h[1])
for i in range(1,N-1):
  DP[i+1]=min(DP[i]+abs(h[i]-h[i+1]),DP[i-1]+abs(h[i-1]-h[i+1]))
print(DP[N-1])

Buggy submission (verdict: Runtime Error):
N=int(input())
h=list(map(int,input().split()))
DP=[0]*N
DP[0]=0
DP[1]=abs(h[0]-h[1])
for i in raange(1,N-1):
  DP[i+1]=min(DP[i]+abs(h[i]-h[i+1]),DP[i-1]+abs(h[i-1]-h[i+1]))
print(DP[N-1])
Problem p03196 (python)

Fixed submission:
import collections
import math
N,P=map(int,input().split())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
c=collections.Counter(prime_factorize(P))
w=1
for i in c.keys():
  if c[i]>=N:
    k=math.floor(c[i]/N)
    w=w*(i**k)
  else:
    w=w
print(w)

Buggy submission (verdict: Runtime Error):
import collections
import math
N,P=map(int,input().split())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
c=collections.Counter(prime_factorize(P))
n=len(c.keys())
w=1
for i in c.keys():
  if c[i]>=N:
    k=math.ceil(c.values(i)/N)
    w=w*(i**k)
print(w)

Buggy submission (verdict: Runtime Error):
import collections
import math
N,P=map(int,input().split())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
c=collections.Counter(prime_factorize(P))
n=len(c.keys())
w=1
for i in c.keys():
  if c.values(i)>=N:
    k=math.ceil(c.values(i)/N)
    w=w*(i**k)
print(w)
Problem p03200 (python)

Fixed submission:
S=list(input())
N=len(S)
s=0
ans=0
for i  in range(N):
  if S[i]=="B":
    s+=1
  elif S[i]=="W":
    ans+=s
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
S=list(input())
c=collections.Counter(S)
n=c["W"]
s=0
i=0
while "B" in S[0:n]:
  if S[i]=="B" and S[i+1]=="W":
    S[i]="W" and S[i+1]="B"
    s+=1
    i=i
  else:
    i+=1
print(s)
Problem p03319 (python)

Fixed submission:
import math
N,K=map(int,input().split())
A=list(map(int,input().split()))
print(math.ceil((N-1)/(K-1)))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
print(math.ceil((N-1)/(K-1)))
Problem p03341 (python)

Fixed submission:
N=int(input())
S=input()
DP=[0]*N
l=0
for i,x in enumerate(S):
  DP[i]+=l
  if x=="E":
    l+=1
r=0
for i,y in enumerate(S[::-1]):
  DP[N-1-i]+=r
  if y=="W":
    r+=1
print(N-1-max(DP))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
DP=[0]*N
l=0
for i,x in enumerate(S):
  DP[i]+=l
    if S[i]=="W":
      l+=1
r=0
for j,y in enumerate(S[::-1]):
  DP[N-1-j]+=r
    if S[N-1-j]=="E":
      r+=1
print(min(DP))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
DP=[0]**N
DP[0]=S[1:].count("E")
for i in range(1,N):
  if S[i]=="E":
    DP[i]=DP[i-1]-1+S[:i].count("W")
  else:
    DP[i]=DP[i-1]+S[:i].count("W")
print(min(DP))
Problem p03425 (python)

Fixed submission:
N=int(input())
s=[]
for i in range(N):
  S=input()
  s.append(S)
m=0
a=0
r=0
c=0
h=0
for i in range(N):
  if s[i][0]=="M":
    m+=1
  if s[i][0]=="A":
    a+=1
  if s[i][0]=="R":
    r+=1
  if s[i][0]=="C":
    c+=1
  if s[i][0]=="H":
    h+=1
print(m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=[list(map(int,input().split())) for i in range(N)]
m=0
a=0
r=0
c=0
h=0
for i in range(N):
  if S[i][0]=="M":
    m+=1
  if S[i][0]=="A":
    a+=1
  if S[i][0]=="R":
    r+=1
  if S[i][0]=="C":
    c+=1
  if S[i][0]=="H":
    h+=1
print(m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h*a*c*h+r*c*h)
Problem p03471 (python)

Fixed submission:
N,Y=map(int,input().split())
for x in range(N+1):
  for y in range(N+1-x):
    z=N-x-y
    if 10000*x+5000*y+1000*z==Y:
      print(x,y,z)
      exit()
print(-1,-1,-1)

Buggy submission (verdict: Runtime Error):
N,Y=map(int,input().split())
for x in range(0,N+1):
  for y in range(N+1-x):
    for z in range(N+1-x-y):
      if 10000*x+5000*y+1000*z==Y:
        print(x,y,z)
        break
     else:
       print(-1,-1,-1)
Problem p03486 (python)

Fixed submission:
s=input()
t=input()
s_=sorted(s)
t_=sorted(t,reverse=True)
A=[]
A.append(s_)
A.append(t_)
B=sorted(A)
if B[0]==s_ and B[0]!=B[1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
s_=sorted(s,reverse=True)
t_=sorted(t)
A.append(s_)
A.append(t_)
B=sorted(A)
if B[0]=s_t:
  print("Yes")
else:
  print("No")
Problem p03487 (python)

Fixed submission:
import collections
N=int(input())
s=0
a=list(map(int,input().split()))
c=collections.Counter(a)
for i in  c.keys():
  if c[i]>i:
    s+=c[i]-i
  elif c[i]<i:
    s+=c[i]
print(s)

Buggy submission (verdict: Runtime Error):
import collections
N=int(input())
s=0
a=list(map(int,input().split()))
c=collections.Counter(a)
for i in  c.keys():
  if c.values(i)>i:
    s+=c.values(i)-i
  elif c.values(i)<i:
    s+=c.values(i)
print(s)
Problem p03612 (python)

Fixed submission:
N=int(input())
p=list(map(int,input().split()))
t=0
for i in range(N):
  if i!=N-1:
    if p[i]==i+1:
      s=p[i+1]
      p[i]=s
      p[i+1]=i+1
      t+=1
  else:
    if p[i]==i+1:
      u=p[i-1]
      p[i]=u
      p[i-1]=i+1
      t+=1
print(t)

Buggy submission (verdict: Runtime Error):
N=int(input())
p=list(map(int,input().split()))
t=0
for i in range(N):
  if i!=N:
    if p[i]==i+1:
      s=p[i+1]
      p[i]=s
      p[i+1]=i+1
      t+=1
  else:
    if p[i]==i+1:
      u=p[i-1]
      p[i]=u
      p[i-1]=i+1
      t+=1
print(t)

Buggy submission (verdict: Runtime Error):
N=int(input())
p=list(map(int,input().split()))
t=0
for i in range(N):
  if p[i]==i+1:
    s=p[i+1]
    p[i]=s
    p[i+1]=i+1
    t+=1
print(t)
Problem p03645 (python)

Fixed submission:
N,M=map(int,input().split())
x=[]
for i in range(M):
  a,b=map(int,input().split())
  if a==1:
    x.append(b)
  if b==N:
    x.append(a)
l=len(x)
if len(set(x))==l:
  print("IMPOSSIBLE")
else:
  print("POSSIBLE")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
u=0
for i in range(M):
  a,b=list(map(int,input().split()))
for i in range(M):
  if a[i]==1:
    s=b[i]
    idxlist=[]
    for idx,val in enumerate(a):
      if val==s:
        idxlist.append(idx)
    for j in idxlist:
      if b[j]!=N:
        u+=1
if u==len(idxlist):
  print("IMPOSSIBLE")
else:
  print("POSSIBLE")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[]
B=[]
for i in range(M):
  a,b=map(int,input().split())
  A.append(a)
  B.append(b)
u=0
k=A.count(1)
for i in range(M):
  if A[i]==1:
    s=B[i]
    t=A.index(B[i])
    if B[t]!=N:
      u+=1
if u==k:
  print("IMPOSSIBLE")
else:
  print("POSSIBLE")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[]
B=[]
C=[]
for i in range(M):
  a,b=map(int,input().split())
  A.append(a)
  B.append(b)
u=0
k=A.count(1)
for i in range(M):
  if A[i]==1:
    s=B[i]
    t=A.index(B[i])
    if B[t]!=N:
      u+=1
if u==k:
  print("IMPOSSIBLE")
else:
  print("POSSIBLE")
Problem p03681 (python)

Fixed submission:
N,M=map(int,input().split())
MOD=10**9+7
s=1
for i in range(2,N+1):
  s=(s*i)%MOD
t=1
for i in range(2,M+1):
  t=(t*i)%MOD
if abs(N-M)>1:
  print(0)
  exit()
if abs(N-M)==1:
  print((s*t)%MOD)
else:
  print((2*s*t)%MOD)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
MOD=10**9+7
s=1
for i in range(2,N+1):
  s=(s*i)%MOD
t=1
for i in range(2,M+1):
  t=(t*j)%MOD
if abs(N-M)>1:
  print(0)
  exit()
if abs(N-M)==1:
  print((s*t)%MOD)
else:
  print((2*s*t)%MOD)

Buggy submission (verdict: Runtime Error):
N.M=map(int,input().split())
MOD=10**9+7
s=1
for i in range(2,N+1):
  s=s*i
t=1
for j in range(2,N+1):
  t=t*j
if N-1==M:
  print((s*t)%MOD)
if N==M-1:
  print((s*t)%MOD)
if N==M:
  print((2*s*t)%MOD)
else:
  print(0)
Problem p02923 (python)

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

res=0
tres=0
prev=-1
for ai in a:
  if (prev<ai):
    res=max(res, tres)
    tres=0
  else:
    tres+=1
  prev=ai
res=max(res, tres)
print(res)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=map(int, input().strip())

res=0
tres=0
prev=-1
for ai in a:
  if (prev<ai):
    res=max(res, tres)
    tres=0
  else:
    tres+=1
print(res)
Problem p02924 (python)

Fixed submission:
n = int(input().strip())
print(((n-1)*n)//2)

Buggy submission (verdict: Runtime Error):
n = input()
print((n-1)*n/2)
Problem p02658 (python)

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

check = True
zero = False

for i in range(0,n):
    if a[i]==0:
        zero = True
        break;




for i in range(0,n):
    ans = ans*a[i]

    if ans>1000000000000000000:
        check = False
        break;




if zero:
    print(0)
else:
    if check:
        print(ans)
    else:
        print(-1)

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

check = True
zero = False

for i in a:
    ans = ans*i

    if i==0:
        zero = True
        break;

    if ans>1000000000000000000:
        check = False
        break;




if zero:
    print(0)
else:
    if check:
        print(ans)
    else:
        print(-1)
Problem p03067 (python)

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



if a[2]>a[0] and a[2]<a[1]:
    print("Yes")
elif a[1]<a[2] and a[2]<a[0]:
    print("Yes")
else:
    print("No")

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

if c>a and c<b:
    print("Yes")
else:
    print("No")

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

if c>a and c<b:
    print("Yes")
else:
    print("No")
Problem p02972 (python)

Fixed submission:
# coding: utf-8
# Your code here!

box_num = int(input())
ball_in_box_num_list = tuple([int(i), []] for i in input().split(" "))
for i in range(1, box_num + 1):
    k = 2
    while i * k <= box_num:
        ball_in_box_num_list[i * k - 1][1].append(i - 1)
        k += 1
ans_num = 0
ans_list = []
for i in range(box_num):
    a = box_num - 1 - i
    b = ball_in_box_num_list[a]
    if b[0] == 1:
        ans_num += 1
        ans_list.append(a + 1)
        for j in b[1]:
            ball_in_box_num_list[j][0] = 1 - ball_in_box_num_list[j][0]
print(ans_num)
if ans_list != 0:
    ans_list = [str(i) for i in ans_list]
    ans_list = ans_list[::-1]
    print(" ".join(ans_list))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

box_num = int(input())
ball_in_box_num_list = ([int(i), []] for i in input().split(" "))
for i in range(1, box_num + 1):
    k = 2
    while i * k <= box_num:
        ball_in_box_num_list[i * k - 1][1].append(i - 1)
        k += 1
ans_num = 0
ans_list = []
for i in range(box_num):
    a = box_num - 1 - i
    b = ball_in_box_num_list[a]
    if b[0] == 1:
        ans_num += 1
        ans_list.append(a + 1)
        for j in b[1]:
            ball_in_box_num_list[j][0] = 1 - ball_in_box_num_list[j][0]
print(ans_num)
if ans_list != 0:
    ans_list = [str(i) for i in ans_list]
    ans_list = ans_list[::-1]
    print(" ".join(ans_list))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

box_num = int(input())
ball_in_box_num_list = [[int(i), []] for i in input().split(" ")]
for i in range(1, box_num + 1):
    k = 2
    while i * k <= box_num:
        ball_in_box_num_list[i * k - 1][1].append(i - 1)
        k += 1
ans_num = 0
ans_list = []
for i in range(box_num):
    a = box_num - 1 - i
    b = ball_in_box_num_list[a]
    if b[0] == 1:
        ans_num += 1
        ans_list.append(a + 1)
        for j in b[1]:
            ball_in_box_num_list[j] = 1 - ball_in_box_num_list[j]
print(ans_num)
if ans_list != 0:
    ans_list = [str(i) for i in ans_list]
    ans_list = ans_list[::-1]
    print(" ".join(ans_list))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

box_num = int(input())
ball_in_box_num_list = [[int(i), []] for i in input().split(" ")]
for i in range(1, box_num + 1):
    k = 2
    while i * k <= box_num:
        ball_in_box_num_list[i * k - 1][1].append(i)
        k += 1
ans_num = 0
ans_list = []
for i in range(box_num):
    a = box_num - 1 - i
    b = ball_in_box_num_list[a]
    if b[0] == 1:
        ans_num += 1
        ans_list.append(a + 1)
        for j in b[1]:
            ball_in_box_num_list[j] = 1 - ball_in_box_num_list[j]
print(ans_num)
if ans_list != 0:
    ans_list = [str(i) for i in ans_list]
    ans_list = ans_list[::-1]
    print(" ".join(ans_list))
Problem p02981 (python)

Fixed submission:
human_num, train_value, taxi_num = tuple(int(i) for i in input().split(" "))
print(min(train_value * human_num, taxi_num))

Buggy submission (verdict: Runtime Error):
human_num, train_value, taxi_num = tuple(int(i) for i in input().split(""))
print(min(train_value * human_num, taxi_num))
Problem p02993 (python)

Fixed submission:
cord = list(input())
cord_len = len(cord)
for i in range(cord_len - 1):
    if cord[i] == cord[i + 1]:
        print("Bad")
        break
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
cord = list(input())
cord_len = len(cord)
for i in range(cord - 1):
    if cord[i] == cord[i + 1]:
        print("Bad")
        break
else:
    print("Good")
Problem p03037 (python)

Fixed submission:
ID_num, gate_num = tuple([int(i) for i in input().split(" ")])
min_list = []
max_list = []
for i in range(gate_num):
    min_ID, max_ID = tuple([int(i) for i in input().split(" ")])
    min_list.append(min_ID)
    max_list.append(max_ID)
M = min(max_list)
m = max(min_list)
if M >= m:
    print(min(max_list) - max(min_list) + 1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
ID_num, gate_num = tuple([int(i) for i in input().split(" ")])
min_list = []
max_list = []
for i in range(gate_num):
  	min_ID, max_ID = tuple([int(i) for i in input().split(" ")])
    min_list.append(min_ID)
    max_list.append(max_ID)
print(min(max_list) - max(min_list) + 1)

Buggy submission (verdict: Runtime Error):
ID_num, gate_num = tuple([int(i) for i in input().split(" ")])
min_list = []
max_list = []
for i in range(gate_num):
  	min_ID, max_ID = tuple([int(i) for i in input().split(" ")])
    min_list.append(min_ID)
    max_list.append(max_ID)
print(min(max_list) - max(min_list))
Problem p03071 (python)

Fixed submission:
a = [int(i) for i in input().split(" ")]
if a[0] == a[1]:
    print(2 * a[0])
else:
    print(2 * max(a) - 1)

Buggy submission (verdict: Runtime Error):
a = [int(i) for i in input().split("")]
if a[0] == a[1]:
    print(2 * a[0])
else:
    print(2 * max(a) - 1)
Problem p02811 (python)

Fixed submission:
n, x = map(int, input().split())
if x <= n*500:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n, x = int(input())
if x <= n*500:
    print("Yes")
else:
    print("No")
Problem p02883 (python)

Fixed submission:
N, K = map(int,input().split())
a_list = list(map(int, input().split()))
f_list = list(map(int, input().split()))

a_list.sort()
f_list.sort(key=lambda x :-x)

ng = -1
# 完食時間の最大はA=10**6, F=10**6の時。
ok = 10**12+1

def isok(x):
    # 最大の完食時間がxになるように修行する
    # その場合の修行回数の合計を求める
    # そしてそれがK回以下ならTrueを返す
    cnt = 0
    for a, f in zip(a_list,f_list):
        aprime = x // f
        cnt += max(a - aprime,0)
        
        if cnt > K:
            return False
    return True

while abs(ok-ng)>1:
    x = (ok+ng) // 2
    
    if isok(x):
        # train_cntが限界より多い場合、目指す最大の完食時間が短すぎる
        # よって完食時間を増やすべき
        # Kに等しい場合ももしかしたらもっといい
        ok = x
    else:
        ng = x
        
        
print(ok)

Buggy submission (verdict: Runtime Error):
ng = -1
# 完食時間の最大はA=10**6, F=10**6の時。
ok = 10**12+1

def isok(x):
    # 最大の完食時間がxになるように修行する
    # その場合の修行回数の合計を求める
    # そしてそれがK回以下ならTrueを返す
    cnt = 0
    for a, f in zip(a_list,f_list):
        aprime = x // f
        cnt += max(a - aprime,0)
        
        if cnt > K:
            return False
    return True

while abs(ok-ng)>1:
    x = (ok+ng) // 2
    
    if isok(x):
        # train_cntが限界より多い場合、目指す最大の完食時間が短すぎる
        # よって完食時間を増やすべき
        # Kに等しい場合ももしかしたらもっといい
        ok = x
    else:
        ng = x
        
    print(ok,ng, train_cnt)

        
print(ok)