Problem:


Score : 200 points

Problem Statement

Given is an integer N. Find the number of digits that N has in base K.

Notes

For information on base-K representation, see Positional notation - Wikipedia.

Constraints

All values in input are integers.

1 \leq N \leq 10^9

2 \leq K \leq 10

Input

Input is given from Standard Input in the following format:

N K

Output

Print the number of digits that N has in base K.

Sample Input 1

11 2

Sample Output 1

4

In binary, 11 is represented as 1011.

Sample Input 2

1010101 10

Sample Output 2

7

Sample Input 3

314159265 3

Sample Output 3

18



Sample input:
11 2


Sample output:
4

Submission status: Accepted

Solution code:
import numpy as np
N, K = map(int, input().split())

res = 0
M = N
while M >= 1:
    M /= K
    res += 1
print(res)

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
ans=0
while n!=0:
  if n//k!=0:
    ans=ans+1
  elif n%k!=0:
    ans=ans+1
  n=n//k
print(ans)

Submission status: Accepted

Solution code:
n, r = map(int, input().split())
i = r
c = 1
while i <= n:
	i *= r
	c += 1
print(c)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
for i in range(1,10000):
  if n < k**i:
    print(i)
    break

Submission status: Accepted

Solution code:
N, K = map(int,input().split())
def func(x):
  if 0 <= x < K:
    return 1
  else:
    return 1 + func(x // K)

print(func(N))

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
l=[]
if k<=9 :
  while True:
    a=n%k
    if n>=k:
      l.append(a)
    n//=k
    if n<k :
      l.append(n)
      break
  print(len(l))
else:
  print(len(str(n)))

Submission status: Accepted

Solution code:
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
n, k = map(int,input().split())
print(len(Base_10_to_n(n,k)))

Submission status: Accepted

Solution code:
import math

N, K = map(int, input().split(' '))

x = 0
while True:
    if N < math.pow(K, x):
        print(x)
        break
    x += 1

Submission status: Accepted

Solution code:
from sys import stdin
n,k = map(int,stdin.readline().rstrip().split())
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
print(len(Base_10_to_n(n,k)))

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
cnt = 0
while True:
    if n < k and n%k == 0:
        break
    cnt += 1
    n //= k
print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 無限 #####
# inf = float('inf')

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')

def main():
	N,K = inputMap()
	ans = 1

	while True:
		tmp = N // K
		if tmp == 0:
			break
		N = tmp
		ans += 1

	print(ans)


if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
ans = 1
while N >= K ** ans:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())

count = 0
while N >= K ** count:
    count += 1

print(count)

Submission status: Accepted

Solution code:
#nとk進数
n, k = map(int, input().split())

#nをkで割った時の商
#s = n//k
dm = [n,0]
ha = ''
#nをkで割った余りをつなげることの繰り返し
while dm[0] > 0:
	dm = divmod(dm[0],k)
	ha += str(dm[1])


print(len(ha))

Submission status: Accepted

Solution code:
n,r = map(int,input().split())
re = 0

while n > 0:
  re = re + 1
  n = n // r
print (re)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
Count = 0
Output = N
while 1:
    Output = Output / K
    Count += 1
    if Output < K:
        break
print(Count if N < K else Count + 1)

Submission status: Accepted

Solution code:
import sys

def resolve():
  n, k = map(int, input().split())
  ans = 0
  while (n != 0):
    n //= k
    ans += 1
  print(ans)
  return

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
i = 0

while i <= 100000000:
  if N < K ** i:
    print(i)
    break
    
  else:
    i += 1

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
cnt = 1
while n >= k:
    n //= k
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)


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

print(len(str(Base_10_to_n(N, K))))

Submission status: Accepted

Solution code:
n, k = map(int, input().split())

ans = 0
while n > 0:
    n = n // k
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())

keta = 0
a = N
while True:
    a = a // K
    keta = keta + 1
    if a == 0:
        break

print(keta)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())

ans = 0
while n:
    n //= k
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())

for i in range(40):
    if (N < K**i):
        print (i)
        break

Submission status: Accepted

Solution code:
N, K = map(int, input().split())

c = 0
n = N

while n != 0:
    n = n // K
    c += 1

print(c)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())

ans = ""
while True:
    n, m = divmod(n, k)
    ans += str(m)
    if n == 0:
        break
print(len(ans))

Submission status: Accepted

Solution code:
if __name__ == '__main__':

    n, k = [int(i) for i in input().split()]

    q = n
    s = []
    while True:        
        s.append(q % k)
        q = q // k
        if q == 0:
            break
    
    print(len(s))

Submission status: Accepted

Solution code:
import math
N, K = map(int,input().split())
print(math.floor(math.log(N, K)) + 1)

Submission status: Accepted

Solution code:
N,K = [int(i) for i in input().rstrip().split(' ')]

S = ""
while 1:
    S += str(N % K)
    N //= K
    if N == 0:
        break
print(len(S))

Submission status: Accepted

Solution code:
def solve(n, k):
    res = 0
    while n > 0:
        n //= k
        res += 1
    return res

n, k = map(int, input().split())
print(solve(n, k))

Submission status: Accepted

Solution code:
a, b = input().split()
a, b = int(a), int(b)
 
digit = 0
for i in range(100):
  if a <= b ** i - 1:
    digit = i
    break
    
print(digit)

Submission status: Accepted

Solution code:
inp = input().split()
n = int(inp[0])
k = int(inp[1])
count = 1
w = k
while ((n//w) > 0):
    w = w * k
    count += 1
print(count)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
x = 1
ans = 0

while n >= x:
    x = x * k
    ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())

ans = 1

while n >= k ** ans:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())

ans = 0
while N > 0:
    N //= K
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
ans = ''
while N >= K:
    ans = str(N % K) + ans
    N  = N // K
ans = str(N) + ans
print(len(ans))

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
i = 0
while n>= k**i:
    i+= 1
print(i)

Submission status: Accepted

Solution code:
import math

n, k = list(map(int, input().split()))
if n == 1:
    print(1)
else:
    print(math.ceil(math.log(n, k)))

Submission status: Accepted

Solution code:
import math
N,K = map(int, input().split())
print(1 if N==1 else math.ceil(math.log(N,K)))

Submission status: Accepted

Solution code:
import math

N, K = map(int, input().split())
print(int(math.log(N, K) + 1))

Submission status: Accepted

Solution code:
import math

N, K = map(int,input().split())
if N==1:
  print(1)
else:
  print(math.ceil(math.log(N, K)))

Submission status: Accepted

Solution code:

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
N,K=map(int,input().split())
x = Base_10_to_n(N,K)
print(len(x))

Submission status: Accepted

Solution code:
n,k = map(int, input().split())
i = 0

while n//k**i != 0:
    i += 1

print(i)

Submission status: Accepted

Solution code:
import math


def main(n, k):
    print(math.floor(math.log(n, k) + 1))


if __name__ == "__main__":
    n, k = map(int, input().split())

    main(n, k)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
ans=1
while n>=k:  
  n=n//k
  ans+=1
print(ans)

Submission status: Accepted

Solution code:
N,K=map(int,input().split())
cnt=0
while N>0:
    N=N//K
    cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy > 0:
        out = str(X_dumy % n) + out
        X_dumy = int(X_dumy / n)
    return out


N, K = map(int, input().split())
print(len(Base_10_to_n(N, K)))

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np

def main():
	n,k=map(int,input().split())
	
	cnt=0
	
	while True:
		if n==0:
			print(cnt)
			exit(0)
		else:
			n//=k
			cnt+=1
	
	
	
	
	
	
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    N,K = map(int, readline().split())

    i = 1
    r = 0
    while r != N:
        r = N % pow(K, i)
        i += 1

    print(i-1)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
cout = 1
for i in range(N):
    if N<K:
        break
    N = N//K
    cout += 1

print(cout)

Submission status: Accepted

Solution code:
from math import log, ceil
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    N,K = map(int, readline().split())

    print(int(log(N, K)) + 1)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
ans = 1
while N >= pow(K, ans):
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())

i = 1
while True:
    if N < K ** i:
        print(i)
        break
    else:
        i += 1

Submission status: Accepted

Solution code:
a = input().split()
x = int(a[0])
y = int(a[1])
z = int(x/y)
n = 1
while z>=1:
        z = int(z/y)
        n = n+1
print(n)

Submission status: Accepted

Solution code:
n,k = map(int, input().split())
x = 0
while n:
  n //= k
  x += 1
print(x)

Submission status: Accepted

Solution code:
import math
n,k=map(int,input().split())
print(int(math.log(n,k)) + 1)

Submission status: Accepted

Solution code:
n, k  = map(int, input().split())
from math import log as log
keta = log(n, k) + 1
print(int(keta))

Submission status: Accepted

Solution code:
a=input().split()
N = int(a[0])
K = int(a[1])
N = int(N / K)
cnt = 1
while N > 0:
    N = int(N / K)
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)



def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())

directions=np.array([[1,0],[0,1],[-1,0],[0,-1]])
directions = list(map(np.array, directions))

mod = 10**9+7


def factorial(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact



def serch(x, count):
    #print("top", x, count)
            

    for d in directions:
        nx = d+x
        #print(nx)
        if np.all(0 <= nx) and np.all(nx < (H, W)):
            if field[nx[0]][nx[1]] == "E":
                count += 1 
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)  
                continue
            if field[nx[0]][nx[1]] == "#":
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)    
                 
    return count


def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X % n)
    return str(X % n)

N,K=acinput()
s=Base_10_to_n(N,K)
print(len(s))

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
ans = 0

def base_10_to_n(x, n):
    if int(x / n):
        return base_10_to_n(int(x / n), n) + str(x % n)
    return str(x % n)

print(len(str(base_10_to_n(n, k))))

Submission status: Accepted

Solution code:
s = list(map(int, input().split()))

keta=1
while s[0]>=s[1]:
    s[0]=s[0]/s[1]
    keta+=1

print(keta)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
i = 0
while True:
    if n < k ** i:
        break
    i += 1

print(i)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
ans = 1
while N > (K - 1):
  N = N // K
  ans += 1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

x = [int(x) for x in stdin.readline().rstrip().split()]

N = x[0]
K = x[1]

ans = 0
while N > 0:
    N//=K
    ans += 1


print(ans)

Submission status: Accepted

Solution code:
N,K = (int(x) for x in input().split())
ans = 0

while N != 0:
    N = N // K
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N,K=map(int, input().split()) 
for i in range(8000):
    if K**i<=N<K**(i+1):
        print(i+1)

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
ans=0
while n>0:
  ans+=1
  n//=k
print(ans)

Submission status: Accepted

Solution code:
num = input().split()

N = int(num[0])
K = int(num[1])

total = 0

while N != 0:
    total += 1
    N //= K

print(total)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
ans = 1
buf = 1
while buf * k - 1 < n:
    buf *= k
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
def div(v, d):
  if v < d:
    return 1
  return 1 + div(v/d, d)

l = list(map(int, input().split()))
print(div(l[0], l[1]))

Submission status: Accepted

Solution code:
import math
N, K = map(int, input().split())
t = math.log(N, K) // 1 + 1
print(int(t))

Submission status: Accepted

Solution code:
N, K = list(map(int,input().split()))

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

print(len(Base_10_to_n(N, K)))

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
count = 0
x = n//k

while x != 0:
    n = x
    x = n//k
    count += 1

print(count+1)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
flag = 1
c = 1
while flag == 1:
  if n // k >= 1:
    n //= k
    c += 1
  else:
    flag = 0
print(c)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
count = 1

while 1:
    if n < k:
        break
    
    n = n // k
    count += 1 
    

print(count)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
ans = 0
while N > 0:
    N //= K
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n,k=list(map(int,input().split()))
count=0

while n/k!=0.0:
  n=n//k
  count+=1

print(count)

Submission status: Accepted

Solution code:
import math
N, K = map(int, input().split())

keta = int(math.log(N, K)) + 1
print(keta)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
x=1
while n//k>0:
  n=n//k
  x+=1
print (x)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
i = 0
while (n//(k**i))!=0:
    i += 1
print(i)

Submission status: Accepted

Solution code:
import sys
import sys
sys.setrecursionlimit(1000000)


def input():
    return sys.stdin.readline()[:-1]

def fun(X, n):
    if (int(X/n)):
        return fun(int(X/n), n)+str(X%n)
    return str(X%n)

def main():
    N,K = map(int, input().split())
    print(len(fun(N, K)))
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N,K = map(int, input().split())

cnt = 0
while N > 0:
  N //= K
  cnt += 1
    
print(cnt)

Submission status: Accepted

Solution code:
s = input().split()

N = int(s[0])
K = int(s[1])

i=1
if N == 1:
  print('1')
while N > K **(i-1):
  if N < K**i:
    print(i)
  elif N == K**i:
    print(i+1)
  i += 1

Submission status: Accepted

Solution code:
import math
N,K = map(int,input().split())
print(int(math.log(N,K)+1))

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
count = 1
for i in range(1, 100):
    if n / (k ** i) >= 1:
        count += 1
    else:
        break

print(count)

Submission status: Accepted

Solution code:
from math import log
n, k = [int(x) for x in input().split()]
print(int(log(n,k)) + 1)

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
count=1
while n>=k:
    n/=k
    count+=1
print(count)

Submission status: Accepted

Solution code:
n, k = (int(x) for x in input().split())
a = 0
while True:
    if k ** a > n: break
    else: a += 1
if a == 0: a += 1
print(a)

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
c=0
while n:
  c+=1
  n=n//k
print(c)

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
ans=0
while n>0:
  ans+=1
  n//=k

print(ans)

Submission status: Accepted

Solution code:
def Base_10_to_n(X, n): #さいとからぱくった
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)

def main():
    N, K = map(int, input().split())
    nsin = Base_10_to_n(N, K)
    print(len(nsin))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N, K = map(int, input().split())

ans = 1
while K ** ans <= N:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
ans = 0

while n > 0:
    ans += 1
    n //= k

print(ans)

Submission status: Accepted

Solution code:
N, K=map(int, input().split())
i=1
while K**i-1<N:
  i+=1
print(i)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())

ans = 0
while (n > 0):
    n //= k
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import math


def main():
    N, K = map(int, input().split())
    print(math.floor(math.log(N, K)) + 1)


if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	N,K = MI()
	n = N
	ans = 1
	while N >= K:
		N //= K
		ans += 1
	print(ans)

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
#from math import sqrt
#from heapq import heappush, heappop
#from collections import deque

#a, b = [int(v) for v in input().split()]


def main():
    N, K = map(int, input().split())

    for i in range(1, 1000000):
        v = K ** i
        if v > N:
            print(i)
            exit()


main()

Submission status: Accepted

Solution code:
#B - Digits
N,K = map(int,input().split())
ans = 0
while N > 0:
    N = N//K
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
x = 0
y = []
while N >= K**x:
    y.append(x)
    x += 1
h = int(y[len(y)-1]) + 1
print(h)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
out = ""
while N > 0:
    out = str(N%K)+out
    N = N // K

print(len(out))

Submission status: Accepted

Solution code:
from math import log

n,k = map(int,input().split())
print(int(log(n,k))+1)

Submission status: Accepted

Solution code:
import math
n,k = input().split()
n=int(n)
k=int(k)
ans=0
while n>0:
    ans=ans+1
    n=int(n/k)
print(ans)

Submission status: Accepted

Solution code:
N, K = map(int,input().split())

ans = 0

while N > 0:
    N //= K
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
"""
B
"""
N,K=map(int,input().split())
i=0
while True:
    if N>=K**i:
        i+=1
    else:
        break
print(i)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
digits = 0
while n > 0:
  n //= k
  digits += 1
print(digits)

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
i=0
while True:
    if N>=K**i:
        i+=1
    else:
        break

print(i)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
ans = 0
while n!=0:
    ans += 1
    n //= k

print(ans)

Submission status: Accepted

Solution code:
from numpy import base_repr

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

print(len(base_repr(N, K)))

Submission status: Accepted

Solution code:
N, K = map(int, input().split())

ans = ''
while N:
    d, m = divmod(N, K)
    ans = str(m) + ans
    N //= K

print(len(ans))

Submission status: Accepted

Solution code:
import math
n,k=map(int,input().split())
print(1+int(math.log(n)/math.log(k)))

Submission status: Accepted

Solution code:
N, K = [int(i) for i in input().split()]
        

ans = []
while N != 0:
    ans.append(N%K)
    N = N // K

print(len(ans))

Submission status: Accepted

Solution code:
import math

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

digit = int(math.log(n,k)) + 1

print(digit)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())

result = 0
while N != 0:
    result += 1
    N //= K
print(result)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())

answer = 0

while True:
    answer += 1
    if k**answer>n:
        break

print(answer)

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
a = N
ans = []
solve = ""
while a>=K:
  ans.append(a%K)
  a = a//K
ans.append(a)
print(len(ans))

Submission status: Accepted

Solution code:
n,k = map(int, input().split())
i=1
while 1:
    if k**i>n:
        print(i)
        exit()
    else:
        i+=1

Submission status: Accepted

Solution code:
# coding: utf-8
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
N, K = map(int, input().split())
print(len(Base_10_to_n(N, K)))

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
ans = 1
tmp = 1

while N >= tmp:
    tmp = tmp * K
    ans += 1

# print(tmp)
print(ans-1)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
counter = 0
shou = n

while shou > 0:
  shou = n // k
  counter += 1
  n = shou

print(counter)

Submission status: Accepted

Solution code:
n,k=(int(x) for x in input().split())
i = 0
while True:
    kk = k ** i
    if kk > n:
        break
    else:
        i = i + 1

print(i)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import math

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

ans=1
while N>=K:
    N//=K
    ans+=1

print(ans)

Submission status: Accepted

Solution code:
n, k = map(int,input().split())
ans = 1
while True:
    if n <= k-1:
        break
    n = n//k
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
ans = 0

while N >= K:
  N = N // K
  ans += 1

ans += 1
print(ans)

Submission status: Accepted

Solution code:
n , k = map(int, input().split())
count = 0
flag = True
while(flag):
    for p in range(100):
        q = k**p
        if n//q >  0:
            count += 1
        else:
            flag = False
            break
print(count)

Submission status: Accepted

Solution code:
def int_to_string(n: int, radix: int = 10) -> str:
    """https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString"""

    if radix < 2 or radix > 36:
        raise ValueError("radix must be between 2 and 36")

    char = "0123456789abcdefghijklmnopqrstuvwxyz"
    negative = n < 0
    n = abs(n)
    digits = []

    while n:
        d = n % radix
        n //= radix
        digits.append(d)

    s = "".join([char[d] for d in reversed(digits)])

    if negative:
        return "-" + s

    return s


N, K = map(int, input().split())
print(len(int_to_string(N, K)))

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
ans=0
while n!=0:
 ans+=1
 n//=k
print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
i = 0
while N >= K ** i:
  i += 1
print(i)

Submission status: Accepted

Solution code:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


N, K = mi()

import math

ll = math.log(N,K)


print(int(ll)+1)

Submission status: Accepted

Solution code:
import numpy as np
n,k=map(int,input().split())
print(len(np.base_repr(n,base=k)))

Submission status: Accepted

Solution code:
n, k = map(int, input().split())


def Base_10_to_n(X, n):
    X_dummy = X
    out = ''
    while X_dummy > 0:
        out = str(X_dummy % n)+out
        X_dummy = int(X_dummy/n)
    return out

print(len(Base_10_to_n(n, k)))

Submission status: Accepted

Solution code:
n,k = map(int,input().split())


for i in range(10000):
    if n//k**i == 0:
        ans=i
        break

print(ans)

Submission status: Accepted

Solution code:
def ten_to_n(X, n):
    i = X // n
    s = str(X % n)
    if (i):
        return ten_to_n(i, n) + s
    return s

def solve():
    N, M = map(int, input().split())
    n = ten_to_n(N, M)
    return len(n)
 
print(solve())

Submission status: Accepted

Solution code:
def ten_to_n(X, n):
    i = int(X / n)
    s = str(X % n)
    if (i):
        return ten_to_n(i, n) + s
    return s

def solve():
    N, M = map(int, input().split())
    n = ten_to_n(N, M)
    return len(n)
 
print(solve())

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
ans = 1
x = k
while n >= x:
    x *= k
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N,K = map(int,input().split())

ans=0
while True:
    N//=K
    ans+=1
    if N==0:
        break
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import math
I=list(map(int, input().split()))
N=I[0]
K=I[1]
ans=int(math.log(N,K))+1
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

n, k = [int(x) for x in input().rstrip().split(" ")]

k_base_num = []

while True:
  k_base_num.append(n%k)
  n = n//k
  if n == 0:
    break
print(len(k_base_num))

Submission status: Accepted

Solution code:
import sys

n, k = map(int, sys.stdin.readline().split())

def main():
    cnt = 1
    m = 1
    while m <= n:
        m *= k
        cnt += 1
    return cnt - 1

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
 
cnt = 0
while N > 1:
  N //= K
  cnt += 1
  
if N == 0:
  print(cnt)
else:
  print(cnt+1)

Submission status: Accepted

Solution code:
n, k = list(map(int,(input().split())))
ans = 0
#syou = 1000000
while n: 
  ans +=1
  amari = n%k
  syou = n//k
  n = syou

print(ans)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
cnt = 0
while n != 0:
    cnt += 1
    n = n//k
print(cnt)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())

# 2 ** 30 > 10^9
ans = 0
while n != 0:
    n = n // k
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
i = N/K
cnt = 1
while i >= 1:
    i = i/K
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
cnt = 0
while True:
    cnt += 1
    if n < k:
        break
    n = n//k
print(cnt)

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
cnt=0

while N//K>=1:
  cnt +=1
  N = N//K
  
print(cnt+1)

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
count=0
for i in range(100):
  if n==k**i:
    count=i+1
    break
  elif k**i>n:
    count=i
    break
print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python

from sys import stdin, stderr

def main():
   N, K = map(int, stdin.readline().split())
   res = 0
   while N > 0:
      res += 1
      N /= K
   print(res)

   return 0

if __name__ == '__main__': main()

Submission status: Accepted

Solution code:
from math import * 
N, K = list(map(int, input().split()))
print(max(1, ceil(log(N, K))))

Submission status: Accepted

Solution code:
given, base = [int(x) for x in input().split()]
has = 0
while given > 0:
    has += 1
    given //= base
print(has)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
ans = 0
while n >= 1:
    n//=k
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
ans = 0
R = 0
while n>R:
    ans += 1
    R = k ** ans - 1
print(ans)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
ans = ""
while N > 0:
  ans = ans + str(N % K)
  N = N // K
print(len(ans))

Submission status: Accepted

Solution code:
n,k = map(int,input().split())

i = 1
while True:
    if k ** i > n:
        print(i)
        break
    i += 1

Submission status: Accepted

Solution code:
import math

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

f = math.log(n, k)
print(math.floor(f) + 1)

Submission status: Accepted

Solution code:
def solve():
    N, K = map(int, input().split())
    div = N
    ans = 0
    while div:
        div //= K
        ans += 1
    print(ans)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, readline().split()))
    for i in range(10 ** 10):
        if n // pow(k, i) == 0:
            print(i)
            exit()


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N, K = map(int, input().split())

count = 0
N_K = 1
while N >= N_K:
    count += 1
    N_K *= K

print(count)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
ans = 0
while n>0:
    n//=k
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
ans = 0
while n:
  n //= k
  ans += 1
print(ans)

Submission status: Accepted

Solution code:
import math

temp = input()
N, K = list(map(int, temp.split()))

print(math.floor(math.log(N, K))+1)