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

Fixed submission:
from math import sqrt

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

divisor = set([])
for i in range(1,int(sqrt(M))+1):
	if M % i == 0:
		if i <= int(M / N):
			divisor.add(i)
		if (M // i) <= int(M / N):
			divisor.add(M // i)

print(max(divisor))

Buggy submission (verdict: Runtime Error):
#python D-Partition.py
"""
入力フォーマット
N M

出力:a_1+...+a_N=Mを満たす数列aについてmax(GCD(a_1,...,a_N))
"""
import math
line = list(map(int, input().split(" ")))
N = int(line[0])
M = int(line[1])

#TLE(実行時間制限超過)のコード
"""
for i in range(math.floor(M/N),0,-1):
	tmp = M-i*(N-1)
	if tmp%i==0:
		print(i)
		break
"""

#TLEを何とかしたコード（ポイント：素数判定と同じ要領で探索範囲をO(sqrt(M))にした
for i in range(sqrt(M)):
	tmp = M-(math.floor(M/N)-i)*(N-1)
	if tmp%(math.floor(M/N)-i)==0:
		print((math.floor(M/N)-i))
		break
Problem p03262 (python)

Fixed submission:
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    else:
        while True:
            r = a % b
            if r == 0:
                return b
            else:
                a,b = b,r

def GCD(A):
    if len(A) == 1:
        return A[0]
    elif len(A) == 2:
        g = gcd(A[0],A[1])
    else:
        g = gcd(A[0],A[1])
        for i in range(2,len(A)):
            g = gcd(g,A[i])
    return g

N,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)

x.sort()
for i in reversed(range(N+1)):
    x[i] -= x[0]

ans = GCD(x)
print(ans)

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

def GCD(A):
    if len(A) == 1:
        return A[0]
    elif len(A) == 2:
        g = gcd(A[0],A[1])
    else:
        g = gcd(A[0],A[1])
        for i in range(2,len(A)):
            g = gcd(g,A[i])
    return g

N,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)

x.sort()
for i in reversed(range(N+1)):
    x[i] -= x[0]

ans = GCD(x)
print(ans)
Problem p03472 (python)

Fixed submission:
from math import ceil

def attack(ab,N,H):
    cut_max = 0
    for i in range(N):
        cut_max = max(cut_max,ab[i][0])

    throw = [ab[i][1] for i in range(N)]
    throw.sort(reverse = True)
    throw.append(0)

    cnt,pt = 0,0
    while H > 0:
        if throw[pt] > cut_max:
            H -= throw[pt]
            cnt += 1
            pt += 1
        else:
            cnt += (ceil(H/cut_max))
            H = 0

    return cnt

def main():
    N,H = map(int,input().split())
    ab = [list(map(int,input().split())) for _ in range(N)]

    print(attack(ab,N,H))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from math import ceil

def attack(AB,H,N):
    AB.sort(key = lambda x:x[1])
    count = 0
    while H > 0:
        if AB[N-1][1] >= H:
            count += 1
            H = 0
            N -= 1
        elif len(AB) >= 2:
            if AB[N-1][0] >= AB[N-2][1]:
                num = ceil((H-AB[N-1][1])/AB[N-1][0])
                H -= num*AB[N-1][0]
                count += num
            else:
                count += 1
                H -= AB[N-1][1]
                N -= 1
        else:
            num = ceil((H-AB[N-1][1])/AB[N-1][0])
            H -= num*AB[N-1][0]
            count += num

    return count

def main():
    N,H = map(int,input().split())
    AB = [list(map(int,input().split())) for _ in range(N)]

    print(attack(AB,H,N))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def attack(AB,H,N):
    AB.sort(key = lambda x:x[1])
    count = 0
    while H > 0:
        if AB[N-1][1] >= H:
            count += 1
            H = 0
            N -= 1
        elif len(AB) >= 2:
            if AB[N-1][0] >= AB[N-2][1]:
                num = (H-AB[N-1][1])//AB[N-1][0]
                H -= num*AB[N-1][0]
                count += num
                if H > AB[N-1][1]:
                    H -= AB[N-1][0]
                    count += 1
            else:
                count += 1
                H -= AB[N-1][1]
                N -= 1
        else:
            num = (H-AB[N-1][1])//AB[N-1][0]
            H -= num*AB[N-1][0]
            count += num
            if H > AB[N-1][1]:
                H -= AB[N-1][0]
                count += 1

    return count

def main():
    N,H = map(int,input().split())
    AB = [list(map(int,input().split())) for _ in range(N)]

    print(attack(AB,H,N))

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

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

check = True
for i in range(x+1) :
  if (i*2+(x-i)*4) == y :
    print("Yes")
    check = False
    break
  
if check :
  print("No")

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

if n == 0:
  print(x)
else :
  pn = [int(num) for num in input().split()]
  answers = {}
  for i in range(0,101):
    if not i in pn:
      answers[i] = abs(i-x)
  print(min(answers, key=answers.get))
Problem p02922 (python)

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

ans = 1
i = 0
while ans < B:
    ans += A - 1
    i += 1

print(i)

Buggy submission (verdict: Runtime Error):
a, b =map(int,input().split())
answer = 1
num = 0
while (answer < b) :
  anwer += a - 1
  num += 1
  
print(num)

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

answer = 1
num = 0
while(answer < b):
  anwer += a - 1
  num += 1
    
print(num)

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

answer = 1
num = 0
while(answer < b):
  anwer += a - 1
    num += 1
    
print(num)

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

answer = 1
num = 0
while(answer < b):
  anwer += a - 1
    num += 1
    
print(num)
Problem p03101 (python)

Fixed submission:
hh, ww = map(int, input().split())
h, w = map(int, input().split())

print(int((hh-h)*(ww-w)))

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

if len(set(l)) != n :
    print("No")
    exit()

for i in range(n-1) :
    if l[i][-1] != l[i+1][0]:
        print("No")
        exit()

print("Yes")
Problem p03106 (python)

Fixed submission:
a, b, k = map(int, input().split())
 
num = min(a, b)
answer = []
for i in range(1, num+1):
    if (a % i == 0 and b % i == 0):
        answer.append(i)
        
print(answer[-k])

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

def divisor(num):
    num_l = []
    if (num == 1) :
        return [1]
    else :
        for i in range(1,num):
            if (num % i == 0):
                num_l.append(i)
        return num_l

a_l = divisor(a)
b_l = divisor(b)

two_divisor = []
for c in a_l :
    if c in b_l :
        two_divisor.append(c)

print(two_divisor[n-1])
Problem p03260 (python)

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

if (a%2 == 1 ) and (b%2 == 1 ) :
    print("Yes")
else :
    print("No")

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

for c in range(1,4) :
    if (a*b*c)%2 == 1 :
        print("Yes")
        sys.exit(0)

print("No")

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

for c in range(1,4) :
    if (a*b*c)%2 == 1 :
        print("Yes")
        sys.exit()

print("No")
Problem p03423 (python)

Fixed submission:
a = int(input())
print(int(a/3))

Buggy submission (verdict: Runtime Error):
print(int(input()/3))
Problem p02555 (python)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
s = int(input())
mod = 10**9 + 7
a_list = [0] * (2000 + 1)
a_list[0] = 1
a_list[1] = 0
a_list[2] = 0
a_list[3] = 1
for i in range(4, s + 1):
    a_list[i] = a_list[i - 1] + a_list[i - 3]
    a_list[i] %= mod
print(a_list[s])

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
s = int(input())
mod = 10**9 + 7
a_list = [0] * (s + 1)
a_list[0] = 1
a_list[1] = 0
a_list[2] = 0
a_list[3] = 1
for i in range(4, s + 1):
    a_list[i] = a_list[i - 1] + a_list[i - 3]
    a_list[i] %= mod
print(a_list[s])
Problem p02743 (python)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import math
a, b, c = map(int, input().split())
if 0 < (c - a - b) and 4 * a * b < (c - a - b)**2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import math
a, b, c = map(int, input().split())
flag = 0
if a**(1 / 2) + b**(1 / 2) < c**(1 / 2):
    flag = 1
elif a**(1 / 2) + b**(1 / 2) > c**(1 / 2)
    flag = 0
else:
    flag = 1
    

if flag == 1:
    print("Yes")
else:
    print("No")
Problem p03493 (python)

Fixed submission:
abc = input()
x = 0
for i in range(0,3):
  if abc[i] == "1":
  	x += 1
print(x)

Buggy submission (verdict: Runtime Error):
abc = input()
x = 0
for i range(0,3):
  if abc[i] == "1":
  	x += 1
print(x)
Problem p03496 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
count = 0
outs = []
max_a = max(a)
max_index = a.index(max(a))
min_a = min(a)
min_index = a.index(min(a))
flag = -1
if 0 <= min_a:
  flag = 0
elif max_a <= 0:
  flag = n
elif max_a > -1 * min_a:
  flag = 0
  for i in range(0,n):
    if a[i] < 0:
      a[i] += max_a
      outs.append(str(max_index + 1) + " " + str(i + 1))
      count += 1
elif max_a <= -1 * min_a:
  flag = n
  for i in range(0,n):
    if a[i] > 0:
      a[i] += min_a
      outs.append(str(min_index + 1) + " " + str(i + 1))
      count += 1

if flag == 0:
  for i in range(0, n-1):
    a[i+1] += a[i]
    outs.append(str(i + 1) + " " + str(i + 1 + 1))
    count += 1
elif flag == n:
  for i in range(1, n):
    a[n-i-1] += a[n-i]
    outs.append(str(n - i + 1) + " " + str(n - i - 1 + 1))
    count += 1
    
print(count)
for out in outs:
  print(out)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
count = 0
outs = []
max_a = max(a)
max_index = a.index(max(a))
min_a = min(a)
min_index = a.index(min(a))
flag = -1
if 0 <= min_a:
  flag = 0
elif max_a <= 0:
  flag = n
elif max_a > -1 * min_a:
  flag = 0
  for i in range(0,n):
    if a[i] < 0:
      a[i] += max_a
      outs.append(str(max_index + 1) + " " + str(i + 1))
      count += 1
elif max_a < -1 * min_a:
  flag = n
  for i in range(0,n):
    if a[i] > 0:
      a[i] += min_a
      outs.append(str(min_index + 1) + " " + str(i + 1))
      count += 1

if flag == 0:
  for i in range(0, n-1):
    a[i+1] += a[i]
    outs.append(str(i + 1) + " " + str(i + 1 + 1))
    count += 1
elif flag == n:
  for i in range(0, n-1):
    a[n-i-1] += a[n-i]
    outs.append(str(n - i + 1) + " " + str(n - i - 1 + 1))
    count += 1
    
print(count)
for out in outs:
  print(out)
Problem p02812 (python)

Fixed submission:
n = int(input())
s = input()
cnt = 0
for i in range(n-2):
    if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
cnt = 0
for i in range(n):
    if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
cnt = 0
for i in range(n):
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                cnt += 1
print(cnt)
Problem p03206 (python)

Fixed submission:
d = int(input())
if d==25:
  print("Christmas")
elif d==24:
  print("Christmas Eve")
elif d==23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
d = int(intput())
if d==25:
  print("Christmas")
elif d==24:
  print("Christmas Eve")
elif d==23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")
Problem p03264 (python)

Fixed submission:
k = int(input())
odd = 0
for i in range(1, k+1):
  if i%2==0:
    odd += 1
even = k - odd
print(even * odd)

Buggy submission (verdict: Runtime Error):
k = int(input())
odd = 0
for i in range(1, k+1):
  if i%2==0*
  odd += 1
even = k - odd
print(even * odd)
Problem p03323 (python)

Fixed submission:
a,b = map(int, input().split())
if a<= 8 and b <= 8:
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a<= 8 and b <= 8:
  print("Yay!")
else:
print(":(")
Problem p03378 (python)

Fixed submission:
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input.split())
print(min(s,m-s))
Problem p03399 (python)

Fixed submission:
li = [int(input()) for i in range(4)]
a = min(li[0], li[1])
b = min(li[2], li[3])
print(a+b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(min(a,b) = min(c,d))
Problem p03469 (python)

Fixed submission:
s = input()
print(s[:3]+"8"+s[4:])

Buggy submission (verdict: Runtime Error):
s = input()
s = s.replece(s[3], "8")
print(s)
Problem p03493 (python)

Fixed submission:
s = input()
cnt = 0
for i in s:
  if i == '1':
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
s = input()
cnt = 0
for i in s:
  if i == '1':
    cnt += 1:
print(cnt)
Problem p03556 (python)

Fixed submission:
print(int(int(input())**.5)**2)

Buggy submission (verdict: Runtime Error):
c=1
for i in range(int(input())):
  if i**2<=n:c=i**2
print(c)
Problem p03606 (python)

Fixed submission:
n=int(input())
cnt=0
for i in range(n):
  a,b=map(int,input().split())
  cnt += b-a+1
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
cnt=0
for i in range(n):
  List=map(int,input().split())
  cnt += List[1]-List[0]+1
print(cnt)
Problem p03623 (python)

Fixed submission:
x,a,b = map(int, input().split())
A = max(x,a) - min(x,a)
B = max(x,b) - min(x,b)
if A > B:
    print("B")
else:
    print("A")

Buggy submission (verdict: Runtime Error):
x,a,b = map(int, input().split())
A = max(x,a) - min(x,a)
B = max(x,b - min(x,b)
if A > B:
    print("B")
else:
    print("A")
Problem p03679 (python)

Fixed submission:
x,a,b = map(int, input().split())
if b-a <= 0:
  print("delicious")
elif b-a <= x:
  print("safe")
else:
  print("dangerous")

Buggy submission (verdict: Runtime Error):
x,a,b = map(int, input().split())
if b-a <= 0:
  print("delicious")
elif b-a =< x:
  print("safe")
else:
  print("dangerous")
Problem p02628 (python)

Fixed submission:
N,K = map(int,input().split())
aa = list(map(int,input().split()))
aa.sort()
aaa = aa[:K]
print(sum(aaa))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input())
aa = list(map(int,input()))
aa.sort()
aaa = aa[:K]
print(sum(aaa))
Problem p02639 (python)

Fixed submission:
llist = list(map(int,input().split()))
print(llist.index(0)+1)

Buggy submission (verdict: Runtime Error):
X,N = map(int,input().split())
A = list(map(int,input().split()))
for d in range(X+1):
  for i in [-1, +1]:
    B = X + d*i
    if A.count(B) == 0:
      print(B)
      exit(0)

Buggy submission (verdict: Runtime Error):
X,N = map(int,input().split())
A = list(map(int,input().split()))
for d in range(X+1):
  for i in [+1,-1]:
    B = X + d*i
    if A.count(B) == 0:
      print(B)
      exit(0)
Problem p02761 (python)

Fixed submission:
import sys
N,M = map(int,input().split())
cc = [list(map(int, input().split())) for i in range(M)]
if [1,0] in cc:
  if N!= 1:
    print(-1)
    sys.exit()
a,b = [0]*N,['v']*N
for [i,j] in cc:
  a[i-1] = j
  if b[i-1] != 'v' and b[i-1] != j:
    print(-1)
    sys.exit()
  b[i-1] = j
if a[0] == 0:
  if N != 1:
    a[0] = 1
c = ''
for i in a:
  c = c + str(i)
print(c)

Buggy submission (verdict: Runtime Error):
import sys
N,M = map(int,input().split())
cc = [list(map(int, input().split())) for i in range(M)]
if [0,1] in cc:
  if N!= 1:
    print(-1)
    sys.exit()
a,b = [0]*N,['v']*N
for [i,j] in cc:
  a[i-1] = j
  if b[i-1] != 'v' or b[i-1] != j:
    print(-1)
    sys.exit
  b[i-1] = j
if a[0] = 0:
  a[0] = 1
c = ''
for i in a:
  c = c + str(i)
print(c)
Problem p03031 (python)

Fixed submission:
from itertools import product
N,M = map(int,input().split())
cc = []
for i in range(M):
  ll = list(map(int,input().split()))
  cc.append(ll)
p = list(map(int,input().split()))
count = 0
for i in product([0,1],repeat = N):
  bulb = []
  for j in range(M):
    on = 0
    for k in range(cc[j][0]):
      if i[cc[j][k+1]-1] == 1:
        on += 1
    if on % 2 == p[j]:
      bulb.append(1)
  if sum(bulb) == M:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
from itertools import product
N,M = map(int,input().split())
cc = []
for i in range(M):
  ll = list(map(int,input().split()))
  cc.append(ll)
p = list(map(int,input().split()))
count = 0
for i in product('01',repeat = N):
  on = 0
  bulb = 0
  for j in range(M):
    for k in range(cc[j][0]):
      if i[cc[m][l+1]-1] == 1:
        on += 1
    if on % 2 == p[j]:
      bulb += 1
  if bulb == M:
    count += 1
print(count)
Problem p02615 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = []
b = a+a+b
b.sort(reverse=1)
print(sum(b[2:n])+b[0])

Buggy submission (verdict: Runtime Error):
n = int(input())
a_li = list(map(int,input().split()))
a_li.sort(reverse=1)
if n == 2:
    print(a_li[0])
if n == 3:
    print(a_li[0]+a_li[1])

m = a_li[0]
l = a_li[1]
r = a_li[2]
ans = 0
ans += a_li[0]+a_li[1]
for i in range(3,n):
    if l < r:
        ans += l
        l = a_li[i]
    else:
        ans += r
        r = a_li[i]
print(ans)
Problem p02647 (python)

Fixed submission:
n,k_ = map(int,input().split())
a_li = list(map(int,input().split()))
a_li_o = [0]*n
for i in range(k_):
    for l in range(n):
        a_li_o[l] = a_li[l]
    dum_li = [0]*n
    for j in range(n):
        left = j - a_li[j]
        right = j + a_li[j] + 1
        if left < 0:
            left = 0
        dum_li[left] += 1
        if right > n-1:
            continue
        dum_li[right] -= 1
    total = 0
    for k in range(n):
        total += dum_li[k]
        dum_li[k] = total
    for k in range(n):
        a_li[k] = dum_li[k]
    if a_li_o == a_li:
        break
print(" ".join(map(str,a_li)))

Buggy submission (verdict: Runtime Error):
check
Problem p02660 (python)

Fixed submission:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
dum = prime_factorize(int(input()))
dum_len = len(dum)

num = 0
ans = 0
cnt = 0
check = 0
for i in range(dum_len):
    if num == dum[i]:
        cnt += 1
        if cnt >= check:
            check += 1
            ans += 1
            cnt = 0
    else:
        num = dum[i]
        ans += 1
        cnt = 0
        check = 2
print(ans)

Buggy submission (verdict: Runtime Error):
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
dum = prime_factorize(int(input()))
print(dum)
print(len(dum))
dum1 = 0
ans = 0
for i in range(len(dum)):
    if dum[i] == dum[i+1]:
        cnt += 1
    else:
        dum1 = 0
        cnt = 0
    if cnt > dum1:
        ans += 1
        cnt = 0
        dum1 += 1
print(ans)
Problem p02684 (python)

Fixed submission:
n,k = map(int,input().split())         # n=町の個数 , k=テレポート回数
a_list = list(map(int,input().split()))     # 各町のテレポート先リスト
dum = a_list[0]                        # dum=次のテレポート先
k = k - 1                              # テレポート回数をデクリメント
ans_list = [1]                         # 訪れた町を ans_list に格納
ok = True
check_list = n*[0]
check_list[0] = 1
for i in range(k+1):
    if ok and check_list[dum-1] == 1:
        #print(dum,111)
        ind = ans_list.index(dum)
        loop = ans_list[ind:]
        len_loop = len(loop)
        k = k % len_loop
        ans_list = []
        ok = False
    else:
        check_list[dum-1] = 1

    if k == 0:
        print(int(dum))
        break
    ans_list.append(dum)
    dum = a_list[int(dum)-1]
    k = k - 1

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())         # n=町の個数 , k=テレポート回数
a_list = map(list(input().split()))         # 各町のテレポート先リスト
dum = a_list[0]                        # dum=次のテレポート先
k = k - 1                              # テレポート回数をデクリメント
ans_list = [1]                         # 訪れた町を ans_list に格納
while(1):
    #print(dum,ans_list)
    if ans_list.count(dum) == 1:
        ind = ans_list.index(dum)
        loop = ans_list[ind:]
        len_loop = len(loop)
        k = k % len_loop
        ans_list = []
        #print("ok")

    if k == 0:
        print(int(dum))
        break
    ans_list = ans_list.append(dum)
    dum = a_list[int(dum)-1]
    k = k - 1

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
a_list = list(map(int,input().split()))
dum = a_list[0]
ans_list = []
for i in range(1,k+1):
    k = k - 1
    ans_list.append(str(dum))
    dum = a_list[dum-1]
    if ans_list.count(str(dum)) == 1:
        break
#print(k)
#print(ans_list)
ind = ans_list.index(str(dum))
loop = ans_list[ind:]
len_loop = len(loop)
loop_after = k%len_loop
print(loop[loop_after-1])
#print(ans_list[1:])
#rint(ans_list)
#print(dum)
#print(ind)
Problem p02696 (python)

Fixed submission:
import math
a,b,n = map(int,input().split())
if b-1 <= n:
    print(math.floor((a*(b-1))/b)-(a*math.floor((b-1)/b)))
else:
    print(math.floor((a * (n)) / b) - (a * math.floor((n) / b)))

Buggy submission (verdict: Runtime Error):
import math
a,b,n = map(int,input().split())
ans = 0
baketu = [0]*(n+1)
for i in range(1,n+1):
    dum = math.floor(a*i/b)-(a*math.floor(i/b))
    if baketu[dum] >= 1:
        break
    baketu[dum] += 1
    ans = max(ans,dum)
print(ans)
Problem p02732 (python)

Fixed submission:
from collections import Counter
n = int(input())
num_list = list(map(int,input().split()))
a = Counter(num_list)
count = 0
for i in a.values():
  count += (i*(i-1))//2
for j in num_list:
  print(count-(a[j]-1))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
num_list = list(map(int,input().split()))
a = Counter(num_list)
count = 0
for i in a.values():
  count += (i*(i-1))//2
for j in num_list:
Problem p02741 (python)

Fixed submission:
mlist = list([1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51])
b = int(input())
print(mlist[b-1])

Buggy submission (verdict: Runtime Error):
import math
a, b, c = map(int, input().split())
ab = a * b
num = ((c-a-b)/2)**2
if ab < num:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math
a, b, c = map(int, input().split())
ab = a * b
num = ((c-a-b)/2**2)
if ab < num:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math
import decimal

num = decimal.Decimal(0)
a, b, c = map(int, input().split())
#a = decimal.Decimal(a)
#b = decimal.Decimal(b)
#c = decimal.Decimal(c)
ab =  decimal.Decimal(a) + decimal.Decimal(b) + decimal.Decimal(2 * (math.sqrt(a*b)))
#num = a + b + ab
if ab < c:
  print("Yes")
else:
  print("No")
Problem p02743 (python)

Fixed submission:
from decimal import Decimal
a, b, c = list(map(int,input().split()))
if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import Decimal
a, b, c = list(map(int,input().split()))
if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")