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

Fixed submission:
from sys import stdin
s = stdin.readline().strip()
ans = 'No'
if s.startswith('YAKI'):
 ans = 'Yes'
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
ans = 'No'
n,m,k = map(int,stdin.readline().split())
for i in xrange(n+1):
 for j in xrange(m+1):
  if i*m - b*j==k:
   ans = 'Yes'
print ans
Problem p03592 (python)

Fixed submission:
from sys import stdin
ans = 'No'
n,m,k = map(int,stdin.readline().split())
for i in xrange(n+1):
    for j in xrange(m+1):
        if i*m - 2*j*i + j*n==k:
            ans = 'Yes'
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
ans = 'No'
n,m,k = map(int,stdin.readline().split())
for i in xrange(n+1):
 for j in xrange(m+1):
  if i*m - b*j==k:
   ans = 'Yes'
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
ans = 'No'
n,m,k = map(int,stdin.readline())
for i in xrange(n+1):
 for j in xrange(m+1):
  if i*m - b*j==k:
   ans = 'Yes'
print ans
Problem p03597 (python)

Fixed submission:
from sys import  stdin
n = int(stdin.readline())
a = int(stdin.readline())
print n*n-a

Buggy submission (verdict: Runtime Error):
from sys import  stdin
n = in(stdin.readline())
a = int(stdin.readline())
print n*n-a
Problem p03611 (python)

Fixed submission:
from sys import stdin
di = {}
n = int(stdin.readline())
a = map(int,stdin.readline().split())
for i in a:
 di[i] = di.get(i,0) + 1
 di[i-1] = di.get(i-1,0) + 1
 di[i+1] = di.get(i+1,0) + 1
ans = -5
for i in di:
 if di[i] > di.get(ans,0):
  ans = i
print di[ans]

Buggy submission (verdict: Runtime Error):
from sys import stdin
di = {}
n = int(stdin.readline())
a = map(int,stdin.readline().split())
for i in a:
 di[i] = di.get(i,0) + 1
 di[i-1] = di.get(i-1,0) + 1
 di[i+1] = di.get(i+1,0) + 1
ans = -5
print di
for i in di:
 if di[i] > di.get(ans,0):
  ans = 
print di[ans]
Problem p03647 (python)

Fixed submission:
from sys import stdin
n,m = map(int,stdin.readline().split())
ans = 'IMPOSSIBLE'
di = set()
for i in xrange(m):
 x,y = map(int,stdin.readline().split())
 di.add((min(x,y),max(x,y)))
for i in xrange(2,n):
 fir = (1,i)
 sec = (i,n)
 if fir in di and sec in di:
  ans = 'POSSIBLE'; break
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
n,m = map(int,stdin.readline().split())
ans = 'IMPOSSIBLE'
di = set()
for i in xrange(m):
 x,y = map(int,stdin.readline().split())
 di.add((min(x,y),max(x,y))
for i in xrange(2,n):
 fir = (1,i)
 sec = (i,n)
 if fir in di and sec in di:
  ans = 'POSSIBLE'; break
print ans
Problem p03661 (python)

Fixed submission:
from sys import stdin
ma = 10**18
n = int(stdin.readline())
a = map(int,stdin.readline().split())
x = 0
s = sum(a)
for i in a[:-1]:
 x+= i
 ma  = min(ma, abs(s-2*x) )
print ma

Buggy submission (verdict: Runtime Error):
from sys import stdin
ma = 10**18
n = int(stdin.readline())
a = map(int,stdin.readline().split())
x = 0
s = sum(n)
for i in a[:-1]:
 x+= i
 ma  = min(ma, abs(s-2*x) )
print ma

Buggy submission (verdict: Runtime Error):
from sys import stdin
ma = 10**18
n = int(stdin.readline().split())
a = map(int,stdin.readline().split())
x = 0
s = sum(n)
for i in a[:-1]:
 x+= i
 ma  = min(ma, abs(s-2*x) )
print ma
Problem p03671 (python)

Fixed submission:
from sys import stdin
a = map(int,stdin.readline().split())
a.sort()
print a[0] + a[1]

Buggy submission (verdict: Runtime Error):
from sys import stdin
a = map(int,stdin.readline().split())
a.sort()
print a[0] + a[[1]
Problem p03672 (python)

Fixed submission:
from sys import stdin
s = stdin.readline().strip()
n = len(s)
n-=2
while True:
 if s[:n/2]== s[n/2:n]:
  break
 n-=2
print n

Buggy submission (verdict: Runtime Error):
from sys import stdin
s = stdin.readline().strip()
n = len(s)
n-=2
while True:
 if s[n/2]== s[n/2+1:n]:
  break
 n-=2
print n
Problem p03680 (python)

Fixed submission:
from sys import stdin 
a = [0]
n = int(stdin.readline())
for _ in xrange(n):
 a.append(int(stdin.readline()))
ans = -1
cur = 0
x = 1
s = set()
while True:
 if x in s:
  break
 if x==2:
  ans = cur
  break
 s.add(x)
 cur+=1
 x = a[x]
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin 
a = [0]
n = int(stdin.readline())
for _ in xrange(n):
 a.append(int(stdin.readline())
ans = -1
cur = 0
x = 1
s = set()
while True:
 if x in s:
  break
 if x==2:
  ans = cur
  break
 s.add(x)
 cur+=1
 x = a[x]
print ans
Problem p03693 (python)

Fixed submission:
from sys import stdin
ans = 'NO'
r,g,b = map(int,stdin.readline().split())
if (r*100 + g *10 + b) %4==0:
 ans = 'YES'
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
n = int(stdin.readline())
a  = map(int,stdin.readline().split())
ans = set()
co = 0
for i in a:
 if i < 3200:
  ans.add(i/400)
 else:
  co += 1
print  max(1,len(ans)),len(ans) + co
Problem p03738 (python)

Fixed submission:
from sys import stdin
a = int(stdin.readline())
b = int(stdin.readline())
ans = 'GREATER'
if a < b:
 ans = 'LESS'
elif a==b:
 ans = 'EQUAL'
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
a = int(stdin.readline())
b = int(stdin.readline())
ans = 'GREATER'
if a < b:
 ans = 'LESS'
elilf a==b:
 ans = 'EQUAL'
print ans
Problem p03761 (python)

Fixed submission:
from sys import stdin
n = int(stdin.readline())
a = []
for _ in xrange(n):
    s = stdin.readline().strip()
    di = {}
    for i in s:
        di[i] = di.get(i,0) + 1
    a.append(di)       
ans = ''
b = 'abcdefghijklmnopqrstuvwxyz'
for i in b:
    x = 10**5
    for yy in a:
        x = min(x, yy.get(i,0))
    ans += x*i
print ans

Buggy submission (verdict: Runtime Error):
    from sys import stdin
    n = int(stdin.readline())
    a = []
    for _ in xrange(n):
        s = stdin.readline().strip()
        di = {}
        for i in s:
            di[i] = di.get(i,0) + 1
        a.append(di)       
    ans = ''
    b = 'abcdefghijklmnopqrstuvwxyz'
    for i in b:
        x = 10**5
        for yy in a:
            x = min(x, yy.get(i,0))
        ans += x*i
    print ans
Problem p03762 (python)

Fixed submission:
from sys import stdin
n,m = map(int,stdin.readline().split())
a = map(int,stdin.readline().split())
b = map(int,stdin.readline().split())
a.sort()
b.sort()
x = []
y = []
for i in xrange(1,n):
    x.append(a[i] - a[i-1])
for i in xrange(1,m):
    y.append(b[i] - b[i-1])   
fir = 0
sec = 0
n = len(x)
m = len(y)
for i in xrange(n):
    fir += (i+1) * (n-i)*x[i]
for i in xrange(m):
    sec += (i+1) * (m-i) * y[i]
mod = 10**9 + 7
print (fir * sec)%mod

Buggy submission (verdict: Runtime Error):
    from sys import stdin
    n,m = map(int,stdin.readline().split())
    a = map(int,stdin.readline().split())
    b = map(int,stdin.readline().split())
    a.sort()
    b.sort()
    x = []
    y = []
    for i in xrange(1,n):
        x.append(a[i] - a[i-1])
    for i in xrange(1,m):
        y.append(b[i] - b[i-1])   
    fir = 0
    sec = 0
    n = len(x)
    m = len(y)
    for i in xrange(n):
        fir += (i+1) * (n-i)*x[i]
    for i in xrange(m):
        sec += (i+1) * (m-i) * y[i]
    mod = 10**9 + 7
    print (fir * sec)%mod
Problem p03970 (python)

Fixed submission:
from sys import stdin
a = 'CODEFESTIVAL2016'
l = len(a)
b = stdin.readline().strip()
ans = 0
for i in xrange(l):
 if a[i]!=b[i]:
  ans+=1
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
a = 'CODEFESTIVAL2016'
l = len(a)
b = stdin.readline().strip()
ans = 0
for i in xrange(l):
 if a[l]!=b[l]:
  ans+=1
print ans
Problem p03101 (python)

Fixed submission:
the_string = raw_input()
COLS, ROWS = the_string.split()
two_string = raw_input()
co, ro = two_string.split()


Mylist= [[0 for cols in range(int(COLS))] for rows in range(int(ROWS))]

for cols in range(int(co)):
        for rows in range(int(ROWS)):
                Mylist[rows][cols]=1

for rows in range(int(ro)):
        for cols in range(int(COLS)):
                Mylist[rows][cols]=1

d = sum(row.count(0) for row in Mylist)

print(d)

Buggy submission (verdict: Runtime Error):
the_string = raw_input()
COLS, ROWS = the_string.split()
two_string = raw_input()
co, ro = two_string.split()


Mylist= [[0 for cols in range(int(COLS))] for rows in range(int(ROWS))]

for cols in range(int(co)):
        for rows in range(int(ROWS)):
                Mylist[rows][cols]=1

for rows in range(int(ro)):
        for cols in range(int(COLS)):
                Mylist[rows][cols]=1

d = sum(row.count(0) for row in Mylist)

print(d)
Problem p03106 (python)

Fixed submission:
def divde(argv):

    dlist=[]
    i = 1
    for i in range (1,int(argv)+1):
        if(int(argv)%i==0):
            dlist.append(i)
    return dlist

def compare(A,B):
    D =[]
    for i in range (len(A)):
        for j in range(len(B)):
            if A[i]==B[j]:
                D.append(B[j])
    return D

if __name__ == "__main__":
    string = input()
    a, b, c = string.split()

    A = []
    A = divde(a)
    B = []
    B = divde(int(b))
    D = []
    D = compare(A,B)

    D.reverse()

    q = int(c)-1
    print(D[q])

Buggy submission (verdict: Runtime Error):
def divde(argv):

    dlist=[]
    i = 1
    for i in range (1,int(argv)+1):
        if(int(argv)%i==0):
            dlist.append(i)
    return dlist

def compare(A,B):
    D =[]
    for i in range (len(A)):
        for j in range(len(B)):
            if A[i]==B[j]:
                D.append(B[j])
    return D

if __name__ == "__main__":
    string = input()
    a, b, c = string.split()

    A = []
    A = divde(a)
    B = []
    B = divde(int(b))
    D = []
    D = compare(A,B)

    D.reverse()

    q = D.index(int(c))
    print(q+1)

Buggy submission (verdict: Runtime Error):
def divde(argv):

    dlist=[]
    i = 1
    for i in range (1,int(argv)+1):
        if(int(argv)%i==0):
            dlist.append(i)
    return dlist

def compare(A,B):
    D =[]
    for i in range (len(A)):
        for j in range(len(B)):
            if A[i]==B[j]:
                D.append(B[j])
    return D

if __name__ == "__main__":
    string = input()
    a, b, c = string.split()

    A = []
    A = divde(a)
    B = []
    B = divde(int(b))
    D = []
    D = compare(A,B)

    D.reverse()

    q = D.index(int(c))
    print(q+1)
Problem p03105 (python)

Fixed submission:
l = list(map(int, input().split()))
a, b, c = l[0], l[1], l[2]

if b/a>c:
  print(c)
else:
  print(int(b/a))

Buggy submission (verdict: Runtime Error):
l = list(map(int, input().split()))
l1 = []
a, b, c = l[0], l[1], l[2]
m = min(a,b)

for i in range(1, m+1):
  if a%i==0 and b%i==0:
    l1.append(i)

print(sorted(set(l1))[c-1])

Buggy submission (verdict: Runtime Error):
l = list(map(int, input().split()))
l1 = []
a, b, c = l[0], l[1], l[2]
m = min(a,b)

for i in range(1, m+1):
  if a%i==0 and b%i==0:
    l1.append(i)

print(sorted(set(l1))[c-1])
Problem p03101 (python)

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

Buggy submission (verdict: Runtime Error):
    a, b = map(int, input().split())
    c, d = map(int, input().split())
    if (a*b)==(c*d):
     print((a*b)-(c*d))
    elif (a*b) > (c*d):
     print(c*d)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c, d = map(int, input().split())
if (a*b)==(c*d):
 print((a*b)-(c*d))
else if (a*b) > (c*d):
 print(c*d)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c, d = map(int, input().split())
if (a*b)==(c*d):
 print((a*b)-(c*d))
else if (a*b) > (c*d):
 print((c*d))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c, d = map(int, input().split())
if (a*b)==(c*d):
 print("0")
else if (a*b ) > (c*d):
  print(c*d)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c, d = map(int, input().split())
if (a*b)==(c*d):
 print((a*b)-(c*d))
else if (a*b ) > (c*d):
  print((c*d))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c, d = map(int, input().split())
if (a*b)==(c*d):
 print((a*b)-(c*d))
elseif (a*b ) > (c*d):
  print((c*d))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c, d = map(int, input().split())
[print("0") if (a*b)=(c*d) else print(c*d)]
Problem p03112 (python)

Fixed submission:
import bisect
a, b, q = list(map(int, input().split()))
s = [int(input()) for _ in range(a)]
t = [int(input()) for _ in range(b)]
x = [int(input()) for _ in range(q)]
s.sort()
t.sort()
for i in x:
    si = bisect.bisect(s, i)
    ti = bisect.bisect(t, i)
    sl = s[si-1] if si > 0 else s[0]
    sr = s[si] if si < a else s[-1]
    tl = t[ti-1] if ti > 0 else t[0]
    tr = t[ti] if ti < b else t[-1]
    print(min(
        abs(i-sl)+abs(sl-tl),
        abs(i-sl)+abs(sl-tr),
        abs(i-sr)+abs(sr-tl),
        abs(i-sr)+abs(sr-tr),
        abs(i-tl)+abs(sl-tl),
        abs(i-tl)+abs(sr-tl),
        abs(i-tr)+abs(sl-tr),
        abs(i-tr)+abs(sr-tr),
    ))

Buggy submission (verdict: Runtime Error):
import bisect
a, b, q = list(map(int, input().split()))
s = [int(input()) for _ in range(a)]
t = [int(input()) for _ in range(b)]
x = [int(input()) for _ in range(q)]
s.sort()
t.sort()
for i in x:
    si = bisect.bisect(s, i)
    ti = bisect.bisect(t, i)
    sl = s[si-1] if si > 0 else s[0]
    sr = s[si] if si < a else s[-1]
    tl = t[ti-1] if ti > 0 else t[0]
    tr = t[ti] if ti < a else t[-1]
    print(min(
        abs(i-sl)+abs(sl-tl),
        abs(i-sl)+abs(sl-tr),
        abs(i-sr)+abs(sr-tl),
        abs(i-sr)+abs(sr-tl),
        abs(i-tl)+abs(sl-tl),
        abs(i-tl)+abs(sr-tl),
        abs(i-tr)+abs(sl-tr),
        abs(i-tr)+abs(sr-tr),
    ))
Problem p03280 (python)

Fixed submission:
a, b = [int(x) for x in input().split()]
 
print(a * b - a - b + 1)

Buggy submission (verdict: Runtime Error):
a, b = [int(x) for x in input().split()]

return a * b - a - b + 1
Problem p03437 (python)

Fixed submission:
import itertools


def main():
    x, y = map(int, input().split())
    if x % y == 0:
        result = -1
    else:
        result = next(filter(lambda i: i % y != 0, map(lambda i: i * x, itertools.count(1))))
    print(result)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    _ = input()
    a_list = map(int, input().split())
    b_list = map(int, input().split())
    diffs = map(lambda a, b: b - a, a_list, b_list)
    total = 0
    count = 0
    for diff in diffs:
        if diff > 0:
            count += diff // 2
            total += diff % 2
        else:
            count += -diff
            total += diff
    if count <= total:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    _ = input()
    a_list = map(int, input().split())
    b_list = map(int, input().split())
    diffs = map(lambda a, b: b - a, a_list, b_list)
    total = 0
    count = 0
    for diff in diffs:
        if diff > 0:
            count += (diff + 1) // 2
            total += diff % 2
        else:
            count += -diff
            total += diff
    if count >= total:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
Problem p03105 (python)

Fixed submission:
usr_input = input()
lst = usr_input.split()

a = int(lst[0])
b = int(lst[1])
c = int(lst[2])

if b//a < c:
    print(b//a)
else:
    print(c)

Buggy submission (verdict: Runtime Error):
usr_input = input()
lst = usr_input.split()

a = int(lst[0])
b = int(lst[1])
c = int(lst[2])

devider_a=[]
devider_b=[]
for i in range(1,a,1):
    if a%i == 0:
        devider_a.append(i)

for i in range(1,b,1):
    if b % i == 0:
        devider_b.append(i)

common_devider = []
for element in devider_a:
    for value in devider_b:
        if element==value:
            common_devider.append(value)

print(common_devider[c-1])
Problem p03101 (python)

Fixed submission:
H,W = [int(x) for x in input().split()]
h,w = [int(x) for x in input().split()]
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
n,m = [int(x) for x in input().split()]
l = [list(map(int,input().split())) for _ in range(n)]
l.sort()
cost = 0
for x in range(n):
    if m == 0:
        exit()
    if l[x][1] <= m:
        cost += l[x][0]*l[x][1]
    else:
        cost += l[x][0]*m
    m -= l[x][1]
print(cost)
Problem p03427 (python)

Fixed submission:
n = int(input())

for i in range(10)[::-1]:
	if n >= int(str(i) + '9'*(len(str(n))-1)):
		print(i + 9*(len(str(n))-1))
		break

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

if n < int("1" + "9"*(len(str(n))-1)):
	s = 9*(len(str(n))-1)
else:
	for i in range(1,10)[::-1]:
		if n > int(str(i) + "9"*(len(str(n))-1)):
			s = i + 9*(len(str(n))-1)
			break

print(s)
Problem p03471 (python)

Fixed submission:
#入力
N, Y = map(int, input().split())


#総当たりで合計金額を算出
x = []
y = []
z = []

for num_ten_thousand in range(0, N+1):
    for num_five_thousand in range(0, N+1):
            
            #千円の枚数を算出
            if N-(num_ten_thousand+num_five_thousand)>=0:
                num_one_thousand = N-(num_ten_thousand+num_five_thousand)
            
            #合計金額を算出
            total = num_ten_thousand*10000 + num_five_thousand*5000 + num_one_thousand*1000
            
            #（合計金額がYと等しいか・合計枚数がNと等しいか）を確認し答えをリストに格納
            if Y==total and N==num_ten_thousand+num_five_thousand+num_one_thousand:
                x.append(num_ten_thousand)
                y.append(num_five_thousand)
                z.append(num_one_thousand)
                
                
#答えを出力
if not x:
    print(-1, -1, -1, sep=" ")
    
else:
    print(x[0], y[0], z[0], sep=" ")

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

flag=0
for x in range(N+1):
	for y in range(N+1):
		z = N -(x + y)
		if 0<=z<=N and en_sum==Y:
			en_sum = 10000*x + 5000*y + 1000*z
			print(x, y, z)
			flag+=1
		break

if flag==0:
	print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
#入力
N = int(input())
Y = int(input())


#一万円の枚数を算出
if int(Y/10000)>0:
    x = int(Y/10000)
    
else:
    x = 0
    
    
#五千円の枚数を算出

#お年玉から万の位を除いた値
under_tenthousand = Y-x*10000

if int(under_tenthousand/5000)>0:
    y = int(under_tenthousand/5000)
    
else:
    y = 0
    
    
#千円の枚数を算出

#この時点でお年玉は五千円未満となっている
under_fivethousand = under_tenthousand-y*5000

if (under_fivethousand/1000)>0:
    z = under_fivethousand/1000
    
else:
    z = 0
    
    
#合計枚数の確認
if N==x+y+z:
    print(x, y, z, sep=" ")
    
else:
    print(-1, -1, -1, sep=" ")
Problem p03478 (python)

Fixed submission:
#入力
N, A, B = map(int, input().split())

#Nの範囲内の数値をリストに格納
N_list = list(range(1, N+1))

#条件に合うNの値を格納するリストを作成
N_match = []


#以下の処理をNの範囲で繰り返す
for n in N_list:
    
    #最後の処理（※）のためにnを別の値に代入しておく
    i = n

    #各桁の数値を求める
    #余りを格納するリストを作成
    R_list = []

    while True:
    
        #1の位の数値を算出しリストに順に格納
        R = n%10   
        R_list.append(R)    
    
        #10で割ることで、1の位を削る
        n = int(n/10)
    
        #1の位を削った時、N==0となった場合処理終了
        if n==0:
            break
    
    
    #あるnにおける各桁の和を算出
    R_sum = sum(R_list)
    
    #（※）条件に合致した時、その時のnをリストに格納
    if A<=R_sum<=B:
        N_match.append(i)
               
print(sum(N_match))

Buggy submission (verdict: Runtime Error):
#入力
N = int(input())
A = int(input())
B = int(input())

#Nの範囲内の数値をリストに格納
N_list = list(range(1, N+1))

#条件に合うNの値を格納するリストを作成
N_match = []


#以下の処理をNの範囲で繰り返す
for n in N_list:
    
    #最後の処理（※）のためにnを別の値に代入しておく
    i = n

    #各桁の数値を求める
    #余りを格納するリストを作成
    R_list = []

    while True:
    
        #1の位の数値を算出しリストに順に格納
        R = n%10   
        R_list.append(R)    
    
        #10で割ることで、1の位を削る
        n = int(n/10)
    
        #1の位を削った時、N==0となった場合処理終了
        if n==0:
            break
    
    
    #あるnにおける各桁の和を算出
    R_sum = sum(R_list)
    
    #（※）条件に合致した時、その時のnをリストに格納
    if A<=R_sum<=B:
        N_match.append(i)
               
print(sum(N_match))
Problem p03493 (python)

Fixed submission:
#0が1を3つ入力
a, b, c = map(int, input())

#aからcそれぞれが1と等しいかどうかを判断し、等しいのであれば順次iに1を足していく
i = 0

#aについて
if a==1:
    i += 1
    
#bについて
if b==1:
    i += 1    

#cについて
if c==1:
    i += 1
    
#出力
print(i)

Buggy submission (verdict: Runtime Error):
#0が1をスペース区切りで3つ入力
a, b, c = map(int, input().split())

#aからcそれぞれが1と等しいかどうかを判断し、等しいのであれば順次iに1を足していく
i = 0

#aについて
if a==1:
    i += 1
    
#bについて
if b==1:
    i += 1    

#cについて
if c==1:
    i += 1
    
#出力
print(i)
Problem p03101 (python)

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

area = math_line[0]*math_line[1]
black_cell = math_line[0]*input_line[1] + math_line[1]*input_line[0]
duplicate =  black_cell - input_line[0]*input_line[1]
white_cell = area - duplicate

print(white_cell)

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

area = math_line[0]*math_line[1]　

black_cell = math_line[0]*input_line[1] + math_line[1]*input_line[0] 
duplicate =  black_cell - input_line[0]*input_line[1]

white_cell = area - duplicate

print(white_cell)
Problem p03105 (python)

Fixed submission:
A,B,C = input().split()
result = min(int(int(B)/int(A)), int(C))
print(result)

Buggy submission (verdict: Runtime Error):
return math.min(math.floor(A/B), C)
Problem p03106 (python)

Fixed submission:
A,B,K = [int(i) for i in input().split()]
if (A>B):
    A,B=B,A
k=0
for i in reversed(range(1,A+1)):
    if (A % i == 0 and B % i == 0):
        k+=1
    if (k==K):
        print(i)
        break

Buggy submission (verdict: Runtime Error):
A,B,K = [int(i) for i in input().split()]
if (A>B):
    A,B=B,A
f=[]
j=A
for i in range(1,A):
    if (A % i == 0 and B % i == 0):
        if (i>=j):
            break
        j=int(A/i)
        f.append(i)
        if (i!=j and B % j == 0):
            f.append(j)
f.sort(reverse=True)
if len(f)==0:
    print(1)
else:
    print(f[K-1])

Buggy submission (verdict: Runtime Error):
A,B,K = [int(i) for i in input().split()]
if (A>B):
    A,B=B,A
f=[]
j=A
for i in range(1,A):
    if (A % i == 0 and B % i == 0):
        if (i>=j):
            break
        j=int(A/i)
        f.append(i)
        if (i!=j and B % j == 0):
            f.append(j)
f.sort(reverse=True)
if A==1:
    print(1)
else:
    print(f[K-1])

Buggy submission (verdict: Runtime Error):
A,B,K = [int(i) for i in input().split()]
if (A>B):
    A,B=B,A
f=[]
j=A
for i in range(1,A):
    if (i>=j):
        break
    if (A % i == 0 and B % i == 0):
        j=int(A/i)
        f.append(i)
        if (B % j == 0):
            f.append(j)
f.sort(reverse=True)
if A==1:
    print(1)
else:
    print(f[K-1])

Buggy submission (verdict: Runtime Error):
A,B,K = [int(i) for i in input().split()]
if (A>B):
    A,B=B,A
f=[]
j=A
for i in range(1,A):
    if (i>=j):
        break
    if (A % i == 0 and B % i == 0):
        j=int(A/i)
        f.append(i)
        if (B % j == 0):
            f.append(j)
f.sort()
if A==1:
    print(1)
else:
    print(f[K-1])

Buggy submission (verdict: Runtime Error):
A,B,K = [int(i) for i in input().split()]
if (A>B):
    A,B=B,A
f=[]
j=A
for i in range(1,A):
    if (i>=j):
        break
    if (A % i == 0 and B % i == 0):
        j=int(A/i)
        f.append(i)
        if (B % j == 0):
            f.append(j)
if A==1:
    print(1)
else:
    print(f[K-1])

Buggy submission (verdict: Runtime Error):
A,B,K = [int(i) for i in input().split()]
if (A>B):
    A,B=B,A
f=[]
j=A
k=0
for i in range(1,A):
    if (i>=j):
        break
    if (A % i == 0 and B % i == 0):
        j=int(A/i)
        f.insert(k,i)
        if (B % j == 0):
            f.insert(k,j)
        k+=1
if A==1:
    print(1)
else:
    print(f[K-1])