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

Fixed submission:
num =int(input())
value = list(map(int, input().split()))
value.sort()
if num == 2:
  answer = value[1]
else:
  cnt = 0
  for i in range(0, num):
      if value[i]%(value[1])!=0:
        cnt += 1
        if cnt == 2:
          break
  if cnt == 1:
    answer = value[1]
  elif cnt == 0:
    answer = value[0]
  else:
    for i in range (0, value[0]):
      cnt = 0
      for j in range(0, num):
        if value[j]%(value[0]-i)!=0:
          cnt += 1
          if cnt == 2:
            break
      if cnt == 1 or cnt == 0:
        answer = value[0] - i
        break
print(answer)

Buggy submission (verdict: Runtime Error):
num =int(input())
value = list(map(int, input().split()))
value.sort()
if num == 2:
  answer = value[1]
else:
  cnt = 0
  for i in range(0, num):
      if value[i]%(value[1])!=0:
        cnt += 1
        if cnt == 2:
          break
  if cnt == 1:
    answer = value[1]
  elif cnt == 0:
    answer = value[0]
  else:
    for i in range (0, value[0]):
      cnt = 0
      for j in range(0, num):
        if value[j]%(value[0]-i)!=0:
          cnt += 1
          if cnt == 2:
            break
      if cnt == 1:
        answer = value[0] - i
        break
print(answer)
Problem p02658 (python)

Fixed submission:
def main():
    lim = 1e18
    n = int(input())
    nums = list(map(int,str(input()).split(" ")))
    if 0 in nums:
        print(0)
        return
    ans = 1
    for num in nums:
        ans *= num
        if ans > lim:
            print(-1)
            return
    print(ans)
    return

main()

Buggy submission (verdict: Runtime Error):
lim = 1e18
n = int(input());
nums = list(map(int,str(input()).split(" ")))
ans = 1
for num in nums:
  	if num == 0:
    	print(0)
        quit()
    ans *= num
if ans > lim:
    print(-1)
else:
    print(int(ans))

Buggy submission (verdict: Runtime Error):
lim = 1e18
n = int(input());
nums = list(map(int,str(input()).split(" ")))
ans = 1
for num in nums:
	ans *= num
    if ans > lim:
    	break
if ans > lim:
	print(-1)
else:
	print(int(ans))

Buggy submission (verdict: Runtime Error):
lim = 1e18
n = int(input());
nums = list(map(int,str(input()).split(" ")))
ans = 1
for num in nums:
	if ans <= lim:
    	ans *= num
if ans > lim:
    print(-1)
else:
    print(int(ans))
Problem p02687 (python)

Fixed submission:
s = str(input())
if(s[1] == 'B'):
  print('ARC')
else:
  print('ABC')

Buggy submission (verdict: Runtime Error):
d = {'B':'R', 'R':'B'}
s = str(input())
s[1] = d[s[1]]
print(s)
Problem p02658 (python)

Fixed submission:
def main ():
	n = int(input())
	a = list(map(int,input(). split ()))
    
	if 0 in a:
		print(0)
		return
	prod = 1
	for i in a:
		prod *= i
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)
main ()

Buggy submission (verdict: Runtime Error):
p = 1
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	p *= a[i]
    if p > 10**18:
      return -1
    
return p
Problem p02677 (python)

Fixed submission:
import math as mt
a, b, h, m = map(int, input().split())
hd = h*30
md = m*6
hd += md/12
d = abs(hd - md)
cd = mt.cos(d* mt.pi/180)
print(round(mt.sqrt(a*a + b*b - 2*a*b*cd), 20))

Buggy submission (verdict: Runtime Error):
import math as m
a, b, h, m = map(int, input().split())
hd = h*30
md = m*6
hd += md//12
d = abs(hd - md)
cd = m.cos(d* m.pi//180)
print(round(m.sqrt(a*a + b*b - 2*a*b*cd)), 20)
Problem p02705 (python)

Fixed submission:
r = int(input())
print( 2* 22/7 * r)

Buggy submission (verdict: Runtime Error):
print(int(input)* 22/7)
Problem p02690 (python)

Fixed submission:
import sys
X = int(input())
for i in range(-120,120):
  for j in range(-120,120):
    if i**5 - j **5 == X:
      print(str(i)+" "+str(j))
      sys.exit()

Buggy submission (verdict: Runtime Error):
def solve():
  X = int(input())

  for i in range(abs(X)):
    ii = i**5
    b = (X - ii)**(0.5**5)
    bb = b **5
    # print("A   " + str(i) +"   "+  str(i ** 5))
    # print("B   " + str(b) +"   "+str(b**5))
    # print(i+b)
    if bb.is_integer():
      if ii - bb== X:
        return str(i) +" " + str(bb)
      else:
        return str(i) +' ' + str(int(-1*bb))


def main():
  print(solve())

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def solve():
  X = int(input())

  for i in range(int(X ** 0.5)):
    ii = i**5
    b = (X - ii)**(0.5**5)
    bb = b **5
    # print("A   " + str(i) +"   "+  str(i ** 5))
    # print("B   " + str(b) +"   "+str(b**5))
    # print(i+b)
    if bb.is_integer():
      if ii - bb== X:
        return str(i) +" " + str(bb)
      else:
        return str(i) +' ' + str(int(-1*bb))


def main():
  print(solve())

if __name__ == "__main__":
    main()
Problem p02885 (python)

Fixed submission:
A,B=map(int,input().split())
if A<=B*2:
    print(0)
else:
    print(A-B*2)

Buggy submission (verdict: Runtime Error):
import fractions
import bisect
import math

mod=1000000007
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
A.sort(key=lambda x: x[1])


A,B=map(int,input().split())

for i in range(N):
    A,B=map(int,input().split())
    B.append([A,B])

for i in reversed(range(N)):
print(B[i], end="")

B=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

math.ceil()   #切り上げ
math.floor()  #切り捨て

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

bisect.bisect_left(a,x)
Problem p02900 (python)

Fixed submission:
def prime_decomposition(n): #素因数分解でリストを返す
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

A, B = map(int, input().split())

C=prime_decomposition(A)
D=prime_decomposition(B)
E=list(set(C)&set(D))
print(len(E)+1)

Buggy submission (verdict: Runtime Error):
def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

def primes(n): #エラストテネスの篩
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

A, B = map(int, input().split())
F=primes(max(A,B)//2)
C=divisor(A)
C.sort()
D=divisor(B)
D.sort()
a=0
b=0

E=list(set(C)&set(D))
G=list(set(E)&set(F))
print(len(G)+1)
Problem p02972 (python)

Fixed submission:
def make_divisors(n):
    #divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            B[i]+=1
            if i != n // i:
                B[n//i]+=1

    # divisors.sort()
    #return divisors

N=int(input())
A=list(map(int,input().split()))

B=[0]*300000
C=[]
count=0
for i in reversed(range(N)):
    if B[i+1]%2!=A[i]:
        make_divisors(i+1)
        count +=1
        C.append(i+1)
print(count)
#print(B)
if count!=0:
    for i in reversed(range(1,count)):
        print(str(C[i])+" ",end="")
    print(C[0], end="")

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    #divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            B[i]+=1
            if i != n // i:
                B[n//i]+=1

    # divisors.sort()
    #return divisors

N=int(input())
A=list(map(int,input().split()))

B=[0]*3000000
C=[]
count=0
for i in reversed(range(N)):
    if B[i]%2!=A[i]:
        make_divisors(i+1)
        count +=1
        C.append(i+1)
print(count)
if count!=0:
    print(C[0],end="")
    for i in range(1,count):
        print(" "+str(C[i]),end=""

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            B[i]+=1
            if i != n // i:
                B[n//i]+=1

    # divisors.sort()
    return divisors

N=int(input())
A=list(map(int,input().split()))

B=[0]*3000000
C=[]
count=0
for i in reversed(range(N)):
    if B[i]%2!=A[i]:
        make_divisors(i+1)
        count +=1
        C.append(i+1)
print(count)
if count!=0:
    print(C[0],end="")
    for i in range(1,count):
        print(" "+C[i],end="")
Problem p02995 (python)

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


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


E = C * D // gcd(C, D)
total = 0

total += B // C - (A-1) // C


total += B // D - (A-1) // D


total = total - B // E + (A-1) // E

print(B - A + 1 - total)

Buggy submission (verdict: Runtime Error):

A,B,C,D = map(int, input().split())

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

E=C*D//gcd(C,D)
total=0
if A%C==0 and A>=C:
    total += B//C-A//C+1
else:
    total += B // C - A // C

if A%D==0 and A>=D:
    total += B//D-A//D+1
else:
    total += B // D - A// D

if A%E==0 and A>=E:
    total = total- B//E-A//E+1
else:
    total = total - B // E - A // E

print(B-A+1-tot

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = map(int, input().split())
E=C*D//math.gcd(C,D)
total=0
if A%C==0:
    total += B//C-(A)//C+1
else:
    total += B // C - (A) // C

if A%D==0:
    total += B//D-(A-1)//D+1
else:
    total += B // D - (A - 1) // D

if A%E==0:
    total = total- B//E-A//E+1
else:
    total = total - B // E - A // E

print(B-A+1-total)
Problem p02996 (python)

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

str='Yes'
total=0
time=0
for i in range(N):
    a,b, = map(int, input().split())
    A.append([b,a])

A.sort()


for j in range(N):
    if time<=A[j][0]:
        time = A[j][0]

    A[j][0]=100000000000
    total +=A[j][1]

    if total>time:
        str='No'
print(str)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[]
B=[]
len=B.len
str='Yes'
total=0
time=0
for i in range(N):
    a,b = map(int, input().split())
    A.append(a)
    B.append(b)
B.sort()
AB=B+A
time=min(B)
for j in range(N):
    time += AB[j]
    total +=AB[j+len]
    if total>time:
        str='No'
print(str)
Problem p03061 (python)

Fixed submission:
from fractions import gcd


N=int(input())
A=list(map(int,input().split()))

total=0
left=[0]*(N+1)
right=[0]*(N+1)

for i in range(N):
    left[i+1]=gcd(left[i],A[i])
    right[N -i - 1] = gcd(right[N-i], A[N-1-i])

for i in range(N):
    total=max(total,gcd(left[i],right[i+1]))

print(total)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
from math import gcd

N=int(input())
A=list(map(int,input().split()))

total=0
left=[0]*(N+1)
right=[0]*(N+1)

for i in range(N):
    left[i+1]=gcd(left[i],A[i])
    right[N -i - 1] = gcd(right[N-1], A[N-1-i])

for i in range(N):
    total=max(total,gcd(left[i],right[i+1]))

print(total)

Buggy submission (verdict: Runtime Error):
import fractions

N=int(input())
A=list(map(int,input().split()))

total=0
left=[0]*(N+1)
right=[0]*(N+1)

for i in range(N):
    left[i+1]=(fractions.gcd(left[i]),A[i])
    left[i + 1] = (fractions.gcd(left[N-1]), A[N-1-i])

for i in range[N]:
    total=max(total,fractions.gcd(left[i]),right[N+1])
    
print(total)
Problem p03283 (python)

Fixed submission:
N,M,Q=map(int,input().split())
N=550
A=[]
for i in range(M+Q):
    L,R=map(int,input().split())
    A.append([L,R])
#print(A)
B = [[0 for i in range(N+1)] for j in range(N+1)]

for i in range(M):
    B[A[i][0]][A[i][1]] +=1
#print(*B,sep='\n')
C = [[0 for i in range(N+1)] for j in range(N+1)]
for i in range(N):
    for k in range(N):
        if k==0:
            C[i][k] = B[i][k]
        else:
            C[i][k] += C[i][k-1]+B[i][k]
#print('\n')
#print(*C,sep='\n')
for i in range(M,M+Q):
    total=0
    for k in range(N):
        if A[i][0]<=k<=A[i][1]:
            total+=C[k][A[i][1]]-C[k][A[i][0]-1]
    print(total)

Buggy submission (verdict: Runtime Error):
N,M,Q=map(int,input().split())
A=[]
for i in range(M+Q):
    L,R=map(int,input().split())
    A.append([L,R])
#print(A)
B = [[0 for i in range(500)] for j in range(500)]

for i in range(M):
    B[A[i][0]][A[i][1]] +=1
#print(*B,sep='\n')
C = [[0 for i in range(500)] for j in range(500)]
for i in range(500):
    for k in range(500):
        if k==0:
            C[i][k] = B[i][k]
        else:
            C[i][k] += C[i][k-1]+B[i][k]
#print('\n')
#print(*C,sep='\n')
for i in range(M,M+Q):
    total=0
    for k in range(500):
        if A[i][0]<=k<=A[i][1]:
            total+=C[k][A[i][1]]-C[k][A[i][0]-1]
    print(total)
Problem p03387 (python)

Fixed submission:
A,B,C=map(int,input().split())
total=abs(max(A,B,C)-A)+abs(max(A,B,C)-B)+abs(max(A,B,C)-C)

if total%2==0:
    print(total//2)
else:
    print((total+1)//2+1)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
total=abs(max(A,B,C)-A)+abs(max(A,B,C)-B)+abs(max(A,B,C)-C)

if total%2==0:
    print(total//2)
else:
    print((total+1)//2+
Problem p03625 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
a=0
H=0
W=0
count=1
for i in range(len(A)):
    #print(A[i],H,W)
    if A[i]==a:
        count+=1
    else:
        if count>=4:
            if H<A[i-1]:
                H=A[i-1]
            if W < A[i - 1]:
                W=A[i-1]
        elif count>=2:
            if H!=0:
                W=A[i-1]
            else:
                H=A[i-1]
        a=A[i]
        count=1
        if H!=0 and W!=0:
            print(H*W)
            exit(0)
if count>=4:
    if H<A[i-1]:
        H=A[i-1]
    if W < A[i - 1]:
        W=A[i-1]
elif count>=2:
    if H!=0:
        W=A[i-1]
    else:
        H=A[i-1]
print(H*W)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
A.sort()
a=0
B=[]
C=[]
count=1
for i in range(len(A)):
    if A[i]==a:
        count+=1
    else:
        if count>=2:
            B.append(A[i-1])
        if count>=4:
            C.append(A[i-1])
        a=A[i]
        count=1
if count>=2:
    B.append(A[N-1])
if len(B)<2 and len(C)<1:
    print(0)
else:
    print(max(B[len(B)-1]*B[len(B)-2],C[len(C)]*C[len(C)]))
Problem p03659 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=[0]*200000
total=0
mini=1000000000000000000
for i in range(N):
    total+=A[i]
    B[i]=total

for i in range(N-1):
    if abs(B[i]-(B[N-1]-B[i]))<mini:
        mini=abs(B[i] - (B[N - 1] - B[i]))
print(mini)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=[0]*100000
total=0
mini=1000000000000000000
for i in range(N):
    total+=A[i]
    B[i]=total

for i in range(N):
    if abs(B[i]-(B[N-1]-B[i]))<mini:
        mini=abs(B[i] - (B[N - 1] - B[i]))
print(mini)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=[0]*100000
total=0
mini=1000000000000000000
for i in range(N):
    total+=A[i]
    B[i]=total

for i in range(N-1):
    if abs(B[i]-(B[N-1]-B[i]))<mini:
        mini=abs(B[i] - (B[N - 1] - B[i]))
print(mini)
Problem p03695 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
color = [0 for _ in range(8)]
e = 0

for a in A:
    k = a // 400
    if k < 8 and color[k] == 0:
        color[k] += 1
    elif k >= 8:
        e += 1

c = color.count(1)
y = e + c

if c == 0:
    x = 1
else:
    x = c

print(x, y)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=[0]*10
count=0
for i in range(N):
    B[A[i]//400]+=1

for i in range(8):
    if B[i]>=1:
        count+=1

print(count, end=" ")
print(min(count+int(B[8]),8))
Problem p03999 (python)

Fixed submission:
S=input()
total=0
if len(S)==1:
    print(S)
    exit(0)
for i in range(2**(len(S)-1)):
    a = int(S[0])
    t=format(i,'b').zfill(len(S)-1)
    for j in range(len(t)):
        if t[j]=='0':
            a=a*10+int(S[j+1])
        else:
            total+=a
            a=int(S[j+1])
    total+=a

print(total)

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

for i in range(2**(len(S)-1)):
    a = int(S[0])
    t=format(i,'b').zfill(len(S)-1)
    for j in range(len(t)):
        if t[j]=='0':
            a=a*10+int(S[j+1])
        else:
            total+=a
            a=int(S[j+1])
    total+=a

print(total)
Problem p02675 (python)

Fixed submission:
n = int(input()[-1])
if n == 3:
    ans = "bon"
elif n in [0,1,6,8]:
    ans = "pon"
else:
    ans = "hon"
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
AB = []
for _ in range(M):
    AB.append(list(map(int, input().split())))

list = [0] * (N+1)

saitan = [1]
for _ in range(M):
    next = []
    for i in range(len(AB)):
        if AB[i][0] in saitan:
            if list[AB[i][1]] == 0:
                list[AB[i][1]] = AB[i][0]
                next.append(AB[i][1])
        if AB[i][1] in saitan:
            if list[AB[i][0]] == 0:
                list[AB[i][0]] = AB[i][1]
                next.append(AB[i][0])
    saitan.extend(next)


print("YES")
for ele in list[2:]:
    print(ele)

Buggy submission (verdict: Runtime Error):
import math

A, B, H, M = map(int, input().split())

cho = (H * 60 + M) / (12 * 60) * 360
tan = M / 60 * 360
degree = abs(cho-tan)

ans_2 = A**2 + B**2 - 2*A*B*math.cos(math.radians(degree))
print(math.sqrt(ans_2))
Problem p02681 (python)

Fixed submission:
s=input()
t=input()

print('Yes' if s==t[:-1] else 'No')

Buggy submission (verdict: Runtime Error):
n,m,x = map(int,input().split())
books = [list(map(int, input().split())) for _ in range(n)]

ans = []

for i in range( 2 ** n):
    total = [0] * (m + 1)
    for j in range(n):
        if (i >> j) & 1:
            total = [total[k] + books[j][k] for k in range(m+1)]

    over = True
    for j in range(1, m+1):
        if total[j] < x:
            over = False
    if over:
        ans.append(total[0])

if len(ans) > 0:
    print(min(ans))
else:
    print('-1')
Problem p02684 (python)

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

A.insert(0,-1)
root = [1]

for _ in range(N-1):
    root.append(A[root[-1]])

if K > N:
    start = root.index(root[-1])
    index = (K - start) % (len(root) - start - 1) + start
    ans = root[index]
else:
    ans = root[K]

print(ans)

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

A.insert(0,-1)
root = [1]
next = A[1]
rf = 0

for _ in range(K):
    if next not in root:
        root.append(next)
        next = A[next]
    else:
        rf = root.index(next)
        roop = root[rf:]
        break


print(root[(K - rf - 1) % len(roop)])
Problem p02687 (python)

Fixed submission:
S = input()

if S[1] == "B":
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
x = int(input())
for a in range(-118,119):
    for b in range(-119,118):
        if a**5 - b**5 == x:
            print(a,b)
            exit()
Problem p02658 (python)

Fixed submission:
import functools

n = int(input())
xs = list(map(int, input().split()))

def foldMulti(acc, x):
    return acc*x

if 0 in xs:
    print(0)
elif len([x for x in xs if x > 1]) >= 60:
    print(-1)
else:
    res = functools.reduce(foldMulti, xs, 1)

    if res > 1e18:
        print(-1)
    else:
        print(res)

Buggy submission (verdict: Runtime Error):
import functools

n = int(input())
xs = input().split()

def foldSum(acc, x):
    return acc*int(x)

if 0 in res:
    print(0)
else:
    res = functools.reduce(foldSum, xs, 1)

    if res > 1e18:
        print(-1)
    else:
        print(res)
Problem p02658 (python)

Fixed submission:
n = int(input())

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

ans = 1

if 0 in alis:
  print(0)
  exit()

for a in alis:
	ans *= a
	if ans > 10**18:
		ans = -1
		break

print(ans)

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

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

ans = 1

for a in alis:
  	ans *= a
	if ans > 10**18:
		ans = -1
		break

print(ans)

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

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

ans = 1

for a in alis:
  ans *= a
  if ans > 10**18:
	ans = -1
	break

print(ans)

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

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

ans = 1

for a in alis:
  ans *= a
  if ans > 10**18:
  	ans = -1
    break

print(-1)
Problem p02765 (python)

Fixed submission:
n, r = map(int, input().split())
if n > 10:
    print(r)
else:
    print(r+100*(10-n))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
if n <= 10:
  minus = (10 - n) * 100
print(m - minus)
Problem p02783 (python)

Fixed submission:
h, a = map(int, input().split())
ans = 0
while h > 0:
    ans += 1
    h -= a
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
hlis = list(map(int, input().split()))
# hlis.sort(reverse=True)

for i in range(0, k):
  cache = max(hlis)
  hlis.remove(cache)
print(sum(hlis))
Problem p02818 (python)

Fixed submission:
takahashi, aoki, count = map(int,input().split())
k = count
if takahashi - count >= 0:
  takahashi -= count
else:
  count -= takahashi
  takahashi = 0
  if aoki - count > 0:
    aoki -= count
  else:
    aoki = 0
print(takahashi, aoki)

Buggy submission (verdict: Runtime Error):
takahashi, aoki, count = map(input().split(), int)
k = count
if count - takahashi >= 0:
  takahashi -= count
else:
  takahashi = 0
  count -= takahashi
  if aoki - count > 0:
    aoki -= count
  else:
    aoki = 0
print(takahashi, aoki)
Problem p02898 (python)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
ans = 0
for i in h:
    if i >= k:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
ans = 0
for i in h:
    if h >= k:
        ans += 1
print(ans)
Problem p02909 (python)

Fixed submission:
s = input()
if s == "Sunny":
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
else:
    print("Sunny")

Buggy submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
points = []
minus = []
for i in range(n):
    points.append(k)
    minus.append(-1)
for i in range(q):
    a = int(input())
    points = np.array(points) + np.array(minus)
    points[a - 1] += 1
for point in points:
    if point > 0:
        print("Yes")
    else:
        print("No")
Problem p02911 (python)

Fixed submission:
import numpy as np
n, k, q = map(int, input().split())
points = np.full(n, k)
z = np.full(n, 0)
points = points - q
for i in range(q):
    a = int(input())
    z[a - 1] += 1
points = points + z
for point in points:
    if point > 0:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k, q = map(int, input().split())
points = np.full(n, k)
minus = np.full(n)
for i in range(q):
    a = int(input())
    points = np.array(points) + np.array(minus)
    points[a - 1] += 1
for point in points:
    if point > 0:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
points = []
minus = []
for i in range(n):
    points.append(k)
    minus.append(-1)
for i in range(q):
    a = int(input())
    points = np.array(points) + np.array(minus)
    points[a - 1] += 1
for point in points:
    if point > 0:
        print("Yes")
    else:
        print("No")
Problem p02945 (python)

Fixed submission:
a, b = map(int, input().split())
c = a + b
d = a - b
e = a * b
if c >= d:
    if c >= e:
        print(c)
    else:
        print(e)
elif d >= e:
    print(d)
else:
    print(e)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
d = 0
e = 0
for i in range(n):
    s = sorted(list(input()))
    a.append(s)
a.sort()
f = []
for b in a:
    if b in f:
        d += 1
    f.append(b)
print(d)