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

Fixed submission:

def swap(a ,b):
    x = 0
    x = a
    a = b
    b = x
    return a,b


str_number_list = input().split()
X = str_number_list[0]  #A
Y = str_number_list[1]  #B
Z = str_number_list[2]  #C

# swap(A,B)
X , Y = swap(X,Y)
#swap(A,C)
X,Z = swap(X,Z)
print("%s %s %s" % (X,Y,Z))

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

def divisior(n):
    a = []
    i = 1
    while (i*i <= n):
        if n%i == 0:
            a.append(i)
            if (i*i == n): continue
            a.append(n//i)
        i += 1

    return a

ans = 0
a = divisior(n)

for x in a:
    if x == 1: continue
    tmp = n
    while (tmp%x == 0): tmp = tmp//x
    if (tmp%x == 1) : ans += 1

b = divisior(n-1)

ans = ans + len(b) -1

print(ans)

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

def divisior(n):

    a = []
    i = 1

    while (i*i <= n):
        if n%i == 0:
            a.append(i)
            if (i*i == n): continue
            a.append(int(n/i))
        i += 1

    return a

ans = 0
a = divisior(n)

for x in a:
    if x == 1: continue
    tmp = n
    while (tmp%x == 0): tmp /= x
    if (tmp%x == 1) : ans += 1

b = divisior(n-1)

ans = ans + len(b) -1

print(ans)
Problem p02722 (python)

Fixed submission:
n = int(input())

def divisior(n):
    a = []
    i = 1
    while (i*i <= n):
        if n%i == 0:
            a.append(i)
            if (i*i != n): a.append(n//i)
        i += 1
    return a

ans = 0
a = divisior(n)

for x in a[1:]:
    tmp = n
    while (tmp%x == 0): tmp = tmp//x
    if (tmp%x == 1) : ans += 1

b = divisior(n-1)

ans = ans + len(b) -1

print(ans)

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

def divisior(n):
    a = []
    i = 1
    while (i*i <= n):
        if n%i == 0:
            a.append(i)
            if (i*i != n): a.append(n//i)
        i += 1

    return a

ans = 0
a = divisior(n).sort()

for x in a[1:]:
    tmp = n
    while (tmp%x == 0): tmp = tmp//x
    if (tmp%x == 1) : ans += 1

b = divisior(n-1)

ans = ans + len(b) -1

print(ans)
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
while n > abs(n - k):
    n = abs(n - k)
print(n)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split(" "))
print("{} {} {}".format(c, a, b)

Buggy submission (verdict: Runtime Error):
a, b, c = input().split(" ")
print("{} {} {}".format(c, a, b)

Buggy submission (verdict: Runtime Error):
a, b, c = input().sprit(" ")
temp = a
a = b
b = temp
temp = a
a = c
c = temp
print("{} {} {}".format(a, b, c)
Problem p02783 (python)

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

def attack(l):
    H = l[0]
    A = l[1]
    cnt = 0
    while H > 0:
        H -= A
        cnt += 1
    return cnt

print(attack(l))

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

H  int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

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

H = int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
if result <= 0:
    rint("Yes")
else:
    rint("No")

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

H = int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
if result <= 0:
    rint("Yes")
else:
    rint("No")

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

H = int(l1[0])
N = int(l1[1])
A = int(sum(l2))
break
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

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

print(l1)
H = int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

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

H = int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
print(A)
if result <= 0:
    print("Yes")
else:
    print("No")

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

H = int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

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

H = l1[0]
N = l1[1]
A = sum(l2)
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

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

H = l1[0]
N = l1[1]
A = sum(l2)
result = H - A
if result >0:
    print("No")
else:
    print("Yes")

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

def attack2(l1, l2):
    H = l1[0]
    N = l1[1]
    A = sum(l2)
    result = H - A
    if result >0:
        return "No"
    else:
        return "Yes"
      
print(attack2(l1, l2))

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

def attack2(l1, l2):
    H = l1[0]
    N = l1[1]
    A = sum(l2)
    result = H - A
    if result >0:
        return "No"
    else:
        return "Yes"
      
print(attack2(l1, l2))

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

def attack(l):
    H = l[0]
    A = l[1]
    cnt = 0
    while H >= 0:
        H = H - A
        cnt += 1
    return cnt

print(cnt)
Problem p02784 (python)

Fixed submission:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
 
H = int(l1[0])
A = int(sum(l2))
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
 
H  int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l1 = list(map(int, input().split()))
def attack2(l1):
    H, N= l1[0], l1[1]
    v = 0
    for i in range(2, N):
        v += l1[i]
    result = H - v
    if result >0:
        return "no"
    else:
        return "yes"
print(attack2(l1))
Problem p02717 (python)

Fixed submission:
input_arr = input("").split(" ")
a, b, c = map(str, input_arr)

print(c + " " + a + " " + b)

Buggy submission (verdict: Runtime Error):
# Sample Input:
# 4 1
# 5 4 2 1
# total votes = 12
# 1/4M * 12 = 1/4 * 12 = 3, can't select item < 3

first_input = input("").split(" ")
N, M = map(int, first_input)
items = input("")

items = items.split(" ")
total_votes = list(map(float, items))

total_votes = sum(total_votes)

min_N = total_votes * ( 1.0 / (4.0 * M) )

if(N < min_N):
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
input_arr = input("").split(" ")
a, b, c = map(str, input_arr)

print(f"{c} {a} {b}")

Buggy submission (verdict: Runtime Error):

input_arr = input("").split(" ")
a, b, c = map(str, input_arr)

print(f"{c} {a} {b}")

Buggy submission (verdict: Runtime Error):

a = ""
b = ""
c = ""

a = input("")
b = input("")
c = input("")

return [b, c, a]

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

return [a, b ,c]

Buggy submission (verdict: Runtime Error):
# a b c
# b a c
# b c a


function abcSwap(arr):
  arr[0], arr[1] = arr[1], arr[0]
  arr[1], arr[2] = arr[2], arr[1]
  return arr
Problem p02717 (python)

Fixed submission:
n = list(map(int,input().split()))
print(n[2],n[0],n[1])

Buggy submission (verdict: Runtime Error):
def resolve():
  a, b, c = map(int, input().split())
 
    temp_a = a
    temp_b = b
    a = temp_b
    b = temp_a
    temp_c = c
    temp_a = a
    c = temp_a
    a = temp_c
    print(a, b, c)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
 
    temp_a = a
    temp_b = b
    a = temp_b
    b = temp_a
    temp_c = c
    temp_a = a
    c = temp_a
    a = temp_c
    print(a, b, c)
Problem p02783 (python)

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

if H%A==0:
  print(H//A)
else:
  print(H//A+1)

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

if sum(A)>=H:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
H,N = map(int,input().split())
A = list(map(int,input().split()))
s = sum (A)
if s>=H:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
H,N = map(int,input().split())
A = list(map(int,input().split()))
if sum(A)>=H:
  print("Yes")
else:
  print("No")
Problem p02784 (python)

Fixed submission:
H,N = map(int,input().split())
A = list( map(int,input().split()))
if sum(A)>=H:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H,N = map(int,input().split())
A = list(map(int,input().split()))
if sum(A)>=H:
  print(Yes)
else:
  print(No)
Problem p02789 (python)

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

if (N==M):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
M = int(input())
if N==M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
M = int(input())
print("Yes") if N==M else print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
M = int(input())
if N==M:
  print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
M = int(input())
if N == M:
  print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
int N= input()
int M = input()
if (N==M):
 		 print("Yes")
 	else:
      print("No")
Problem p03086 (python)

Fixed submission:
S = input()

count = 0
C = []
for i in range(len(S)):
  C.append(count)
  count = 0
  if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
    count += 1
    if(i == len(S)-1):
      C.append(count)
      break
    for j in range(i+1,len(S)):
      if S[j] == "A" or S[j] == "C" or S[j] == "G" or S[j] == "T":
        count += 1
      else: break

print(max(C))

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

count = 0
C = []
for i in list(S):
  if i == "A" or i == "C" or i == "G" or i == "T":
    count += 1
  else:
    C.append(count)
    count = 0

print(max(C))
Problem p03425 (python)

Fixed submission:
N=int(input())
T=[0]*5
for i in range(N):
    S=input()
    if S[0]=="M": T[0]+=1
    elif S[0]=="A": T[1]+=1
    elif S[0]=="R": T[2]+=1
    elif S[0]=="C": T[3]+=1
    elif S[0]=="H": T[4]+=1

ans=0
for i in range(5):
    for j in range(i+1,5):
        for k in range(j+1,5):
            ans+=T[i]*T[j]*T[k]
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N=int(input())
S=[]
T=[]
m=a=r=c=h=0
for i in range(N):
    S.append(list(input()))
    if S[i][0]=="M" or S[i][0]=="A" or S[i][0]=="R" or S[i][0]=="C" or S[i][0]=="H":
        T.append(S[i][0])
K=set(T)
P=[]
for i in K:
    P.append(T.count(i))
if P==[]: ans=0
else: ans=math.factorial(sum(P))//(6*math.factorial(sum(P)-3))

for i in range(len(P)):
    if P[i]>2:
        ans-=(math.factorial(P[i])//6)*(len(P)-1)
    if P[i]>1:
        ans-=(math.factorial(P[i])//2)*(len(P)-1)

print(ans)

Buggy submission (verdict: Runtime Error):
import math

N=int(input())
S=[]
T=[]
m=a=r=c=h=0
for i in range(N):
    S.append(list(input()))
    if S[i][0]=="M" or S[i][0]=="A" or S[i][0]=="R" or S[i][0]=="C" or S[i][0]=="H":
        T.append(S[i][0])
K=set(T)
P=[]
for i in K:
    P.append(T.count(i))
if P==[]: ans=0
else: ans=math.factorial(sum(P))//(6*math.factorial(sum(P)-3))

for i in range(len(P)):
    if P[i]>2:
        ans-=(math.factorial(P[i])//6)*(len(P)-1)
    if P[i]>1:
        ans-=math.factorial(P[i])//2*(len(P)-1)

print(ans)
Problem p03457 (python)

Fixed submission:
N=int(input())

t=x=y=0
judge=True
for i in range(N):
    in_t,in_x,in_y=map(int,input().split())
    dt=in_t-t
    dxy=abs(in_x-x)+abs(in_y-y)
    if dxy>dt or (dxy-dt)%2!=0: judge=False
    t=in_t
    x=in_x
    y=in_y

if judge: print("Yes")
else: print("No")

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

T=[]
X=[]
Y=[]
for i in range(N):
    t,x,y=map(int, input().split())
    T.append(t)
    X.append(x)
    Y.append(y)

flag=0
for i in range(N):
    if i==0:
        if T[i]<X[i]+Y[i] or (X[i]!=0 and Y[i]!=0 and T[i]%(X[i]+Y[i])!=0):
            flag=1
            break
        if (X[i]==Y[i]==0 and T[i]%2!=0) or (((X[i]==1 and Y[i]==0) or (X[i]==0 and Y[i]==1)) and T[i]%2!=1):
            flag=1
            break
    else:
    if T[i]-T[i-1]<(X[i]-X[i-1])+(Y[i]-Y[i-1]) or (X[i]-X[i-1]!=0 and Y[i]-Y[i-1]!=0 and T[i]-T[i-1]%((X[i]-X[i-1])+(Y[i]-Y[i-1]))!=0):
        flag=1
        break
    if (X[i]-X[i-1]==Y[i]-Y[i-1]==0 and T[i]%2!=0) or (((X[i]-X[i-1]==1 and Y[i]-Y[i-1]==0) or (X[i]-X[i-1]==0 and Y[i]-Y[i-1]==1)) and T[i]-T[i-1]%2!=1):
        flag=1
        break

if flag==0:
    print("Yes")
else:
    print("No")

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

T=[]
X=[]
Y=[]
for i in range(N):
    t,x,y=map(int, input().split())
    T.append(t)
    X.append(x)
    Y.append(y)

flag=0
for i in range(N):
    # １回目はそのままの数
    if i==0:
    # 数的に無理
        if T[i]<X[i]+Y[i] or (X[i]!=0 and Y[i]!=0 and T[i]%(X[i]+Y[i])!=0):
            flag=1
            break
    # (0,0)にいれるのはt偶数の時だけ,(1,0)(0,1)にいれるのは奇数の時だけ
        if (X[i]==Y[i]==0 and T[i]%2!=0) or (((X[i]==1 and Y[i]==0) or (X[i]==0 and Y[i]==1)) and T[i]%2!=1):
            flag=1
            break
    # 数的に無理
    else:
    if T[i]-T[i-1]<(X[i]-X[i-1])+(Y[i]-Y[i-1]) or (X[i]-X[i-1]!=0 and Y[i]-Y[i-1]!=0 and T[i]-T[i-1]%((X[i]-X[i-1])+(Y[i]-Y[i-1]))!=0):
        flag=1
        break
    # 前回と同じとこにとどまれるのは偶数の時だけ
    if (X[i]-X[i-1]==Y[i]-Y[i-1]==0 and T[i]%2!=0) or (((X[i]-X[i-1]==1 and Y[i]-Y[i-1]==0) or (X[i]-X[i-1]==0 and Y[i]-Y[i-1]==1)) and T[i]-T[i-1]%2!=1):
        flag=1
        break

if flag==0:
    print("Yes")
else:
    print("No")
Problem p03479 (python)

Fixed submission:
X,Y = map(int, input().split())

i=1
A=[]
A.append(X)

while(1):
    T=A[i-1]*2
    if T<=Y:
        A.append(T)
    elif T>Y:
        break
    i+=1

print(len(A))

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split())
t=X
for i in range(1,X*Y):
    if t*2>Y: break
    else:
        t*=2

print(i)
Problem p03485 (python)

Fixed submission:
import math

a,b = map(int, input().split())

T = math.ceil((a+b)/2)

print(T)

Buggy submission (verdict: Runtime Error):
def compare(a, A):
    R=0
    for i in range(0, len(A)):
        if(a==A[i]):
            R+=1
        elif(a<A[i]):
            break
    return R

def result(R,a):
    if(R==a):
        return 0
    elif(a<R):
        return R-a
    return R

N = int(input())

a = list(map(int, input().split()))
a.sort()

R=0
T=compare(a[0],a)
R+=result(T,a[0])

for i in range(1, N):
    if(a[i] != a[i-1]):
        C=compare(a[i],a[T:])
        R+=result(C,a[i])
        T+=C

print(R)

Buggy submission (verdict: Runtime Error):
def compare(a, A):
    R=0
    for i in range(0, len(A)):
        if(a==A[i]):
            R+=1

    if(R==a):
        return 0
    elif(a<R):
        return R-a
    return R

N = int(input())

a = list(map(int, input().split()))
a.sort()

R=0
R+=compare(a[0],a)

for i in range(1, N):

    if(a[i] != a[i-1]):
        R+=compare(a[i],a)

print(R)
Problem p03547 (python)

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

if a<b:
    print('<')
elif a>b:
    print('>')
else:
    print('=')

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

if a<b:
    print('<')
elif a>b:
    print('>')
else:
    print('=')
Problem p03777 (python)

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

if (a=="H" and b=="H") or (a=="D" and b=="D"):
    print("H")
else:
    print("D")

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

if (a="H" and b="H") or (a="D" and b="D"):
    print("H")
else:
    print("D")
Problem p04044 (python)

Fixed submission:
N,L=map(int,input().split())
S=[input() for i in range(N)]

T=[]
for i in range(N):
    s=min(S)
    T.append(s)
    S.pop(S.index(s))

Ts=""
for i in range(len(T)):
    Ts+=T[i]

print(Ts)

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[input() for i in range(N)]


Ts=""
T=[]
for j in range(L):
    t=j
    for i in range(N):
        if t==L: t=0
        Ts+=S[t]
        t+=1
    T.append(Ts)
    Ts=""

print(min(T))
Problem p02717 (python)

Fixed submission:
lst = list(map(int, input().split()))
print(lst[2], lst[0], lst[1])

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print(c, b, a)
Problem p02718 (python)

Fixed submission:
n,m = map(int,input().split())
s = list(map(int,input().split()))
s.sort(reverse = True)
s1 = s[:m]
if(s1[-1]<sum(s)/(4*m)):
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n, m = map(int,input().strip().split())
lst = list(map(int, input().split()))
summ = 0
for i in lst:
    summ += i
# print(summ)
sol = 1/(m * 4)
# print(sol)
res = sol*summ
# print(res)
if lst[m] > res:
    print("YES")
else:
    print("NO")
Problem p02939 (python)

Fixed submission:
s = input()
it=0
con = 1
while it+1 < len(s):
	if s[it] == s[it+1]:
		if it + 2 == len(s):
			it += 2
			con += 0
		elif it + 3 == len(s):
			it += 3
			con += 1
		else:
			it += 3
			con += 2
	else:
		it += 1
		con += 1
print(con)

Buggy submission (verdict: Runtime Error):
s = input()
it=0
con = 1
while it+1 < len(s):
	if s[it] == s[it+1]:
		if it + 2 == len(s):
			it += 2
			con += 0
		elif it + 3 == len(s):
			it += 3
			con += 1
        else:
			it += 3
			con += 2
	else:
		it += 1
		con += 1
print(con)
Problem p02946 (python)

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

print(" ".join(list(map(str,range(b-a+1,b+a)))))

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

print(" ".join(list(range(x-k+1,x+k-1))))
Problem p02947 (python)

Fixed submission:
n = int(input())

ss = []
for i in range(n):
	ss.append(sorted(str(input())))

sm = sorted(ss)
c = 0
ans = 0
for i in range(n-1):
	if sm[i] == sm[i+1]:
		c += 1
		ans += c
	else:
		c = 0
print(ans)

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

s = []
ss = []
for i in range(n)
	s.append(str(input()))
  	ss.append(sorted(str(input())))
  
c = 0
for i in range(n)
	for l in range(i+1,n)
  		if ss[i] == ss[l]:
      		c += 1
print(c)
Problem p02969 (python)

Fixed submission:
r = int(input())

print(3*r**2)

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

print(3r^2)
Problem p02981 (python)

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

if l[0] * l[1] > l[2]:
  print(l[2])
else:
  print(l[0] * l[1])

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

print(max(A*N,B))
Problem p02988 (python)

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

c = 0
for i in range(1,n-1):
  if p[i-1] < p[i] and p[i] < p[i+1]:
  	c += 1
  elif p[i+1] < p[i] and p[i] < p[i-1]:
    c += 1
  else:
    pass

print(c)

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

c = 0
for i in range(1,n+1):
  if p[i-1] < p[i] and p[i] < p[i+1]:
  	c += 1
  elif p[i+1] < p[i] and p[i] < p[i-1]:
    c += 1
  else:
    pass

print(c)
Problem p03000 (python)

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

l = list(map(int,input().split()))

k = 0
s = []
for i in range(n):
  k += l[i]
  s.append(k)

c = 0
for i in s:
  if i <= x:
    c += 1

print(c+1)

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

l = list(map(int,input().split()))

k = []
s = []
for i in range(n):
  k[i] += l[i]
  s[i] = k[i]

c = 0
for i in s:
  if i <= x:
    c += 1

print(c)
Problem p03030 (python)

Fixed submission:
n = int(input())

s = []
for i in range(n):
	S,P=input().split()
	s.append([S,-int(P),i+1])

ans = sorted(s,key=lambda x : (x[0],x[1]))

for a in ans:
  print(a[2])

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

s = []
for i in range(n):
	S,P=input().split()
    s.append(S,int(P),i+1)

ans = sorted(s,key=lambda x : (x[0],x[1]))

for a in ans:
  print(a[2])

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

s = []
for i in range(n):
	s.append(list(input().split()) + i+1)

for i in range(n):
	s[i][1] = int(s[i][1])

ans = sorted(s,key=lambda x : (x[0],x[1]))

for a in ans:
  print(a[2])
Problem p03037 (python)

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

ll=[]
rr =[]
for i in range(m):
	l,r = map(int,input().split())
	ll.append(l)
	rr.append(r)

an = min(rr)-max(ll)+1
if an >0:
	print(an)
else:
	print(0)

Buggy submission (verdict: Runtime Error):
n,m = map(int,(input().split())
          
l=[]
for i in range(m):
	l,r = map(int,input().split())
    li = range(l,r)

for i in li:
	print(i)
Problem p03060 (python)

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


getsum = 0
for i in range(n):
	profit = v[i]-c[i]
	if profit > 0:
		getsum += profit
		

print(getsum)

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


getsum = 0
for i in range(n):
	profit = v[i]-c[i]
	if profit > 0:
		getsum += profit
		

print(getsum)
Problem p03068 (python)

Fixed submission:
n = int(input())
s = list(input())
k = int(input())
 
 
for i in range(0,n):
  if s[i] != s[k-1]:
    s[i] = '*'

s = "".join(s)
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())


for i in range(0,n):
  if s[i] != s[k-1]:
    s[i] = '*'

print(s)
Problem p03086 (python)

Fixed submission:
s = input()

c = 0
m = 0
for i in s:
	if i in 'ACGT':
		c += 1
		m = max(c,m)
	else:
		c = 0

print(m)

Buggy submission (verdict: Runtime Error):
s = input()

c = 0
m = 0
for i in s:
	if s in 'ACGT':
		c += 1
		m = max(c,m)
    else:
		c = 0

print(m)
Problem p03102 (python)

Fixed submission:
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
count = 0
for i in range(n):
	a = list(map(int,input().split()))
	tokuten = 0
	for j in range(m):
		tokuten += b[j]*a[j]
	if tokuten > -c:
		count += 1

print(count)

Buggy submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
#a = []
count = 0
for i in range(n):
	a = list(map(int,input().split()))
    tokuten = 0
	for j in range(m):
		tokuten += b[j]*a[j]
	if tokuten > c:
		count += 1

print(count)
Problem p03371 (python)

Fixed submission:
a,b,c,x,y = map(int,input().split())
if x > y:
	z = a
else:
	z = b

ans1 = min(x,y) * min(a + b,c*2) + abs(x-y) * z
ans2 = c * max(x,y) * 2
print(min(ans1,ans2))

Buggy submission (verdict: Runtime Error):
a,b,c,x,y = map(int,input().split())
if x > y:
	z = a
else:
	z = b

ans1 = min(x,y) * min(a + b,c*2),abs(x-y) * z
ans2 = c * max(x,y)
print(min(ans1,ans2))

Buggy submission (verdict: Runtime Error):
a,b,c,x,y = map(int,input().split())
if x > y:
	z = a
else:
	z = b

ans1 = min(x,y) * min(a + b,c*2),abs(x-y) * z
ans2 = c * max(x,y)
print(min(ans1,ans2)
Problem p03694 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
mi,ma = 100000,0
for i in a:
	mi = min(mi,i)
	ma = max(ma,i)
print(ma-mi)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
mi = 0
for i in a:
	mi = min(m,i)
	ma = max(m,i)
print(ma-mi)
Problem p02784 (python)

Fixed submission:
h, n = map(int, input().split())
a = list(map(int, input().split()))
if sum(a) >= h:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
h, n = map(int, input().split())
a = [int(input()) for _ in range(n)]
s = sum(a)
if s >= h:
  print("Yes")
else:
  print("No")