Problem p03106 (python)

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

def ooo(x):
    lix =[]
    for i in range(1, x+1):
        if x % i == 0:
            lix.append(i)
    return lix

lia = ooo(a)
lib = ooo(b)
li = lia + lib

li2 =[]
for n in range(len(li)):
    if not li[n] in li2: 
        if li.count(li[n]) == 2:
            li2.append(li[n])

li2.sort(reverse=True)
print(li2[k-1])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
li =[]
for i in range(1, min(a, b)):
    if a % i == 0 and b % i == 0:
        li.append(i)

print(li[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
li =[]
for i in range(1, min(a, b)):
    elif a % i == 0 and b % i == 0:
        li.append(i)

print(li[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
li =[]
cnt = 0
for i in range(max(a, b)):
    if i == 0:
        continue
    elif a % i == 0 and b % i == 0:
        li.append(i)
        cnt += 1
    elif cnt == k:
        break

print(li[-1])

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

def ooo(x):
    lix =[]
    for i in range(1, x+1):
        if x % i == 0:
            li.append(i)
    return lix

lia = ooo(a)
lib = ooo(b)
li = lia + lib

li2 =[]
for n in range(len(li)):
    if not li[n] in li2: 
        if li.count(li[n]) == 2:
            li2.append(li[n])

li2.sort(reverse=True)
print(li2[k-1])

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

def ooo(x):
    list =[]
    for i in range(1, x+1):
        if x % i == 0:
            li.append(i)
    return li

lia = ooo(a)
lib = ooo(b)
li = lia + lib

li2 =[]
for n in range(len(li)):
    if not li[n] in li2: 
        if li.count(li[n]) == 2:
            li2.append(li[n])

li2.sort(reverse=True)
print(li2[k-1])

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

for i in range(1, a):
    if a % i == 0:
        li.append(i)
    else:
        continue

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

li2 =[]
for n in range(len(li)):
    if not li[n] in li2: 
        if li.count(li[n]) == 2:
            li2.append(li[n])

li2.sort(reverse=True)
print(li2[k-1])

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

for i in range(1, a):
    if a % i == 0:
        li.append(i)
    else:
        continue

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

li2 =[]
for n in range(len(li)):
    if li.count(li[n]) == 2:
        li[n] = num
        li2.append(num)
        li.remove(num)
        li.remove(num)
    else:
        continue

li2.sort(reverse=True)
print(li2[k-1])

Buggy submission (verdict: Runtime Error):
for i in range(1, a):
    if a % i == 0:
        li.append(i)
    else:
        continue

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

li2 =[]
for n in range(len(li)):
    if li.count(li[n]) == 2:
        li[n] = num
        li2.append(num)
        li.remove(num)
        li.remove(num)
    else:
        continue

li2.sort(reverse=True)
print(li2[k-1])