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

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

targets = []
n_target_h = [0] * H
n_target_w = [0] * W

for i in range(M):
    h, w = map(int, input().split())
    targets.append((h, w))
    n_target_h[h - 1] += 1
    n_target_w[w - 1] += 1

h_max = max(n_target_h)
w_max = max(n_target_w)

bomb_h = [i + 1 for i, h in enumerate(n_target_h) if h == h_max]
bomb_w = [i + 1 for i, w in enumerate(n_target_w) if w == w_max]

count = len(bomb_h) * len(bomb_w)
for target in targets:
    if (n_target_h[target[0] - 1] == h_max) and (n_target_w[target[1] - 1] == w_max):
        count -= 1

if count > 0:
    ans = h_max + w_max
else:
    ans = h_max + w_max - 1

print(ans)

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

targets = []
n_target_h = [0] * H
n_target_w = [0] * W

for i in range(M):
    h, w = map(int, input().split())
    targets.append((h, w))
    n_target_h[h - 1] += 1
    n_target_w[w - 1] += 1
    h_max = max(h_max, n_target_h[h - 1])
    w_max = max(w_max, n_target_w[w - 1])

bomb_h = [i + 1 for i, h in enumerate(n_target_h) if h == h_max]
bomb_w = [i + 1 for i, w in enumerate(n_target_w) if w == w_max]

ans = h_max + w_max - 1
for h in bomb_h:
    for w in bomb_w:
        if not (h, w) in targets:
            ans = h_max + w_max
            break
    else:
        continue
    break

print(ans)

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

targets = [[0] * W for _ in range(H)]
n_target_h = [0] * H
n_target_w = [0] * W
h_max = 0
w_max = 0

for i in range(M):
    h, w = map(int, input().split())
    targets[h - 1][w - 1] = 1
    n_target_h[h - 1] += 1
    n_target_w[w - 1] += 1
    h_max = max(h_max, n_target_h[h - 1])
    w_max = max(w_max, n_target_w[w - 1])

bomb_h = [i + 1 for i, h in enumerate(n_target_h) if h == h_max]
bomb_w = [i + 1 for i, w in enumerate(n_target_w) if w == w_max]

ans = h_max + w_max - 1
for h in bomb_h:
    for w in bomb_w:
        if targets[h - 1][w - 1] == 0:
            ans = h_max + w_max
            break
    else:
        continue
    break

print(ans)

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

targets = [[0] * W for _ in range(H)]
n_target_h = [0] * H
n_target_w = [0] * W

for i in range(M):
    h, w = map(int, input().split())
    targets[h - 1][w - 1] = 1
    n_target_h[h - 1] += 1
    n_target_w[w - 1] += 1

h_max = max(n_target_h)
w_max = max(n_target_w)

bomb_h = [i + 1 for i, h in enumerate(n_target_h) if h == h_max]
bomb_w = [i + 1 for i, w in enumerate(n_target_w) if w == w_max]

ans = h_max + w_max - 1
for h in bomb_h:
    for w in bomb_w:
        if targets[h - 1][w - 1] == 0:
            ans = h_max + w_max
            break
    else:
        continue
    break

print(ans)
Problem p02570 (python)

Fixed submission:

input_line = input().split()

distance = int(input_line[0])
remain = int(input_line[1])
speed = int(input_line[2])

time = distance/speed

if time > remain:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
num = int(input())
input_line = input().split()

num_list = [int(input_line[i]) for i in range(num)]
law = 10 ** 9 + 7
sigma = 0
for i in range(num):
	num_a = num_list[i]
	temp_sum = 0
	for j in range(i+1,num):
		temp_sum += num_list[j]
    	
    
	sigma += num_a * temp_sum

sigma %= law
print(sigma)
Problem p02572 (python)

Fixed submission:
num = int(input())
input_line = input().split()

law = 10 ** 9 + 7
num_list = [int(input_line[i])%law for i in range(num)]

sigma = 0
temp_sum = 0
for j in range(num):
	temp_sum += num_list[j]

for i in range(num):
	num_a = num_list[i]
	temp_sum -= num_a
	sigma += num_a * temp_sum


sigma %= law
print(sigma)

Buggy submission (verdict: Runtime Error):
num = int(input())
input_line = input().split()

num_list = [int(input_line[i]) for i in range(num)]
law = 10 ** 9 + 7
sigma = 0
for i in range(num):
	num_a = num_list[i]
    temp_sum = 0
	for j in range(i+1,num):
		temp_sum += num_list[j]
    	
    
    sigma += num_a * temp_sum

sigma %= law
print(sigma)
Problem p02753 (python)

Fixed submission:
from collections import Counter
s=input()
c=Counter(s)
if(len(c.keys())==1):
    print ("No")
else:
    print ("Yes")

Buggy submission (verdict: Runtime Error):
from Collections import Counter
s=input()
c=Counter(s)
if(len(c.keys())==1):
  print ("No")
else:
  print ("Yes")
Problem p02785 (python)

Fixed submission:
N, K = input().split()
N = int(N)
K = int(K)
H = input().split()
H = [int(h) for h in H]
H.sort(reverse = True)
# print(H)
I = K if K <= N else N
for i in range(0, I):
    H[i] = 0
# print(H)
print(sum(H))

Buggy submission (verdict: Runtime Error):
N, K = input().split()
N = int(N)
K = int(K)
H = input().split()
H = [int(h) for h in H]
H.sort(reverse = True)
# print(H)
for k in range(0, K):
    H[k] = 0
# print(H)
print(sum(H))

Buggy submission (verdict: Runtime Error):
N, K = input().split()
N = int(N)
K = int(K)
H = input().split()
H = [int(h) for h in H]
H.sort()
for k in range(0, K-1):
    H[k] = 0
print(sum(H))
Problem p02627 (python)

Fixed submission:
alpha = input()

if alpha.isupper():
    print('A')
else:
    print('a')

Buggy submission (verdict: Runtime Error):
N = int(input())
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ans = ''

while N > 0:
    N-=1
    index = N%26
    ans = alpha[index] + ans
    N = N // 26
print(ans)
Problem p02629 (python)

Fixed submission:
import sys
input=lambda :sys.stdin.readline().rstrip()

def num2alpha(num):
    if num<=26:
        return chr(96+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(122)
    else:
        return num2alpha(num//26)+chr(96+num%26)

n = int(input())
print(num2alpha(n))

Buggy submission (verdict: Runtime Error):
from collections import *
from operator import mul

n = int(input())
A = list(map(int, input().split()))
q = int(input())


A_dic = Counter(A)
A_sum = sum(A)

for _ in range(q):
    b, c = map(int, input().split())
    tmp = A_dic[b]
    A_dic[c] += tmp
    A_dic[b] = 0
    A_sum += tmp*(c - b)
    print(A_sum)
Problem p02723 (python)

Fixed submission:
s = input()
if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys

def solve():
    input = lambda: sys.stdin.readline().rstrip()
    sys.setrecursionlimit(10 ** 7)
    mod = 10 ** 9 + 7
    
    def comb(n, r):
        if r > n: return 0
        return fac[n] * inv[r] * inv[n - r] % mod

    def dfs(v, Pa=-1):
        for u in to[v]:
            if u == Pa: continue
            dfs(u, v)
            size[v] += size[u]
            dp[v] *= dp[u] % mod
            dp[v] *= comb(size[v], size[u]) % mod
        size[v] += 1

    def bfs(v, Pa=-1, P_val=1, P_sz=0):
        ans[v] = P_val * dp[v] * comb(n - 1, P_sz) % mod
        for u in to[v]:
            if u == Pa: continue
            val = ans[v] * INV(dp[u] * comb(n - 1, size[u])) % mod
            bfs(u, v, val, n - size[u])

    n = int(input())
    to = [[] for _ in range(n)]
    for _ in range(n - 1):
        a, b = map(lambda x: int(x) - 1, input().split())
        to[a].append(b)
        to[b].append(a)

    fac = [1] * (n + 2)
    inv = [1] * (n + 2)

    for i in range(2, n + 1):
        fac[i] = fac[i - 1] * i % mod
    INV = lambda x: pow(x, mod - 2, mod)
    inv[n] = INV(fac[n])
    for i in range(n - 1, 1, -1):
        inv[i] = inv[i + 1] * (i + 1) % mod

    dp = [1] * n
    size = [0] * n
    ans = [0] * n

    dfs(0)
    bfs(0)
    print(*ans, sep='\n')

if __name__ == '__main__':
    solve()
Problem p02726 (python)

Fixed submission:
from collections import deque
import sys
input = sys.stdin.readline

f_inf = float('inf')

def push(v, d):
    if dist[v] != f_inf: return
    dist[v] = d
    que.append(v)

n, x, y = map(int, input().split())
x -= 1
y -= 1

ans = [0]*n
for sv in range(n):
    dist = [f_inf] * n
    que = deque([])
    push(sv, 0)

    while que:
        v = que.popleft()
        d = dist[v]+1
        if v-1 >= 0: push(v-1, d)
        if v+1 < n: push(v+1, d)
        if v == x: push(y, d)
        if v == y: push(x, d)

    for i in range(n):
        ans[dist[i]] += 1
        
for i in range(n):
    ans[i] = ans[i]//2

for i in range(1, n):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
from collections import Counter
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall

import sys
input = sys.stdin.readline

def flatten_2dim(array):
    return [item for sublist in array for item in sublist]

n, x, y = map(int, input().split())
f_inf = float('inf')
dist = [[f_inf] * n for _ in range(n)]
for i in range(n): dist[i][i] = 0

for i in range(n-1):
    dist[i][i+1] = 1
    dist[i+1][i] = 1

dist[x-1][y-1]=1
dist[y-1][x-1]=1

G = csgraph_from_dense(dist, null_value=10**9)
dist = floyd_warshall(G)

counter = Counter(flatten_2dim(dist))
counter = sorted(counter.most_common())[1:]

for key, val in counter:
    print(val//2)
for i in range(n - len(counter)-1):
    print(0)

Buggy submission (verdict: Runtime Error):
from collections import Counter
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall

import sys
input = sys.stdin.readline

def flatten_2dim(array):
    return [item for sublist in array for item in sublist]

n, x, y = map(int, input().split())
f_inf = float('inf')
dist = [[f_inf] * n for _ in range(n)]

for i in range(n-1):
    dist[i][i+1] = 1
    dist[i+1][i] = 1

dist[x-1][y-1]=1
dist[y-1][x-1]=1

G = csgraph_from_dense(dist, null_value=10**9)
dist = floyd_warshall(G)

counter = Counter(flatten_2dim(dist))
counter = sorted(counter.most_common())[1:]

for key, val in counter:
    print(val//2)
for i in range(n - len(counter)-1):
    print(0)
Problem p02759 (python)

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

Buggy submission (verdict: Runtime Error):
import math
math.ceil(n/2)
Problem p02879 (python)

Fixed submission:
A, B = map(int, input().split())
if A < 10 and B < 10:
    print(A*B)
else:
    print(-1)

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

for A in range(1, 10):
    for B in range(1, 10):
        if N == A*B:
            print('Yes')
            True
            break
if False:
  print('No')

Buggy submission (verdict: Runtime Error):
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)

    # divisors.sort()
    return divisors

N = int(input())
if make_divisors(N)[0] < 10 and make_divisors(N)[1] < 10:
    print('Yes')
else:
    print('No')
Problem p03332 (python)

Fixed submission:
mod = 998244353

def comb(n, r):
    if 2 * r > n: return comb(n, n-r)
    return fac[n] * inv[r] * inv[n-r] % mod

n, a, b, k = map(int, input().split())

fac = [1] * (n+2)
inv = [1] * (n+2)
for i in range(2, n+1):
    fac[i] = fac[i-1] * i % mod
inv[n] = pow(fac[n], mod - 2, mod)
for i in range(n-1, 1, -1):
    inv[i] = inv[i + 1] * (i + 1) % mod

ans = 0
for i in range(n+1):
    Num = (k-a*i)
    if (0 <= Num//b) and (Num//b <= n) and (Num%b == 0):
      j = Num//b 
      ans += comb(n, i) * comb(n, j) 
print(ans%mod)

Buggy submission (verdict: Runtime Error):
mod = 998244353

def comb(n, r):
    if 2 * r > n: return comb(n, n-r)
    return fac[n] * inv[r] * inv[n-r] % mod

n, a, b, k = map(int, input().split())

n_max = 3*10**5
fac = [1] * (n_max+2)
inv = [1] * (n_max+2)
for i in range(2, n+1):
    fac[i] = fac[i-1] * i % mod
inv[n] = pow(fac[n], mod - 2, mod)
for i in range(n-1, 1, -1):
    inv[i] = inv[i + 1] * (i + 1) % mod

ans = 0
for i in range(n+1):
    if (k-a*i) >= 0 and (k-a*i)%b == 0 :
      j = (k-a*i)//b 
      ans += comb(n, i) * comb(n, j) % mod

print(ans)

Buggy submission (verdict: Runtime Error):
mod = 998244353

def comb(n, r):
    if 2 * r > n: return comb(n, n-r)
    return fac[n] * inv[r] * inv[n-r] % mod

n, a, b, k = map(int, input().split())

fac = [1] * (n+2)
inv = [1] * (n+2)
for i in range(2, n+1):
    fac[i] = fac[i-1] * i % mod
inv[n] = pow(fac[n], mod - 2, mod)
for i in range(n-1, 1, -1):
    inv[i] = inv[i + 1] * (i + 1) % mod

ans = 0
for i in range(n+1):
    if (k-a*i) >= 0 and (k-a*i)%b == 0 :
      j = (k-a*i)//b 
      ans += comb(n, i) * comb(n, j) % mod

print(ans)

Buggy submission (verdict: Runtime Error):
mod = 998244353

def comb(n, r):
    if 2 * r > n: return comb(n, n-r)
    return fac[n] * inv[r] * inv[n-r] % mod

n, a, b, k = map(int, input().split())

fac = [1] * (n+2)
inv = [1] * (n+2)
for i in range(2, n+1):
    fac[i] = fac[i-1] * i % mod
inv[n] = pow(fac[n], mod - 2, mod)
for i in range(n-1, 1, -1):
    inv[i] = inv[i + 1] * (i + 1) % mod

ans = 0
for i in range(n+1):
    if (k-a*i) > 0 and (k-a*i)%b == 0 :
      j = (k-a*i)//b 
      ans += comb(n, i) * comb(n, j)% mod

print(ans)
Problem p03723 (python)

Fixed submission:
a, b, c = map(int, input().split())
 
if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
    print(0)
elif a == b == c:
    print(-1)
else:
    num = 0
    while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0):
        a, b, c = (b+c)/2, (a+c)/2, (a+b)/2
        num += 1
    print(num)

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

if a == b == c:
    print(-1)
    exit()

if a%2!=0 or b%2!=0 or c%2!=0:
  	print(0)
    exit()

N = (a+b+c)//3
cnt = 1
while N:
    if N%2 != 0: break
    N //= 2
    cnt += 1
    
print(cnt)
Problem p03745 (python)

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

ans = 1
x = 0

for i in range(n-1):
    if a[i] < a[i+1]:
        if x == -1:
            ans += 1
            x = 0
        elif x == 0:
            x = 1
    elif a[i] > a[i+1]:
        if x == 1:
            ans += 1
            x = 0
        elif x == 0:
            x = -1
print(ans)

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

ans = 1
x = 0

for i in range(n-1):
    if A[i] < A[i+1]:
        if x == -1:
            ans += 1
            x = 0
        elif x == 0:
            x = 1
    elif A[i] > A[i+1]:
        if x == 1:
            ans += 1
            x = 0
        elif x == 0:
            x = -1
print(ans)
Problem p03775 (python)

Fixed submission:
n = int(input())

def Check(x):
    cont= 0
    while x > 0:
        x = x//10
        cont += 1
    return cont

a = []
for i in range(1, int(n**0.5)+1):
    if n % i == 0:
        a.append(i)

a = max(a)
b = n//a

print(max(Check(a), Check(b)))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
b = []

for i in range(1, int(n**0.5)+10):
    if n % i == 0:
        a.append(i)
        if i != n//i:
            b.append(n//i)

def Check(x):
    cont= 0
    while x > 0:
        x = x//10
        cont += 1
    return cont

A = []
for i in a:
    A.append(Check(i))

B = []
for i in b:
    B.append(Check(i))

print(max(max(A), min(B)))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
b = []

for i in range(1, int(n**0.5)+1):
    if n % i ==0:
        a.append(i)
        if i != n//i:
            b.append(n//i)

def Check(x):
    cont= 0
    while x > 0:
        cont += 1
        x = x//10
    return cont

A = []
for i in a:
    A.append(Check(i))

B = []
for i in b:
    B.append(Check(i)) 

print(max(max(A), min(B)))
Problem p02835 (python)

Fixed submission:
a, b, c = map(int, input().split(' '))
print('win') if a + b + c <= 21 else print('bust')

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

testimony_dict = {}
for i in range(n):
    a = int(input())
    testimony_dict[i + 1] = []
    for j in range(a):
        xy = input().split(' ')
        testimony_dict[i + 1].append(xy)

max_valid_bin = ''
for i in range(2 ** n - 1, 0, -1):
    is_valid = True
    bin_i = format(i, '0{}b'.format(n))
    for j in range(1, len(bin_i) + 1):
        if bin_i[j - 1] == '1':
            for xy_list in testimony_dict[j]:
                if bin_i[int(xy_list[0]) - 1] != xy_list[1]:
                    is_valid = False
    if is_valid:
        max_valid_bin = bin_i
        break

print(len([i for i in max_valid_bin if i == '1']))

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

testimony_dict = {}
for i in range(n):
    a = int(input())
    testimony_dict[i + 1] = []
    for j in range(a):
        xy = input().split(' ')
        testimony_dict[i + 1].append(xy)

max_valid_bin = ''
for i in range(2 ** n - 1, 0, -1):
    is_valid = True
    bin_i = format(i, '0{}b'.format(n)
    for j in range(1, len(bin_i) + 1):
        if bin_i[j - 1] == '1':
            for xy_list in testimony_dict[j]:
                if bin_i[int(xy_list[0]) - 1] != xy_list[1]:
                    is_valid = False
    if is_valid:
        max_valid_bin = bin_i
        break

print(len([i for i in max_valid_bin if i == '1']))
Problem p02570 (python)

Fixed submission:
D, T, S = list(map(int, input().split()))


if S * T >= D:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n, m = list(map(int, input().split()))
am = []
bm = []
for _ in range(m):
    a, b = list(map(int, input().split()))
    am.append(a)
    bm.append(b)

groups = []
for ai, bi in zip(am, bm):
    ag = None
    bg = None
    for g, group in enumerate(groups):
        if ai in group:
            ag = g
        if bi in group:
            bg = g
    if ag is None:
        if bg is None:
            groups.append([ai, bi])
        else:
            groups[bg].append(ai)
    else:
        if bg is None:
            groups[ag].append(bi)
        else:
            if ag != bg:
                groups[ag].extend(groups[bg])
                del groups[bg]

# max_gr_len = 1
# for group in groups:
#     if max_gr_len < len(group):
#         max_gr_len = len(group)
max_gr_len = max([len(group) for group in groups] + [1])

print(max_gr_len)
Problem p02990 (python)

Fixed submission:
# import sys
# sys.setrecursionlimit(10000)

N, K = map(int, input().split())
mod = 10**9 + 7
# def cmb(n, r):
#     if n - r < r: r = n - r
#     if r == 0: return 1
#     if r == 1: return n

#     numerator = [n - r + k + 1 for k in range(r)]
#     denominator = [k + 1 for k in range(r)]

#     for p in range(2,r+1):
#         pivot = denominator[p - 1]
#         if pivot > 1:
#             offset = (n - r) % p
#             for k in range(p-1,r,p):
#                 numerator[k - offset] /= pivot
#                 denominator[k] /= pivot

#     result = 1
#     for k in range(r):
#         if numerator[k] > 1:
#             result *= int(numerator[k])

#     return result


def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


for i in range(1, K+1):
    # print(cmb(N-K+1, i) , cmb(K-1, i-1))
    ans = cmb(N-K+1, i, mod) * cmb(K-1, i-1, mod) % mod
    print(ans)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
mod = 10**9 + 7
ans = 0

f = 1
for i in range(1, n+1):
  f *= i
  f %= mod
     
# n!^-1 の計算
inv = pow(f, mod - 2, mod)
# n!^-1 - 1!^-1 の計算
invs = [1] * (n + 1)
invs[n] = inv
for m in range(n, 1, -1):
    inv *= m
    inv %= mod
    invs[m - 1] = inv

def comb(n,k):
  if k==0 or k==n: return 1
  return (f*invs[k]*invs[n-k])%mod

for i in range(1, n+1):
    if i != a and i != b:
        ans += (comb(n, i))
print(ans)

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

n, a, b = map(int, input().split())
mod = 10**9 + 7
ans = 0

f = 1
for i in range(1, n+1):
  f *= i
  f %= mod
     
# n!^-1 の計算
inv = pow(f, mod - 2, mod)
# n!^-1 - 1!^-1 の計算
invs = [1] * (n + 1)
invs[n] = inv
for m in range(n, 1, -1):
    inv *= m
    inv %= mod
    invs[m - 1] = inv

def comb(n,k):
  if k==0 or k==n: return 1
  return (f*invs[k]*invs[n-k])%mod

for i in range(1, n+1):
    if i != a and i != b:
        ans += (comb(n, i))
print(ans)
Problem p02676 (python)

Fixed submission:
# 168 B
K = int(input())
S = input()
if len(str(S)) <= K:
    print(S)
else:
    print(S[:K]+'...')

Buggy submission (verdict: Runtime Error):
# 168 B
K = int(input())
S = input()
if len(str(S)) =< K:
    print(S)
else:
    print(S[:K]+'...')
Problem p02596 (python)

Fixed submission:
def Repsept():
    
    num = int(input())

    f=0
    n=num
    
    for i in range(10**6+1):
      if n==0:
        f=1
        print(i)
        break
      n=((n*10)+7)%num
    if f==0:
      print(-1)


if __name__ == '__main__':
    Repsept()

Buggy submission (verdict: Runtime Error):
import math

def Repsept():
    
    num = int(input())

    seven_yes = num % 7
    eleven_yes = num % 11
    mod_value = 1

    count = 1
    
    if num % 2 != 0 and num % 5 != 0:
    
        if not is_prime(num):
        
            while mod_value != 0:
                value = 7*(pow(10, count)-1)/9
                
                mod_value = value % num
    
                if mod_value != 0:
                    count = count + 1
    
            print(count)
                
        else:
            
            print(num-1)

    else:
    
        print(-1)


def is_prime(n):
    if n == 1: 
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


if __name__ == '__main__':
    Repsept()

Buggy submission (verdict: Runtime Error):
import math

def Repsept():
    
    num = int(input())

    seven_yes = num % 7
    eleven_yes = num % 11
    mod_value = 1

    count = 1
    
    if num % 2 != 0:
    
        if seven_yes == 0 or eleven_yes == 0 or num < 10000:
        
            while mod_value != 0:
                value = 7*(pow(10, count)-1)/9
                
                mod_value = value % num
    
                if mod_value != 0:
                    count = count + 1
    
            print(count)
                
        else:
            
            print(num-1)

    else:
    
        print(-1)


def is_prime(n):
    if n == 1: 
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


if __name__ == '__main__':
    Repsept()

Buggy submission (verdict: Runtime Error):
import math

def Repsept():
    
    num = int(input())

    mod_value = 1

    count = 1
    
    

    if num % 2 != 0:

        if is_prime(num):
                    
            while mod_value != 0:
                value = 7*(pow(10, count)-1)/9
                
                mod_value = value % num
    
                if mod_value != 0:
                    count = count + 1
    
            print(count)
            
        else:
            
            print(num-1)
        
    else:
    
        print(-1)

def is_prime(n):
    if n == 1: 
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

if __name__ == '__main__':
    Repsept()

Buggy submission (verdict: Runtime Error):
def Repsept():
    
    num = int(input())

    mod_value = 1

    count = 1

    if num % 2 != 0:

        while mod_value != 0:
            value = 7*(pow(10, count)-1)/9.
            
            mod_value = value % num
            
            if mod_value != 0:
                count = count + 1

        print(count)
        
    else:
    
        print(-1)

if __name__ == '__main__':
    Repsept()
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
import math
A, B = input().split()
A = Decimal(A)
B = Decimal(B)
ans = A*B
print(math.floor(ans))

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input()split())
print(math.floor(A*B))