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

Fixed submission:
# ABC 116 C

N = int(input())

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

def chomp0(arr):
    while len(arr) != 0 and arr[0] == 0:
        del arr[0]

    while len(arr) != 0 and arr[-1] == 0:
        del arr[-1]

    return arr

def solve(arr):
    arr = chomp0(arr)

    if len(arr) == 0:
        return 0

    ans = 0

    num0 = arr.count(0)
    if num0 != 0:
        for _ in range(num0):
            idx = arr.index(0)
            ans += solve(arr[:idx])
            arr = arr[idx+1:]

    minVal = min(arr)
    ans += minVal
    for i in range(len(arr)):
        arr[i] -= minVal

    if arr.count(0) != len(arr):
        ans += solve(arr)

    return ans

print(solve(h))

Buggy submission (verdict: Runtime Error):
# ABC 116 C

N = int(input())

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

def chomp0(arr):
    while len(arr) != 0 and arr[0] == 0:
        del arr[0]

    while len(arr) != 0 and arr[-1] == 0:
        del arr[-1]

    return arr

def solve(arr):
    if len(arr) == 0:
        return 0

    arr = chomp0(arr)

    ans = 0

    num0 = arr.count(0)
    if num0 != 0:
        for _ in range(num0):
            idx = arr.index(0)
            ans += solve(arr[:idx])
            arr = arr[idx+1:]

    minVal = min(arr)
    ans += minVal
    for i in range(len(arr)):
        arr[i] -= minVal

    if arr.count(0) != len(arr):
        ans += solve(arr)

    return ans

print(solve(h))

Buggy submission (verdict: Runtime Error):
# ABC 116 C

N = int(input())

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

def chomp0(arr):
    while len(arr) != 0 and arr[0] == 0:
        del arr[0]

    while len(arr) != 0 and arr[-1] == 0:
        del arr[-1]

    return arr

def solve(arr):
    ans = 0

    num0 = arr.count(0)
    if num0 != 0:
        for _ in range(num0):
            idx = arr.index(0)
            ans += solve(arr[:idx])
            arr = arr[idx+1:]

    minVal = min(arr)
    ans += minVal
    for i in range(len(arr)):
        arr[i] -= minVal

    arr = chomp0(arr)

    if arr.count(0) != len(arr):
        ans += solve(arr)

    return ans

print(solve(h))
Problem p03316 (python)

Fixed submission:
import sys

def resolve():
  n = int(input())
  s = str(n)
  sum = 0
  for c in s:
    sum += int(c)
  if n % sum == 0:
    print("Yes")
  else:
    print("No")
  return

if __name__ == "__main__":
  resolve()

Buggy submission (verdict: Runtime Error):
from a import resolve

import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """12"""
        output = """Yes"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """101"""
        output = """No"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """999999999"""
        output = """Yes"""
        self.assertIO(input, output)

if __name__ == "__main__":
    unittest.main()
Problem p02641 (python)

Fixed submission:
X, N = map(int, input().split())
p = list(map(int, input().split()))
for d in range(X + 1):
    for s in [-1, +1]:
        a = X + s * d
        if p.count(a) == 0:
            print(a)
            exit(0)

Buggy submission (verdict: Runtime Error):
import sys
x,n = map(int,input().split())
if n == 0:
    print(x)
    sys.exit(0)
p = list(map(int,input().split()))
p.sort()
a = []
j = 0
for i in range(n):
    while (j < p[i]):
        a.append(j)
        j += 1 
    j += 1
for i in range(j,101):
    a.append(j)
    j += 1 
    
#print(a)
def solve(a,x):
    if x < a[0]:
        print(a[0])
        return
    if x > a[-1]:
        if x - a[-1] <= 101 - x:
            print(a[-1])
        else:
            print(101)
        return
    if (binary_search(a,x)):
        mid = binary_search(a,x) - 2
        minimum = abs(a[mid] - x)
        index = mid
        for i in range(1,5):
            #print(a[mid + i])
            if abs(a[mid + i] - x) < minimum:
                index = mid + i 
                minimum = abs(a[mid + i] - x)
        print(a[index])
        return
    

def binary_search(a,x):
    left = 0
    right = len(a)
    while (left + 1 < right):
        mid = (left + right)//2
        if x == a[mid]:
            print(a[mid])
            return 
        elif x < a[mid]:
            right = mid 
        else:
            left = mid + 1
    return mid 

solve(a,x)
Problem p02642 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
largest = max(a)
b = [True] * (largest+1)
dict = {}
ans = 0
for num in a:
    if num in dict.keys():
        b[num] = False
    else:
        dict[num] = 1
        y = num * 2
        while(y <= largest):
            b[y] = False
            y += num
for num in a:
    if b[num] == True:
        ans += 1
print(ans)

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

a.sort()
#print(a)
flag = 0
if a[0] == a[1]:
    ans = 0
else:
    ans = 1
if a[0] == 1:
    print(ans)
    exit(0)

if 2 in a:
    flag = 1
    
dict = {a[0]:1}

for i in range(1,n):
    #print(str(i) + ":")
    for j in range(1,round(math.sqrt(a[i]))+1):
        if flag == 1 and a[i] % 2 == 0:
            break 
        if a[i] % j == 0:
            #print(j)
            if j in dict.keys():
                break
            if a[i] // j in dict.keys():
                break
        if j == round(math.sqrt(a[i])):
            ans += 1
            #print("ans:" + str(ans))
    dict[a[i]] = 1
    
print(ans)
Problem p02683 (python)

Fixed submission:
import math
N,M,X = map(int,input().split())
#a[i][0]:price of the i-th book
a = [[] for i in range(N)]
for i in range(N):
    a[i] = list(map(int,input().split()))

def is_greater(b):
    for i in b:
        if i < X:
            return False
    return True 
    
cost = math.inf
for i in range(2**N):
    b = [0]*(M+1)
    for j in range(N):
        if ((i >> j)&1):
            for k in range(M+1):
                b[k] += a[j][k]
    if b[0] < cost and is_greater(b[1:]):
        cost = b[0]

if cost == math.inf:
    print(-1)
else:
    print(cost)

Buggy submission (verdict: Runtime Error):
import math
N,M,X = map(int,input().split())
#a[i][0]:price of the i-th book
a = [[] for i in range(N)]
for i in range(N):
    a[i] = list(map(int,input().split()))
a.sort()
#dp[j][k]:lowest amount of money needed to make j-th algorithm level k
dp = [[math.inf for k in range(X+1)] for j in range(M)]

for j in range(M):
    dp[j][0] = 0

for i in range(N):
    for j in range(M):
        for k in range(X,a[i][j+1],-1):
            dp[j][k] = min(dp[j][k],dp[j][k-a[i][j+1]] + a[i][0])
        for k in range(1,a[i][j+1]+1):
            dp[j][k] = min(dp[j][k],a[i][0])

#print(dp)
maximum = 0
for j in range(M):
    maximum = max(maximum,dp[j][X])
if maximum == math.inf:
    print(-1)
else:
    print(maximum)

Buggy submission (verdict: Runtime Error):
import math
N,M,X = map(int,input().split())
#a[i][0]:price of the i-th book
a = [[] for i in range(N)]
for i in range(N):
    a[i] = list(map(int,input().split()))
a.sort()
#dp[j][k]:lowest amount of money needed to make j-th algorithm level k
dp = [[math.inf for k in range(X+1)] for j in range(M)]

for j in range(M):
    dp[j][0] = 0

for i in range(N):
    for j in range(M):
        for k in range(X,a[i][j+1],-1):
            dp[j][k] = min(dp[j][k],dp[j][k-a[i][j+1]] + a[i][0])
        for k in range(1,a[i][j+1]+1):
            dp[j][k] = min(dp[j][k],a[i][0])

#print(dp)
maximum = 0
for j in range(M):
    maximum = max(maximum,dp[j][X])
if maximum == math.inf:
    print(-1)
else:
    print(maximum)
Problem p03101 (python)

Fixed submission:
H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
h,w = = map(int,input().split())
print((H-h)*(W-w))
Problem p03338 (python)

Fixed submission:
N = int(input())
S = input()
ans = 0
a = [0] * 26
for i in range(N):
    a[ord(S[i])-ord('a')] += 1

b = [0] * 26
for i in range(N):
    a[ord(S[i])-ord('a')] -= 1
    b[ord(S[i])-ord('a')] += 1
    cnt = 0
    for j in range(26):
        if a[j]*b[j]>0:
            cnt += 1
    ans = max(ans,cnt)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
ans = 0
a = [0] * 26
for i in range(N):
    a[ord(S[i])-ord('a')] += 1

b = [0] * 26
for i in range(26):
    a[ord(S[i])-ord('a')] -= 1
    b[ord(S[i])-ord('a')] += 1
    cnt = 0
    for j in range(26):
        if a[j]*b[j]>0:
            cnt += 1
    ans = max(ans,cnt)
print(ans)
Problem p03612 (python)

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

cnt = 0
for i in range(N-1):
    if A[i] == i+1:
        A[i],A[i+1] = A[i+1],A[i]
        cnt += 1
        i += 1
if A[N-1]==N:
    cnt += 1
print(cnt)

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

cnt = 0
for i in range(N):
    if A[i] == i+1:
        A[i],A[i+1] = A[i+1],A[i]
        cnt += 1
        i += 1
print(cnt)
Problem p02900 (python)

Fixed submission:
A, B = map(int,input().split())
import fractions
_gcd = fractions.gcd(A, B)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

l = make_divisors(_gcd)
if len(l)==1:
    print(1)
    quit()
l.sort()
aa=False
for x in l:
    if x%2==0:
        aa=x
        break
if aa:
    l2 = [x for x in l if x%2]
    l2.append(aa)
else:
    l2 = l[:]
for i,x in enumerate(l2):
    for y in l2[i+1:]:
        if fractions.gcd(x, y) != 1 and y in l2:
            l2.remove(y)
print(len(l2))

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

import math
gcd = math.gcd(A, B)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

l = make_divisors(gcd)
if len(l)==1:
    print(1)
    quit()
l.sort()

l2 = l[:]
for i,x in enumerate(l):
    for y in l[i+1:]:
        if math.gcd(x, y) != 1 and y in l2:
            l2.remove(y)
print(len(l2))
Problem p02603 (python)

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

kabu = 0
money = 1000
for i in range(n-1):
    if values[i] < values[i+1]:
        kabu = money // values[i] 
        money += (values[i+1] - values[i]) * kabu
        
print(money)

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

kabu = 0
money = 1000
for i in range(n-1):
    if values[i] < values[i+1]:
        kabu = money // values[i] 
        money += (values[i+1] - values[i]) * kabu
        
print(money)

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

kabu = 0
money = 1000
for i in range(n-1):
    if values[i] < values[i+1]:
        kabu = money // values[i] 
        money += (values[i+1] - values[i]) * kabu
        
    else:
        continue
        
print(money)
Problem p02684 (python)

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

idx = a[0]
hist = [1]
passed = [0] * n
flag = 0
for i, _ in enumerate(range(k), start=1):
    if passed[idx-1] == 1:
        hist.append(idx)
        passed[idx-1] = 1
        flag = 1
        break
    hist.append(idx)
    passed[idx-1] = 1
    idx = a[idx-1]
    
    
if flag:
    l_start, l_end = hist.index(idx), i
    surplus = (k - l_start) % (l_end - l_start)
    print(hist[l_start + surplus])
else:
    print(hist[-1])

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

idx = a[0]
hist = [1]
flag = 0
for i, _ in enumerate(range(k), start=1):
    if idx in hist:
        hist.append(idx)
        flag = 1
        break
    hist.append(idx)
    idx = a[idx-1]
    
if flag:
    l_start2, l_end2 = hist.index(idx), i
    surplus = (k-l_start) % (l_end - l_start)
    print(hist[l_start+surplus])
else:
    print(idx)

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

idx = a[0]
hist = [1]
for _ in range(k):
    if idx in hist:
        hist.append(idx)
        break
    hist.append(idx)
    idx = a[idx-1]
    
l_start, l_end = [i for i, v in enumerate(hist) if hist[-1]==v]

surplus = (k-l_start) % (l_end - l_start)
print(hist[l_start+surplus])
Problem p02690 (python)

Fixed submission:
import itertools
x = int(input())
digits = len(str(x))
dic = {}
keta = []
for i in range(121):
    num = i ** 5    
    if (num > 10**(digits+2)):
        break
    if num > 10**(digits-2):
        dic[i] = num
        dic[-i] = -num
    elif num < 10**(digits+1):
        dic[i] = num
        dic[-i] = -num
        
for num1,num2 in itertools.combinations(dic.keys(), 2):
    a, b = dic[num1], dic[num2]
    if x == (a-b):
        ans = (num1,num2)
        break
    if x == (-a+b):
        ans = (num2,num1)
        break
print(f"{ans[0]} {ans[1]}")

Buggy submission (verdict: Runtime Error):
import itertools
x = int(input())
digits = len(str(x))
dic = {}
keta = []
for i in range(10000):
    num = i ** 5    
    if (num > (10**9)) or (num > 10**(digits+1)):
        break
    if num > 10**(digits-2):
        dic[i] = num
    elif num < 10**(digits+1):
        dic[i] = num
        
for num1,num2 in itertools.combinations(dic.keys(), 2):
    a, b = dic[num1], dic[num2]
    if x == (a+b):
        ans = (num1,num2)
        break
    if x == (a-b):
        ans = (num1,-num2)
        break
    if x == (-a+b):
        ans = (-num1,num2)
        break
    if x == (-a-b):
        ans = (-num1,-num2)
        break
print(f"{ans[0]} {ans[1]}")
Problem p02696 (python)

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

if n < b:
    score = math.floor(a*n/b) - a * math.floor(n/b)
    print(score)
    
else:
    max_score = -10000
    for i in range(1,10):
        x = (b-1)*i
        score = math.floor(a*x/b) - a * math.floor(x/b)
        max_score = max(max_score, score)
    print(max_score)

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

if n < b:
    x = n
    score = math.floor(a*x/b) - a * math.floor(x/b)
    print(score)
    
else:
    x = b-1
    score = math.floor(a*x/b) - a * math.floor(x/b)
    print(max_score)
Problem p02983 (python)

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

ans = 10000
if r-l >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(i+1,r+1):
            ans = min(ans, i*j%2019)
    print(ans)

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

minimum = l%2019
maximum = r%2019

ans = 10000
if r-l >= 673:
    print(0)    
elif r-l < 2019:
    for i in range(l,r):
        if i%673 ==0:
            flag = 1
        ans = min(i*(i+1)%2019,ans)
    
    if flag==1:
        print(0)
    else:
        print(ans)
Problem p03001 (python)

Fixed submission:
W,H,x,y=map(int,input().split())

max_menseki=W*H/2
if W%2==0 and W//2==x and H//2==y and H%2==0:
    print(max_menseki,"1")
else:
    print(max_menseki,"0")

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

a=list(map(int,input().split()))
sowa=[a[0]]
for i in range(1,n):
    temp=sowa[-1]+a[i]
    sowa.append(temp)
ans=0
for i in range(n):
    if sowa[i]>=k:
        ans+=1
        for j in reversed(range(i)):
            bubun=sowa[i]-sowa[j]
            if bubun>=k:
                ans+=j+1
                break
print(ans)

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

a=list(map(int,input().split()))
sowa=[]
for i in range(1,n+1):
    sowa.append(sum(a[:i]))
ans=0
for i in range(n):
    if sowa[i]>=k:
        ans+=1
        for j in reversed(range(i)):
            bubun=sowa[i]-sowa[j]
            if bubun>=k:
                ans+=j+1
                break
print(ans)
Problem p03049 (python)

Fixed submission:
N=int(input())
lasta=0
headb=0
spec=0
cnt=0
for _ in range(N):
    s=str(input())
    for i in range(len(s)-1):
        if s[i:i+2]=="AB":
            cnt+=1
    if s[0]=="B" and s[-1]=="A":
        spec+=1
    elif s[-1]=="A":
        lasta+=1
    elif s[0]=="B":
        headb+=1
        
if abs(headb-lasta)>=spec:
    print(min(headb,lasta)+spec+cnt)   
elif lasta==0 and headb==0 and spec>0:
    print(spec-1+cnt)
elif lasta==0 and headb==0 and spec==0:
    print(cnt)
else:
    print(spec-abs(headb-lasta)+max(headb,lasta)+cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
lasta=0
headb=0
spec=0
cnt=0
for _ in range(N):
    s=str(input())
    for i in range(len(s)-1):
        if s[i:i+2]=="AB":
            cnt+=1
    if s[0]=="B" and s[-1]=="A":
        spec+=1
    elif s[-1]=="A":
        lasta+=1
    elif s[0]=="B":
        headb+=1
if abs(headb-lasta)>=spec:
    print(min(headb,lasta)+spec+cnt)
    
elif lasta=0 and headb=0:
    print(spec-1+cnt)
else:
    print(spec-abs(headb-lasta)+max(headb,lasta)+cnt)
Problem p03076 (python)

Fixed submission:
a=str(input())
b=str(input())
c=str(input())
d=str(input())
e=str(input())

#menu=[int(a[-1]),int(b[-1]),int(c[-1]),int(d[-1]),int(e[-1])]
menu=[a[-1],b[-1],c[-1],d[-1],e[-1]]
menu.sort()

if int(menu[4])==0:
    iti=0
    marume=0
else:
    while menu[0]=="0":
        menu.remove("0")
    iti=int(menu[0])
    marume=10 * (len(menu)-1)


time=0
kuso=[a,b,c,d,e]

for temp in kuso:
    if len(temp)==2:
        time+=int(temp[-2])*10
    elif len(temp)==3:
        time+=100 + 10*int(temp[-2])
    else:
        time+=0
                
print(iti + marume +time)

Buggy submission (verdict: Runtime Error):
a=str(input())
b=str(input())
c=str(input())
d=str(input())
e=str(input())

#menu=[int(a[-1]),int(b[-1]),int(c[-1]),int(d[-1]),int(e[-1])]
menu=[a[-1],b[-1],c[-1],d[-1],e[-1]]
menu.sort()
while menu[0]=="0":
    menu.remove("0")
iti=int(menu[0])

marume=10 * (len(menu)-1)


time=0
kuso=[a,b,c,d,e]

for temp in kuso:
    if len(temp)==2:
        time+=int(temp[-2])*10
    elif len(temp)==3:
        time+=100 + 10*int(temp[-2])
    else:
        time+=0
        
print(iti + marume +time)
Problem p03085 (python)

Fixed submission:
a=str(input())
 
if a=="A":
    print("T")
if a=="T":
    print("A")
if a=="G":
    print("C")
if a=="C":
    print("G")

Buggy submission (verdict: Runtime Error):
a=atr(input())

if a=="A":
    print("T")
if a=="T":
    print("A")
if a=="G":
    print("C")
if a=="C":
    print("G")
Problem p03087 (python)

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

list=[0]*(N+1)

for i in range(N):
    list[i+1]=list[i]+1 if a[i:i+2]=="AC" else list[i]
    
for i in range(Q):
    l,r = map(int, input().split())
    print(list[r-1]-list[l-1])

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

list=[0]*(N+1)

for i in range(N):
    list[i+1]=list[i]+1 if a[i:i+2]=="AC" else list[i]
    
for i in range(N):
    l,r = map(int, input().split())
    print(list[r-1]-list[l-1])

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

list=[0]*N+1

for i in range(N):
    list[i+1]=list[i]+1 if a[i:i+2]=="AC" else list[i]
    
for i in range(N):
    l,r = map(int, input().split())
    print(list[r-1]-list[l-1])

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

list=[0]*N

for i in range(N):
    list[i+1]=list[i]+1 if a[i:i+2]=="AC" else list[i]
    
for i in range(N):
    l,r = map(int, input().split())
    print(list[r-1]-list[l-1])
Problem p03102 (python)

Fixed submission:
import numpy as np

N,M,C=map(int, input().split())

b=list(map(int, input().split()))
b=np.array(b)
count=0
for _ in range(N):
    a=list(map(int, input().split()))
    a=np.array(a)
    e=a*b
    d=np.sum(e,axis=0)+C
    if d>0:
        count+=1
print(count)

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

N,M,C=map(int, input().split())

b=list(map(int, input().split()))
b=np.array(b)
count=0
for _ in range(M):
    a=list(map(int, input().split()))
    a=np.array(a)
    e=a*b
    d=np.sum(e,axis=0)+C
    if d>0:
        count+=1
print(count)

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

N,M,C=map(int, input().split())

b=np.array([int, input().split()])
count=0
for _ in range(M):
    a=np.array([map(int, input().split())])
    e=a*b
    d=np.sum(e,axis=0)+C
    if d>0:
        count+=1
print(count)

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

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

listA = [list(map(int, input().split())) for _ in range(a)]
t=0

for i in range(a):
    ans=0
    for i in range(b-1):
        s=listB[i]*listA[i]
        s=sum(s)
        ans= ans+s
    if ans+c>0:
        t+=1
print(t)
Problem p03105 (python)

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

if A*C < B:
    print(C)

elif A*C == B:
    print(C)

elif A*C > B:
    print(B//A)

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

if A*C < B:
    print(C)

elif A*C = B:
    print(C)

elif A*C > B:
    print(B//A)

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

if A*C < B:
    print(C)

if A*C = B:
    print(C)

if A*C > B:
    print(B//A)
Problem p03106 (python)

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

list=[]
for i in range(1,10000):
    if (A%i==0 and B%i==0):
        list.append(i)
    else:
        continue

print(list[-K])

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
 
list=[]
list= [i for i in range(1,10) if A%i==0 and B%i==0]
list[K-1]

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

list=[]
list= [i for i in range(1,15) if A%i==0 and B%i==0]
a = list[K-1]
ptint(a)

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

list=[]
list= [i for i in range(1,10000) if A%i==0 and B%i==0]
a = list[K-1]
ptint(a)

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

list=[]
list= [i for i in range(10000) if A%i==0 and B%i==0]
list[K-1]

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

list= [i for i in range(10000) if A%i==0 and B%i==0]
list[K-1]
Problem p03110 (python)

Fixed submission:
n = int(input())
A=[]
for i in range(n):
  A.append(list(input().split()))
 
ans=0
for a in A:
    if a[1] =="JPY":
        ans += float(a[0])
    else:
        ans += float(a[0]) * 380000.0
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
otoshidama=0
for _ in range(N):
    x,u=input().split()
    x=int(x)
    if u=="JPY":
        otoshidama+=x
    else:
        otoshidama+=x*380000.0
print(otoshidama)

Buggy submission (verdict: Runtime Error):
n = int(input())
A=[]
for i in range(n):
  A.append(list(input().split()))
 
ans=0
for a in A:
    if a[1] =="JPY":
        ans += float(a[1])
    else:
        ans += float(a[0]) * 380000.0
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
A=[]
for i in range(n):
  A.append(list(input().split())

ans=0
for a in A:
    if a[1] =="JPY":
        ans += float(a[1])
    else:
        ans += float(a[0]) * 380000.0
print(ans)

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

h, w = (input().split() for in range(n))
a=0

if w =="JPY":
  a += h
else:
  a += h * 380000.0

print(a)