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

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

white_cells_int = H * W - ((h * W) + (w * H) - (h * w))
print(str(white_cells_int))

Buggy submission (verdict: Runtime Error):
n, m, c = map(int,input().split())
B = list(map(int,input().split()))
A = [input().split() for l in range(n)]
cnt = 0
for i in range(n):
    sum = 0
    for j in range(m):
        sum += int(A[i][j]) * B[j]
    if sum + c > 0:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
h, w = map(int, input().split())

white_cells_int = H * W - ((h * W) + (w * H) - (h * w)
print(white_cells_int)
Problem p03103 (python)

Fixed submission:
n, m = map(int, input().split())
tupList = []
for i in range(n):
    a, b = [int(i) for i in input().split()]
    tupList.append((a, b))

def tupVal(tup):
    return tup[0]
tupList.sort(key = tupVal)
ans = 0
for i in tupList:
    if m >= i[1]:
        ans += i[0] * i[1]
        m -= i[1]
    else:
        ans += i[0] * m
        break
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
*storeList = map(int, open().read().split())
ans = 0
for a, b in sorted(zip(storeList[::2], storeList[1::2])):
    ans += a * min(m, b) ; m = max(0, m - b)
print(ans)
Problem p03111 (python)

Fixed submission:
from collections import deque

N, A, B, C = map(int, input().split())
L = [int(input()) for _ in range(N)]
minMP = 10**5

p = deque()
p.append([-1] * len(L))
while p:
    stats = p.pop()
    stats = list(stats)
    a, b, c = 0, 0, 0
    MP = 0
    cntA = 0; cntB = 0; cntC = 0
    for i in range(N):
        if stats[i] == 1:
            a += L[i]
            cntA += 1
        elif stats[i] == 2:
            b += L[i]
            cntB += 1
        elif stats[i] == 3:
            c += L[i]
            cntC += 1

    if cntA >= 1 and cntB >= 1 and cntC >= 1:
        MP += abs(A - a) + abs(B - b) + abs(C - c) + 10 * (cntA+cntB+cntC-3)
        minMP = min(minMP, MP)

    if not -1 in stats:
        continue
    j = stats.index(-1)
    for k in range(4):
        stats[j] = k
        newStats = tuple(stats)
        p.append(newStats)

print(minMP)

Buggy submission (verdict: Runtime Error):
from collections import deque

N, A, B, C = map(int, input().split())
L = [int(input()) for _ in range(N)]
minMP = 10**5

p = deque()
p.append([-1] * len(L))
while p:
    stats = p.pop()
    stats = list(stats)
    a, b, c = 0, 0, 0
    MP = 0
    cntA = 0; cntB = 0; cntC = 0
    for i in range(N):
        if stats[i] == 1:
            a += L[i]
            cntA += 1
        elif stats[i] == 2:
            b += L[i]
            cntB += 1
        elif stats[i] == 3:
            c += L[i]
            cntC += 1

    if cntA >= 1 and cntB >= 1 and cntC >= 1:
        MP += abs(A - a) + abs(B - b) + abs(C - c) + 10 * (cntA+cntB+cntC-3)
        minMP = min(minMP, MP)

    if not -1 in stats:
        continue
    j = stats.index(-1)
    for k in range(4):
        stats[j] = k
        newStats = tuple(stats)
        p.append(newStats)
        print(newStats)
print(minMP)
input()
Problem p03126 (python)

Fixed submission:
N, M = map(int, input().split())
like_set = {0}
for i in range(1, M+1):
    like_set.add(i)
for i in range(N):
    like = list(map(int,input().split()))
    like = set(like[1:])
    like_set = like_set & like
print(len(like_set))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
like_set = {}
for i in range(1, M+1):
    like_set.add(i)
for i in range(N):
    like = input().split()
    like = set(like[1:])
    like_set = like_set & like
print(len(like_set))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
like_set = {}
for i in range(1,M+1):
    like_set = like_set | {i}
for i in range(N):
    k_a = input().split()
    a = k_a[1:]
    like_set = set(a) & like_set
print(len(like_set))
Problem p03160 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []; B = []; C = []
for i in range(N):
    a, b, c = map(int, input().split())
    A.append(a); B.append(b); C.append(c)

dp = [[0,0,0]]*(N+1)
for i in range(N):
    dp[i+1][0] = max(dp[i][1] + A[i], dp[i][2] + A[i])
    dp[i+1][1] = max(dp[i][0] + B[i], dp[i][2] + B[i])
    dp[i+1][2] = max(dp[i][0] + C[i], dp[i][1] + C[i])
    
print(max(dp[N]))

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

dp = [0]*(N+2)
for i in range(N):
    dp[i+1] = min(dp[i+1], dp[i]+abs(H[i+1]-H[i]))
    dp[i+2] = min(dp[i+2], dp[i]+abs(H[i+2]-H[i]))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
H = [0] + [map(int, input().split())]

dp = [0]*(N+1)
dp[1] = H[1]
for i in range(2, N+1):
    dp[i] = min(dp[i-1]+abs(H[i]-H[i-1]), dp[i-2]+abs(H[i]-H[i-2]))
print(dp[N])

Buggy submission (verdict: Runtime Error):
def chmin(a, b):
    if a > b:
        a = b
N = int(input())
h = list(map(int,input().split()))
dp = [10**5] * (N+10)
for i in range(1, N):
    dp[i+1] = chmin(dp[i+1], dp[i] + abs(h[i+1] - h[i]))
    dp[i+2] = chmin(dp[i+2], dp[i] + abs(h[i+2] - h[i]))
print(dp[N-1])
Problem p03161 (python)

Fixed submission:
N, K = map(int, input().split())
H = list(map(int, input().split()))
INF = float('inf')
dp = [INF]*N
dp[0] = 0

for i in range(N):
    for j in range(1, K+1):
        if i+j > N-1:
            break
        dp[i+j] = min(dp[i+j], dp[i]+abs(H[i+j]-H[i]))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
def chmin(a, b):
    if a > b:
        a = b
N, K = map(int,input().split())
dp = [10**5] * (N+K+10)
h = [0] * (N+K+10)
for i in range(N):
    h[i] = int(input())
for i in range(N):
    for j in range(1, K+1):
        dp[i+j] = chmin(dp[i+j], dp[i] + abs(h[i] - h[i+j]))
print(dp[N-1])
Problem p03211 (python)

Fixed submission:
S = input()
diff = 1000
for i in range(len(S)-2):
    S_int = int(S[i:i+3])
    diff = min(diff, abs(753-S_int))
print(diff)

Buggy submission (verdict: Runtime Error):
S = input()
diff = 1000
for i in range(len(S)-2):
    S_int = int(S[i:i+3])
    diff = min(diff, abs(753-S_int)
print(diff)

Buggy submission (verdict: Runtime Error):
S = input()
abs = 1000
for i in range(len(S)-2):
    abs = min(abs, abs(753-S[i:i+3]))
print(abs)
Problem p03243 (python)

Fixed submission:
N = int(input())
for i in range(1, 10):
    num = i*111
    if N <= num:
        print(num)
        break

Buggy submission (verdict: Runtime Error):
N = int(input())
for i in range(1, 10):
    num = int("i"*3)
    if N <= num:
        print(num)
        break
Problem p03264 (python)

Fixed submission:
k = int(input())
if k % 2 == 0:
    print((k//2)**2)
else:
    print((k//2+1)*(k//2))

Buggy submission (verdict: Runtime Error):
k = int(input())
if k % 2 == 0:
    print((k//2)**2)
else:
    print((k//2-1)(k//2))
Problem p03289 (python)

Fixed submission:
S = input()
Slist = list(S)
L = len(S)
if S[0] == 'A' and 'C' in S[2:L-1] and Slist.count('C') == 1:
    Slist.remove('A')
    Slist.remove('C') 
    flag = True
    for s in Slist:
        if s.isupper():
            flag = False
    if flag:
        print('AC')
        exit()
print('WA')

Buggy submission (verdict: Runtime Error):
S = input()
Slist = list(S)
L = len(S)
if S[0] == 'A' and 'C' in S[1:L-1] and Slist.count('C') == 1:
    Slist.remove('A', 'C')
    flag = True
    for s in Slist:
        if s.isupper():
            flag = False
    if flag:
        print('AC')
        exit()
print('WA')
Problem p03290 (python)

Fixed submission:
D, G = map(int, input().split())
PC = [tuple(map(int, input().split())) for _ in range(D)]
minNum = 10**3

for i in range(2**D):
    point = 0
    num = 0
    leftOvers = []
    for j in range(D):
        if ((i>>j) & 1):
            num += PC[j][0]
            point += PC[j][1] + 100 * (j+1) * PC[j][0]
        else:
            leftOvers.extend([100*(j+1)]*PC[j][0])

    while point < G:
        if not leftOvers:
            break
        point += leftOvers.pop()
        num += 1
    minNum = min(num, minNum)
print(minNum)

Buggy submission (verdict: Runtime Error):
D, G = map(int, input().split())
PC = [tuple(map(int, input().split())) for _ in range(D)]
minNum = 10**3

for i in range(2**D):
    point = 0
    num = 0
    leftOvers = []
    for j in range(D):
        if ((i>>j) & 1):
            num += PC[j][0]
            point += PC[j][1] + 100 * (j+1) * PC[j][0]
        else:
            leftOvers.extend([100*(j+1)]*PC[j][0])

    while point < G:
        point += leftOvers.pop()
        num += 1
    minNum = min(num, minNum)
print(minNum)
Problem p03316 (python)

Fixed submission:
N = int(input())
S = 0

for i in range(10):
    S += (N % 10**(i+1)) // 10**i 
print('Yes' if N % S == 0 else 'No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = 0
for i in range(1, 10):
    S += N % 10**i

print('Yes' if N % S == 0 else 'No')
Problem p03337 (python)

Fixed submission:
a, b = map(int,input().split())
print(max(a+b,a-b,a*b))

Buggy submission (verdict: Runtime Error):
a, b = int(input())
print(max(a+b,a-b,a*b))
Problem p03369 (python)

Fixed submission:
S = input()
toppings = S.count("o")
print(700 + toppings*100)

Buggy submission (verdict: Runtime Error):
S = input()
toppings = S.count(o)
print(700 + toppings*100)
Problem p03434 (python)

Fixed submission:
n = int(input())
A = list(map(int,input().split()))
A_0 = A.sort(reverse=True)
swt = 0
Alice_point = 0
Bob_point = 0

for i in range(n):
    if swt == 0:
        Alice_point += A[i]
        swt = 1
    else:
        Bob_point += A[i]
        swt = 0
print(Alice_point - Bob_point)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
A_0 = A.sort(reverse=True)
swt = 0
Alice_point = 0
Bob_point = 0

for i in range(n):
    if swt == 0:
        Alice_point += A_0[i]
        swt = 1
    else:
        Bob_point += A_0[i]
        swt = 0
print(Alice_point - Bob_point)
Problem p03436 (python)

Fixed submission:
from collections import deque

H, W = map(int,input().split())
S = []
wall = 0
for i in range(H):
    s = list(input())
    wall += s.count("#")
    S.append(s)
q = deque()
q.append([0, 0, 0])
S[0][0] = "#"
while q:
    y, x, cnt = q.popleft()
    if y == H-1 and x == W-1:
        break
    for dy, dx in [[1, 0], [-1, 0], [0, 1], [0, -1]]:
        if 0 <= y + dy < H and 0 <= x + dx < W and S[y + dy][x + dx] == ".":
            q.append([y + dy, x + dx, cnt + 1])
            S[y + dy][x + dx] = "#"

if S[H-1][W-1] == ".":
    print(-1)
else:
    score = H * W - (cnt + 1) - wall
    print(score)

Buggy submission (verdict: Runtime Error):
from collections import deque

H, W = map(int,input().split())
S = [list(input()) for _ in range(H)]

q = deque()
q.append((0, 0, 0))
S[0][0] = "#"
while q:
    y, x, cnt = q.popleft()
    for dy, dx in [[1, 1], [-1, 1], [1, -1], [-1, -1]]:
        if 0 <= y + dy < H and 0 <= x + dx < W and S[y + dy][x + dx] == ".":
            q.append(y + dy, x + dx, cnt + 1)
            S[y + dy][x + dx] = "#"
if S[H-1][W-1] == ".":
    print(-1)
else:
    score = H * W - (cnt + 1)
    print(score)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
c = a * b
if c % 2 == 0:
	print('Even')
else:
	print('Odd')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = a * b
if c % 2 == 0;
	print('Even')
else;
	print('Odd')
Problem p03470 (python)

Fixed submission:
n = int(input())
D = list(input() for i in range(n))
D = set(map(int,D))
print(len(D))

Buggy submission (verdict: Runtime Error):
n = int(input())
D = list(map(int,input().split()))
daburi = 0
for i in range(n):
    for j in range(n):
        if i != j and D[i] == D[j]:
            daburi += 1
print(n - daburi)

Buggy submission (verdict: Runtime Error):
n = int(input())
D = list(map(int,input().split()))
daburi = 0
for i in range(n):
    for j in range(n):
        if i != j and D[i] == D[j]
            daburi += 1
print(n - daburi)
Problem p03493 (python)

Fixed submission:
s = input()
print(s.count("1"))

Buggy submission (verdict: Runtime Error):
s = input()
print(s.count(1))

Buggy submission (verdict: Runtime Error):
s = input()
print(s.count(1))

Buggy submission (verdict: Runtime Error):
a, b, c = map(str,input().split())
d = 0
if a == 1:
  	d += 1
if b == 1:
  	d += 1
if c == 1:
  	d += 1
print(d)
Problem p03543 (python)

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

Buggy submission (verdict: Runtime Error):
n = list(str(input()))
if n[0]==n[1]==n[2] or n[2]==n[1]==n[3]
    print("Yes")
else:
    print("No")
Problem p03544 (python)

Fixed submission:
N = int(input())

if N == 0:
    print(2)
elif N == 1:
    print(1)
    exit()

L0 = 2; L1 = 1
for _ in range(2, N+1):
    L2 = L1 + L0
    L1, L0 = L2, L1
print(L2)

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

if N == 0:
    print(2)
elif N == 1:
    print(1)
    exit()

L0 = 2; L1 = 1
for _ in range(N-2):
    L2 = L1 + L0
    L1, L0 = L2, L1
print(L2)
Problem p03573 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = input().split()
if a == b:
    print(C)
elif a == c:
    print(b)
else:
    print(a)
Problem p03644 (python)

Fixed submission:
n = int(input())
cnt_list = []
for i in range(1, n+1):
    cnt = 0
    while i % 2 == 0:
        i = i / 2
        cnt += 1
    cnt_list.append(cnt)
print(2**max(cnt_list))

Buggy submission (verdict: Runtime Error):
n = int(input())
cnt_list = []
for i in range(1, n):
    cnt = 0
    while i % 2 == 0:
        i = i / 2
        cnt += 1
    cnt_list.append(cnt)
print(max(cnt_list))
Problem p03693 (python)

Fixed submission:
r, g, b = input().split()
rgb = r + g + b
if int(rgb) % 4 == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
strList = [input().split()]
rgb = int(join(strList))
if rgb % 4 == 0:
    print("Yes")
else:
    print("No")
Problem p03415 (python)

Fixed submission:
x = ""
for i in range(3):
    S = input()
    char_list = list(S)
    x = x + char_list[i]
print(x)

Buggy submission (verdict: Runtime Error):
x = ""
for i in range(3):
    S = input()
    char_list = list(S)
    x = x + char_list[i]
print x
Problem p03416 (python)

Fixed submission:
A,B= map(int,input().split(" "))
count = 0
x = int(A/10**4)
y = int(A/10**3) - x*10
z = int(A/10**2) - x*10**2 - y*10
N = A
while N <= B:
    while y < 10:
        while z < 10:
                    N = x*(10**4)+y*(10**3)+z*(10**2)+y*(10**1)+x
                    if N > B:
                        break
                    if N == B:
                        count = count + 1
                        break
                    if N < A:
                        count = count -1
                    count = count + 1
                    z = z + 1
        z = 0
        y = y + 1
        if N >= B:
            break
    x = x + 1
    y = 0
print(count)

Buggy submission (verdict: Runtime Error):
A,B= map(int,input().split(" "))
count = 0
x = int(A/10**4)
y = int(A/10**3) - x*10
z = int(A/10**2) - x*10**2 - y*10
N = A
while N <= B:
    while y < 10:
        while z < 10:
                    N = x*(10**4)+y*(10**3)+z*(10**2)+y*(10**1)+x
                    if N > B:
                        break
                    if N == b:
                        count = count + 1
                        break
                    count = count + 1
                    z = z + 1
        z = 0
        y = y + 1
        if N >= B:
            break
    x = x + 1
    y = 0
print(count-1)

Buggy submission (verdict: Runtime Error):
A,B= map(int,input().split(" "))
count = 0
x = int(A/10**4)
y = int(A/10**3) - x*10
z = int(A/10**2) - x*10**2 - y*10
N = A 
while N <= B:
    while y < 10:
        while z < 10:
                    N = x*(10**4)+y*(10**3)+z*(10**2)+y(10**1)+x
                    if N >= B:
                        break
                    count = count + 1
                    z = z + 1
        y = y + 1
    x = x + 1
    y = 0
    z = 0
print(count)

Buggy submission (verdict: Runtime Error):
A,B= map(int,input().split(" "))
count = 0
x = int(A/10**4)
y = int(A/10**3) - x*10
z = 0
N = A 
while N <= B:
    while y < 10:
        while z < 10:
                    N = x*(10**4)+y*(10**3)+z*(10**2)+y(10**1)+x
                    if N >= B:
                        break
                    count = count + 1
                    z = z + 1
        y = y + 1
    x = x + 1
    y = 0
    z = 0
print(count)
Problem p03424 (python)

Fixed submission:
N = int(input())
S = input()
char_list = list(S.split(" "))
result = "Three"
for i in range(N):
    if char_list[i] == "Y":
        result = "Four"
print(result)

Buggy submission (verdict: Runtime Error):
N = input()
S = input()
char_list = list(S.split(" "))
result = "Three"
for i in range(N):
    if char_list[i] == "Y":
        result = "Four"
print(result)
Problem p02995 (python)

Fixed submission:
#最大公約数
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

#最小公倍数
def lcm(a,b):
    return a*b//gcd(a,b)

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

bandc = b // c 
bandd = b // d
bandcd = b // lcm(c,d)

aandc = a // c 
aandd = a // d
aandcd = a // lcm(c,d)

totalb = b - bandc - bandd + bandcd
totala = a - aandc - aandd + aandcd
#print(totalb)
#print(totala)
if (a % c != 0) and (a % d != 0):
    ans = totalb - totala + 1
else:
    ans = totalb - totala

print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

bandc = b // c 
bandd = b // d
bandcd = b // ((c*d) // math.gcd(c,d))

aandc = a // c 
aandd = a // d
aandcd = a // ((c*d) // math.gcd(c,d))

totalb = b - bandc - bandd + bandcd
totala = a - aandc - aandd + aandcd
#print(totalb)
#print(totala)
print(totalb-totala)
Problem p03047 (python)

Fixed submission:
import math

n,k = map(int,input().split())
print(n-k+1)

Buggy submission (verdict: Runtime Error):

r,g,b,n = map(int,input().split())
ans = 0

for i in range(n+1):
    for j in range(n+1):
            if (r*i + g*j + b*(n+1 - i - j)) == n:
                ans += 1
print(ans)
Problem p02947 (python)

Fixed submission:
n=int(input())
ans=[]
for i in range(n):
    qw=input()
    ans.append([0,0,0,0,0,0,0,0,0,0])
    for j in range(10):
        ans[i][j]=qw[j]
    ans[i].sort()

lis=[]
for i in range(n):
    lis.append(ans[i][0])
    for j in range(9):
        lis[i]+=ans[i][j+1]

a=0
#print(lis)

dic={lis[0]:1}
for i in range(n-1):
    if lis[i+1] in dic.keys():
        a+=dic[lis[i+1]]
        dic[lis[i+1]]+=1
    else:
        dic[lis[i+1]]=1

print(int(a))

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
ans=[]
for i in range(n):
    qw=input()
    ans.append(np.zeros(10))
    for j in range(10):
        ans[i][j]=qw[j]
    ans[i].sort()

ans.sort()
a=0
for i in range(n-1):
    for j in range(n-1-i):
        if ans[i]==ans[i+j+1]:
            a+=1
        else:
            break

print(int(a))

Buggy submission (verdict: Runtime Error):
iport numpy as np
n=int(input())
ans=[]
for i in range(n):
    qw=input()
    ans.append(np.zeros(10))
    for j in range(10):
        ans[i][j]=qw[j]
    ans[i].sort()

ans.sort()
a=0
for i in range(n-1):
    for j in range(n-1-i):
        if ans[i]==ans[i+j+1]:
            a+=1
        else:
            break

print(int(a))
Problem p02952 (python)

Fixed submission:
a=int(input())
b=len(str(a))

ans=0

if b%2==0:
    for i in range(int(b/2)):
        c=1+i*2
        ans+=(10**c-(10**(c-1)))

else:
    ans+=(a-(10**(b-1))+1)
    for i in range(int((b-1)/2)):
        e=1+i*2
        ans+=(10**e-(10**(e-1)))

print(int(ans))

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

ans=0

if b%2==0:
    for i in range(int(b/2)):
        c=1+i*2
        ans+=(10**c-1)

else:
    ans+=(a-(10**(b-1)))
    for i in range((b-1)/2):
        e=1+i*2
        ans+=(10**c-1)

print(int(ans))
Problem p02957 (python)

Fixed submission:
lis=list(map(int,input().split()))
a=lis[0]+lis[1]
if a%2==0:
    print(int(a/2))
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
lis=list(map(int,input().split())
a=lis[0]+lis[1]
if a%2==0:
    print(int(a/2))
else:
    print("IMPOSSIBLE")
Problem p03001 (python)

Fixed submission:
w,h,x,y=map(int,input().split())

ans1=w*h/2
if w/2==x and h/2==y:
    a=1
else:
    a=0
print(ans1,a)

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

ans1=w*h/2
if w/x==2 and h/y==2:
    a=1
else:
    a=0
print(ans1,a)
Problem p03106 (python)

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

lis=[]
if a>b:
    for i in range(b):
        if a%int(b-i)==0 and b%int(b-i)==0:
            lis.append(int(b-i))

else:
    for i in range(a):
        if a%(a-i)==0 and b%(a-i)==0:
            lis.append(int(a-i))

#print(lis)
print(lis[c-1])

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

lis=[]
if a>b:
    for i in range(b):
        if a%(b-i)==0 and b%(b-i)==0:
            lis.append(b-i)

else:
    for i in range(a):
        if a%(b-i)==0 and b%(b-i)==0:
            lis.append(b-i)

print(lis[c-1])
Problem p02705 (python)

Fixed submission:
r = int(input())
import math
print(math.pi * r * 2)

Buggy submission (verdict: Runtime Error):
r = int(input())
import math
print(math.pi * R * 2)
Problem p02761 (python)

Fixed submission:
n, m = map(int, input().split())
if m == 0:
  if n == 1:
    print(0)
    exit()
  else:
    print(pow(10,n-1))
    exit()
num = 0
dic = {}
for i in range(m):
  s_tmp, c_tmp = list(map(int, input().split()))
  if s_tmp in dic:
    if dic[s_tmp] != c_tmp:
      print(-1)
      exit()
    else:
      continue
  dic[s_tmp] = c_tmp

if 1 in dic:
  if dic[1] == 0:
    if n != 1:
      print(-1)
      exit()
    else:
      print(0)
      exit()
else:
  num = pow(10,n-1)
for i in range(1,n+1):
  if i in dic:   
    num += dic[i] * pow(10, n-i)

      
print(num)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
if m == 0:
  if n == 1:
    print(0)
    exit()
  else:
    print(pow(10,n-1))
    exit()
  
dic = {}
for i in range(m):
  s_tmp, c_tmp = list(map(int, input().split()))
  if s_tmp in dic:
    if dic[s_tmp] != c_tmp:
      print(-1)
      exit()
    else:
      continue
  dic[s_tmp] = c_tmp
  
if dic[1] == 0:
  if n != 1:
    print(-1)
    exit()
  else:
    print(0)
    exit()

num = 0
for i in range(1,n+1):
  if i in dic:
    num += dic[i] * pow(10, n-i)
print(num)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
dic = {}
for i in range(m):
  s_tmp, c_tmp = list(map(int, input().split()))
  if s_tmp in dic:
    if dic[s_tmp] != c_tmp:
      print(-1)
      exit()
    else:
      continue
  dic[s_tmp] = c_tmp
  
if dic[1] == 0:
  if n != 1:
    print(-1)
    exit()
  else:
    print(0)

num = 0
for i in range(1,n+1):
  if i in dic:
    num += dic[i] * pow(10, n-i)
print(num)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
dic = {}
for i in range(m):
  s_tmp, c_tmp = list(map(int, input().split()))
  if s_tmp in dic:
    if dic[s_tmp] != c_tmp:
      print(-1)
      exit()
    else:
      continue
  dic[s_tmp] = c_tmp
  
if dic[1] == 0:
  if n != 1:
    print(-1)
    exit()
  else:
    print(0)

num = 0
for i in range(1,n+1):
  if i in dic:
    num += dic[i] * pow(10, n-i)
print(num)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
dic = {}
for i in range(m):
  s_tmp, c_tmp = list(map(int, input().split()))
  if s_tmp in dic:
    if dic[s_tmp] != c_tmp:
      print(-1)
      exit()
    else:
      continue
  dic[s_tmp] = c_tmp
  
if dic[1] == 0:
  print(-1)
  exit()

num = 0
for i in range(1,n+1):
  if i in dic:
    num += dic[i] * pow(10, n-i)
print(num)