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

Fixed submission:
from sys import stdin 
import fractions
a,b = [int(x) for x in stdin.readline().rstrip().split()]
answer = a * b // fractions.gcd(a, b)
print(answer)

Buggy submission (verdict: Runtime Error):
from sys import stdin 
import math
a,b = [int(x) for x in stdin.readline().rstrip().split()]
answer = a * b // math.gcd(a, b)
print(answer)
Problem p02622 (python)

Fixed submission:
a = input()
b = input()
cnt = 0
for i in range(len(a)):
    if a[i] != b[i]:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
cnt = 0
for i in range(len(a)):
	if a[i] != b[i]:
    	cnt+=1
print(cnt)
Problem p02831 (python)

Fixed submission:
def gcd(x,y):
    if x==0:
        return y
    elif y==0:
        return x
    
    if x<y:
        x,y = y,x
    return gcd(y, x%y)

A,B = map(int, input().split())
print( (A * B) // gcd(A,B))

Buggy submission (verdict: Runtime Error):
from math import gcd
A,B = map(int, input().split())
print(A * B // gcd(A,B))
Problem p02685 (python)

Fixed submission:
#### 逆元リストいらない
mod = 998244353
fact = [1]
fact_inv = [1]
for i in range(2*10**5+2):
    new_fact = fact[-1]*(i+1)%mod
    fact.append(new_fact)
    fact_inv.append(pow(new_fact,mod-2,mod))
def mod_comb_k(n,k,mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod
def power_func(a,n,p):
  bi=str(format(n,"b"))#2進表現に
  res=1
  for i in range(len(bi)):
    res=(res*res) %p
    if bi[i]=="1":
      res=(res*a) %p
  return res
N,M,K = map(int,input().split())
ans = 0
for i in range(K+1):
    X = mod_comb_k(N-1,i,mod)
    Z = power_func(M-1,N-(i+1),mod)
    #print(X,Z)
    ans += X * M * Z % mod
ans %= mod
print(ans)

Buggy submission (verdict: Runtime Error):
#### 逆元リストいらない
mod = 998244353
fact = [1]
fact_inv = [1]
for i in range(10**5+5):
    new_fact = fact[-1]*(i+1)%mod
    fact.append(new_fact)
    fact_inv.append(pow(new_fact,mod-2,mod))
def mod_comb_k(n,k,mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod
def power_func(a,n,p):
  bi=str(format(n,"b"))#2進表現に
  res=1
  for i in range(len(bi)):
    res=(res*res) %p
    if bi[i]=="1":
      res=(res*a) %p
  return res

N,M,K = map(int,input().split())
ans = 0
for i in range(K+1):
    X = mod_comb_k(N-1,i,mod)
    Z = power_func(M-1,N-(i+1),mod)
    #print(X,Z)
    ans += X * M * Z % mod
ans %= mod
print(ans)
Problem p02689 (python)

Fixed submission:
N,M = map(int,input().split())
H = list(map(int,input().split()))
W = [1 for i in range(N)]
for i in range(M):
    a,b = map(int,input().split())
    if H[a-1] >= H[b-1]:
        W[b-1] = 0
    if H[b-1] >= H[a-1]:
        W[a-1] = 0
ans = 0
for i in W:
    ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
H = list(map(int,input().split()))
W = [1 for i in range(N)]
for i in range(M):
    a,b = map(int,input().split())
    if H[a-1] >= H[b-1]:
        W[b-1] = 0
    if H[b-1] >= H[a]:
        W[a-1] = 0
ans = 0
for i in W:
    ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
H = list(map(int,input().split()))
W = [1 for i in range(N)]
for i in range(M):
    a,b = map(int,input().split())
    if H[a-1] >= H[b-1]:
        W[b-1] = 0
    if H[b-1] >= H[a]:
        W[a-1] = 0
ans = 0
for i in W:
    ans += i
print(ans)
Problem p02781 (python)

Fixed submission:
N = int(input())
Y = list(str(N))
Z =[]
for i in Y:
    Z.append(int(i))
K = int(input())
m = len(str(N))
def nn(Z,K,m):
    ans = 0
    if m < K:
        return ans
    else:
        if K == 1:
            y = Z[0]
            ans += (m-1) * 9 + y
            #print(ans)
        elif K == 2:
            #0 
            ans += ((m-1) * (m-2) // 2) * 9 * 9
            #print(ans)
            #mid
            ans += (max(0,Z[0]-1)) * (m-1) * 9
            #print(ans)
            #max
            K -= 1
            m -= 1
            Z = Z[1:]
            for _ in range(100):
                if Z[0] == 0:
                    m -= 1
                    Z = Z[1:]   
                else:
                    break
                if len(Z) == 0:
                    break            
            ans += nn(Z,K,m)
            #print(ans)
        elif K == 3:
            #0 
            ans += ((m-1) * (m-2) * (m-3) // 6) * 9 * 9 * 9
            #print(ans)
            #mid
            ans += (max(0,Z[0]-1)) * ((m-1) * (m-2) // 2) * 9 * 9
            #print(ans)
            #max
            K -= 1
            m -= 1
            Z = Z[1:]
            for _ in range(100):
                if Z[0] == 0:
                    m -= 1
                    Z = Z[1:]   
                else:
                    break
                if len(Z) == 0:
                    break
            ans += nn(Z,K,m)
        return ans
if len(str(N)) < K:
    ans = 0
else:
    ans = nn(Z,K,m)        
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
Y = list(str(N))
Z =[]
for i in Y:
    Z.append(int(i))
K = int(input())
m = len(str(N))
def nn(Z,K,m):
    ans = 0
    if K == 1:
        y = Z[0]
        ans += (m-1) * 9 + y
        #print(ans)
    elif K == 2:
        #0 
        ans += ((m-1) * (m-2) // 2) * 9 * 9
        #print(ans)
        #mid
        ans += (Z[0]-1) * (m-1) * 9
        #print(ans)
        #max
        K -= 1
        m -= 1
        Z = Z[1:]
        ans += nn(Z,K,m)
        #print(ans)
    elif K == 3:
        #0 
        ans += ((m-1) * (m-2) * (m-3) // 6) * 9 * 9 * 9
        #print(ans)
        #mid
        ans += (Z[0]-1) * ((m-1) * (m-2) // 2) * 9 * 9
        #print(ans)
        #max
        K -= 1
        m -= 1
        Z = Z[1:]
        ans += nn(Z,K,m)
    return ans
ans = nn(Z,K,m)        
print(ans)
Problem p02793 (python)

Fixed submission:
import fractions
N = int(input())
A = list(map(int,input().split()))
mod = 10 ** 9 + 7
def mul(a, b):
    return ((a % mod) * (b % mod)) % mod
def div(a, b):
    return mul(a, pow(b,mod-2,mod))
if N == 1:
    ans = 1
else:
    lcm = A[0] * A[1] // fractions.gcd(A[0],A[1])
    for i in range(2,N):
        #lcm = div((lcm * A[i]),fractions.gcd(lcm,A[i]))
        lcm = lcm * A[i] // fractions.gcd(lcm,A[i])
    ans = 0
    for i in range(N):
        b = div(lcm,A[i])
        ans += b 
        ans %= mod 
    #print(ans)
    #print(lcm)
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
N = int(input())
A = list(map(int,input().split()))
mod = 10 ** 9 + 7
def mul(a, b):
    return ((a % mod) * (b % mod)) % mod
def div(a, b):
    return mul(a, pow(b,mod-2,mod))
lcm = A[0] * A[1] // fractions.gcd(A[0],A[1])
for i in range(2,N):
    lcm = div((lcm * A[i]),fractions.gcd(lcm,A[i]))
ans = 0
for i in range(N):
    b = div(lcm,A[i])
    ans += b 
    ans %= mod 
    #print(ans)
#print(lcm)
print(ans)
Problem p02831 (python)

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

for i in range(1,10000000):
    c = a * i
    if c % b == 0:
        print(c)
        break

Buggy submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())
print(a * b // math.gcd(a, b))
Problem p02862 (python)

Fixed submission:
mod = 1000000007
def power(x, y):
    if   y == 0     : 
        return 1
    elif y == 1     : 
        return x % mod
    elif y % 2 == 0 : 
        return power(x, y//2)**2 % mod
    else            : 
        return power(x, y//2)**2 * x % mod
X,Y = (int(i) for i in input().split())

Z = X + Y
A = max(X,Y)
B = min(X,Y)
C = A - B

if Z % 3 != 0:
    print(0)
elif A > 2*B :
    print(0)
else:
    N = Z // 3
    if (N - C) % 2 != 0:
        print(0)
    else:
        M = (N - C) // 2


        a = 1
        b = 1
        for i in range(M):
            a = (a * (i + 1)) % mod
            b = (b * (N-i)) % mod
        c = power(a, mod-2)
        ans = b * c % mod

        print(ans)

Buggy submission (verdict: Runtime Error):
mod = 1000000007
def power(x, y):
    if   y == 0     : 
        return 1
    elif y == 1     : 
        return x % mod
    elif y % 2 == 0 : 
        return power(x, y//2)**2 % mod
    else            : 
        return power(x, y//2)**2 * x % mod
X,Y = (int(i) for i in input().split())

Z = X + Y
A = max(X,Y)
B = min(X,Y)
C = A - B

if Z % 3 != 0:
    print(0)
else:
    N = Z // 3
    if (N - C) % 2 != 0:
        print(0)
    else:
        M = (N - C) // 2


        a = 1
        b = 1
        for i in range(M):
            a = (a * (i + 1)) % mod
            c = power(a, mod-2)
        for i in range(M):
            b = (b * (N-i)) % mod
        ans = b * c % mod

        print(ans)
Problem p02912 (python)

Fixed submission:
N,M = (int(i) for i in input().split())
A = [int(i) for i in input().split()]

A = sorted(A,reverse=True)
#print(A)
X = M
for i in range(M):
    A[0] //= 2
    X -= 1
    count = 0
    for j in range(min(N-1,M)):
        if A[j] < A[j+1]:
            x = A[j]
            A[j] = A[j+1]
            A[j+1] = x
            count += 1
        else:
            break
            
    if count >= X:
        for j in range(X):
            A[j] //= 2
        break
    else:
        for j in range(count):
            A[j] //= 2
        X -= count
        A = sorted(A,reverse=True)
        
        
ans = 0
for i in A:
    ans += i

print(ans)

Buggy submission (verdict: Runtime Error):
N,M = (int(i) for i in input().split())
A = [int(i) for i in input().split()]

A = sorted(A,reverse=True)
#print(A)
X = M
for i in range(M):
    A[0] //= 2
    X -= 1
    count = 0
    for j in range(M):
        if A[j] < A[j+1]:
            x = A[j]
            A[j] = A[j+1]
            A[j+1] = x
            count += 1
        else:
            break
            
    if count >= X:
        for j in range(X):
            A[j] //= 2
        break
    else:
        for j in range(count):
            A[j] //= 2
            X -= count
        A = sorted(A,reverse=True)
        
        
ans = 0
for i in A:
    ans += i

print(ans)
Problem p03013 (python)

Fixed submission:
mod = 10 ** 9 + 7
N,M = map(int,input().split())
X = [1,1]
for i in range(N):
    X.append((X[i]+X[i+1]) % mod)
if M == 0:
    print(X[N])
else:
    a = int(input())
    ans = X[a - 1]
    #print(ans)
    tmp = a
    check = 0
    for _ in range(M-1):
        a = int(input())
        if a - tmp == 1:
            check = 1
        y = a - tmp - 2
        ans *= X[y]
        ans %= mod
        tmp = a
        #print(ans)
    y = N - tmp - 1
    ans *= X[y]
    ans %= mod 
    if check == 1:
        print(0)
    else:
        print(ans)

Buggy submission (verdict: Runtime Error):
mod = 10 ** 9 + 7
N,M = map(int,input().split())
X = [1,1]
for i in range(N):
    X.append((X[i]+X[i+1]) % mod)
#print(X)
a = int(input())
ans = X[a - 1]
#print(ans)
tmp = a
check = 0
for _ in range(M-1):
    a = int(input())
    if a - tmp == 1:
        check = 1
    y = a - tmp - 2
    ans *= X[y]
    ans %= mod 
    tmp = a
    #print(ans)
y = N - tmp - 1
ans *= X[y]
ans %= mod 
if check == 1:
    print(0)
else:
    print(ans)
Problem p03137 (python)

Fixed submission:
N,M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()
if M <= N :
    ans = 0
else:
    Y = []
    for i in range(M-1):
        Y.append(X[i+1] - X[i])
    Y.sort(reverse=True)
    ans = X[-1] - X[0]
    Y = Y[:N-1]
    for i in Y:
        ans -= i
print(ans)

Buggy submission (verdict: Runtime Error):
N,C,K = map(int,input().split())
T = []
for _ in range(N):
    t = int(input())
    T.append(t)
T.sort()
angry = 0
ans = 0
c = 0
for i in T:
    if angry == 0:
        angry = i + K
    c += 1
    if i >= angry :
        #print(i,angry)
        angry = i + K
        ans += 1
        c = 1
    if c == C:
        angry = 0
        ans += 1
        c = 0
    #print(ans,angry,c)
if c > 0:
    ans += 1
if C == 1:
    ans = C
print(ans)
Problem p03805 (python)

Fixed submission:
import itertools
N,M = (int(i) for i in input().split())
K = []
for i in range(M):
    J = [int(i) for i in input().split()]
    J.sort()
    K.append(J)

#1以外の頂点リストを作成
vertex = []
for i in range(N-1):
    vertex.append(i+2)
#順列作成
X = list(itertools.permutations(vertex))

#各値ごとに有無をチェック
ans = 0
for i in X:
    start = 1
    localcount = 0
    for j in i:
        tmp = [start,j]
        tmp.sort()
        if tmp in K:            
            localcount += 1   
        start = j
            
    if localcount == N-1:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N,M = (int(i) for i in input().split())
K = []
for i in range(M):
    J = [int(i) for i in input().split()]
    J.sort()
    K.append(J)

#1以外の頂点リストを作成
vertex = []
for i in range(N-1):
    vertex.append(i+2)
#順列作成
X = list(itertools.permutations(vertex))

#各値ごとに有無をチェック
ans = 0
for i in X:
    start = 1
    localcount = 0
    for j in i:
        tmp = [start,j]
        tmp.sort()
        if tmp in K:            
            localcount += 1   
        start = j
            
    if localcount == N-1:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N,M = (int(i) for i in input().split())
K = []
for i in range(M):
    J = [int(i) for i in input().split()]
    J.sort()
    K.append(J)

#1以外の頂点リストを作成
vertex = []
for i in range(N-1):
    vertex.append(i+2)
#順列作成
X = list(itertools.permutations(vertex))

#各値ごとに有無をチェック
ans = 0
for i in X:
    start = 1
    localcount = 0
    for j in i:
        tmp = [start,j]
        tmp.sort()
        if tmp in K == False:
            break            
        else:
            localcount += 1
            start = j
            
    if localcount == N-1:
        ans += 1

print(ans)
Problem p02622 (python)

Fixed submission:
S = input()
T = input()
ans = 0
for i, ch in enumerate(S):
  if ch != T[i]:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
ans = 0
for i, ch in enumerate(S):
  if ch != T[i]:
    ans += 1
return ans
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
s=input()
return s[2]==s[3] and s[4]==s[5]
Problem p02622 (python)

Fixed submission:
ans=0
x=input()
y=input()
for i in range(len(x)):
  if x[i] != y[i]:
    ans=ans+1
print(ans)

Buggy submission (verdict: Runtime Error):
ans=0
x,y=input().split()
for i in range(len(x)):
  if x[i] != y[i]:
    ans=ans+1
print(ans)
Problem p02699 (python)

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

if(NUM[0] > NUM[1]):
  print("safe")
elif(NUM[0] <= NUM[1]):
  print("unsafe")

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

if(NUM[0] >= NUM[1]):
  print("unsafe")
elif(NUM[0] < NUM[1]):
  print("safe")
Problem p02712 (python)

Fixed submission:
N = int(input())
sum = 0
for i in range(N+1):
  if(i % 3 != 0 and i % 5 != 0):
    sum += i

print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum = 0
for i in range(N+1):
  if(i % 3 != 0 and i % 5 != 0):
    sum += i
  
  if(i > )
Problem p02933 (python)

Fixed submission:
a=int(input())
s=input()
if a>=3200:
  print(s)
else :
  print('red')

Buggy submission (verdict: Runtime Error):
a=int(input())
s=input()
if a>=3200:
  print(s)
else
 print('red')

Buggy submission (verdict: Runtime Error):
a=int(input())
s=input()
if a>=3200:
  print(s)
else
 print("red")
Problem p02773 (python)

Fixed submission:
N = int(input())
S = []
for n in range(N):
    S.append(input())
dic = {}


for n in range(N):
    if S[n] not in dic:
        dic[S[n]] = 1
    else:
        dic[S[n]] += 1

max = max(dic.values())
out = []

for key,val in dic.items():
    if val == max:
        out.append(key)

out.sort()
for key in out:
    print(key)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
for n in range(N):
    S.append(input())
dic = {}


for n in range(N):
    if S[n] not in dic:
        dic[S[n]] = 1
    else:
        dic[S[n]] += 1

max = max(dic.values())
out = []

for key,val in dic.items():
    if val == max:
        out.append(val)
out.sorted()
for val in range(len(out)):
    print(val)
Problem p02622 (python)

Fixed submission:
S = input()
T = input()
count = 0
i = 0
for i in range(len(S)):
  if S[i]!= T[i]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
for i in range(len(S)):
  if S[i] != T[i]:
    count++
print(count)
Problem p02693 (python)

Fixed submission:
target = int(input())
range_d = [int(i) for i in input().split()]
min_d = range_d[0]
max_d = range_d[1]

flag = False
if max_d < target:
  print("NG")
else:
  for i in range(min_d,max_d+1):
    if i%target == 0:
      flag = True
      break
  print('OK') if flag else print('NG')

Buggy submission (verdict: Runtime Error):
target = int(input())
range_d = [int(i) for i in input().split()]
min_d = range_d[0]
max_d = range_d[1]

flag = False
if max_d < target:
  flag = 
else:
  for i in range(min_d,max_d+1):
    if i%target == 0:
      flag = True
      break
	print('OK') if flag else print('NG')
Problem p02777 (python)

Fixed submission:
str_list = input().split()
num_list =  [int(i) for i in input().split()]
del_boll = input()

boll_dic = {str_list[0]:num_list[0],str_list[1]:num_list[1]}
boll_dic[del_boll] -= 1

print(boll_dic[str_list[0]],boll_dic[str_list[1]])

Buggy submission (verdict: Runtime Error):
str_list = input().split()
str_dic = {str_list[0]:int(input()),str_list[1]:int(input())}
Problem p03038 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
bc=[list(map(int,input().split())) for i in range(m)]
bc.sort(key=lambda x:x[1])
for b,c in bc[::-1]:
  a.extend([c]*b)
  if len(a) > 2*n:
    break
a.sort(reverse=True)
print(sum(a[:n]))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = [int(a) for a in input().split()]
A.sort()
for _ in range(M):
    count = 1
    B,C = map(int,input().split())
    while min(A) < C and count <= B:
        A[0] = C
        A.sort()
        count += 1
    print(A)
print(sum(A))
Problem p02880 (python)

Fixed submission:
import sys
N = int(input())

for i in range(1,10):
    for j in range(1,10):
        if(N == i*j):
            print("Yes")
            sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
    import sys
    N = int(input())
     
    for i in range(1,10):
        for j in range(1,10):
            if(N == i*j):
                print("Yes")
                sys.exit()
    print("No")
Problem p02627 (python)

Fixed submission:
x = input()

if str(x).isupper() == True:
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
x = str(input())

if x.isupper() = True:
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
x = str(input())
if x.isupper() == Ture:
  print("A")
else:
  print("a")
Problem p02627 (python)

Fixed submission:
S = input() # 標準入力がStringの場合
if S.isupper():
  print('A')
else:
  print('a')

Buggy submission (verdict: Runtime Error):
import sys
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N = read().rstrip().decode()

if N isupper():
	print('A')
else:
	print('a')

Buggy submission (verdict: Runtime Error):
import sys
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N = read().rstrip().decode()

if N is.upper():
	print('A')
else:
	print('a')

Buggy submission (verdict: Runtime Error):
import sys
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N = read().rstrip().decode()

if N is.upper():
	print('A')
else:
	print('a')
Problem p02622 (python)

Fixed submission:
a = str(input())
b = str(input())
c = 0
for i in range(len(a)):
  if a[i] == b[i]:
    c += 0
  else:
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
a = str(input())
b = str(input())
c = 0
for i in range(len(a)):
  if a[i] == b[i]:
    c += 0
  else:
    b[i] = a[i]
    c += 1
print(c)
Problem p02897 (python)

Fixed submission:
n=int(input())

if n%2==0:
  print(1/2)
else:
  print((n+1)/2/n)

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

if n%2==0 print(1/2) else print((n+1)/2/n)
Problem p02725 (python)

Fixed submission:
k,n=map(int, input().strip().split())
a=list(map(int, input().strip().split()))
a.append(a[0]+k)

v=0
for i in range(n): v=max(v,a[i+1]-a[i])
print(k-v)

Buggy submission (verdict: Runtime Error):
k,n=map(int, input().strip().split())
a=list(map(int, input().strip().split()))
a.append(a[0]+k)

ans=0
for i in range(n):
 ans=max(max, a[i+1]-a[i])
print(k-ans)
Problem p02860 (python)

Fixed submission:
N = int(input())
if N % 2 == 1:
    print("No")
    exit()
S = input()
if S[0:N//2] == S[N//2:]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if N % 2 == 1:
    print("No")
	exit()
S = input()
if S[0:N//2] == S[N//2:]:
    print("Yes")
else:
    print("No")
Problem p03036 (python)

Fixed submission:
r, D, x = list(map(int, input().split()))
for i in range(10):
    x = r * x - D
    print(x)

Buggy submission (verdict: Runtime Error):
r, D, X = list(map(int, input().split()))
for i in range(10):
    x = r * x - D
    print(x)
Problem p03775 (python)

Fixed submission:
import math as m
N = int(input())
F_ab = 0
for i in range(1, int(m.sqrt(N))+1):
    if N%i != 0:
        continue
    if i == 1:
        F_ab = len(str(N//i))
    else:
        F_ab = min(F_ab, max(len(str(i)), len(str(N//i))))

print(F_ab)

Buggy submission (verdict: Runtime Error):
import math as m
N = int(input())
F_ab = 0
for i in range(1, int(sqrt(N))+1):
    if N%i != 0:
        continue
    if i == 1:
        F_ab = len(str(N//i))
    else:
        F_ab = min(F_ab, max(len(str(i)), len(str(N//i))))

print(F_ab)
Problem p02688 (python)

Fixed submission:
"""
ある街にN人のすぬけ君(すぬけ君1、すぬけ君2、 ...、 すぬけ君N)が住んでいます。

"""
n, k = map(int, input().split())
n_list = list(range(1, n+1))
input_map = {}
for i in range(k):
    d = int(input())
    d_list = [ int(ai) for ai in input().split()]
    for h in d_list:
        if n_list.count(h) == 1:
            n_list.remove(h)

print(len(n_list))

Buggy submission (verdict: Runtime Error):
"""
ある街にN人のすぬけ君(すぬけ君1、すぬけ君2、 ...、 すぬけ君N)が住んでいます。

"""
n, k = map(int, input().split())
input_map = {}
for i in range(k):
    d = int(input())
    list = list(input().split())
    input_map.setdefault(d, list)

cnt = 0
for key, value in input_map.items():
    if len(value) >= key:
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
"""
ある街にN人のすぬけ君(すぬけ君1、すぬけ君2、 ...、 すぬけ君N)が住んでいます。

"""
n, k = map(int, input().split())
input_map = {}
for i in range(k):
    d = int(input())
    list = list(input().split())
    input_map.setdefault(i, list)

cnt = 0
having_list = input_map(k)
for j in having_list:
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
"""
ある街にN人のすぬけ君(すぬけ君1、すぬけ君2、 ...、 すぬけ君N)が住んでいます。

"""
n, k = map(int, input().split())
input_map = {}
for i in range(k):
    d = int(input())
    input = input()
    list = [int(ai) for ai in input ]
    input_map.setdefault(i, list)

cnt = 0
having_list = input_map(k)
for j in having_list:
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
"""
ある街にN人のすぬけ君(すぬけ君1、すぬけ君2、 ...、 すぬけ君N)が住んでいます。

"""
n, k = map(int, input().split())
input_map = {}
for i in range(k):
    d = int(input())
    for j in range(d):
        input_list = input().split()
        list = [ int(ai) for ai in input_input ]
    input_map.setdefault(i, list)

cnt = 0
having_list = input_map(k)
for j in having_list:
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
"""
ある街にN人のすぬけ君(すぬけ君1、すぬけ君2、 ...、 すぬけ君N)が住んでいます。

"""
n, k = map(int, input().split())
input_map = {}
for i in range(k):
    d = int(input())
    for j in range(d):
        list = list(input())
    input_map.setdefault(i, list)

cnt = 0
having_list = input_map(k)
for j in having_list:
    cnt += 1

print(cnt)