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:
N,K = map(int,input().split())
count = 1
for k in range(1000000):
    if N / K >= 1:
        count += 1
        N = N / K
    else:
        break

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n, k = map(int, input().split())
    count = 0

    while n > 0:
        count = count +1

        if n - k ** count < 0:
            break

    print(count)

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:
n,k=map(int,input().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)

x10=n
x2=Base_10_to_n(x10, k)
print(len(x2))

Submission status: Accepted

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

for i in range(1,100):
    r*=k
    if r>n:
        print(i)
        exit()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

n = math.log(N, K)
if n == math.floor(n):
  print(math.ceil(n)+1)
else:
  print(math.ceil(n))

Submission status: Accepted

Solution code:
A = list(map(int,input().split(" ")))
num_list = ""
n = A[1]
number = A[0]
while number != 0:
    num_list += str(number % n)
    number = number // n
print(len(num_list))

Submission status: Accepted

Solution code:
import string
numbers = "0123456789"
alphabets = string.ascii_letters
characters = numbers + alphabets
n, k = map(int, input().split())

def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)

    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)

    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result

m = base_cvt(n, k)
#print(m)
print(len(str(m)))

Submission status: Accepted

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

count = 0

while True:
    count+=1    
    N = int(N/K)
    if N < 1:
        break

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def main():
	n, k = IN()
	
	i=1
	while n > (k**i)-1:
		#pa((k**i)-1)
		i+=1
	ret = i
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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


def number_to_base(n, b):
    if n == 0:
        return [0]
    digits = []
    while n:
        digits.append(int(n % b))
        n //= b
    return digits[::-1]


print(len(number_to_base(n, k)))

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, K = lr()

left = 0
right = 100
while right > left + 1:
    mid = (left + right) // 2
    if N < K ** mid:
        right = mid
    else:
        left = mid

print(right)

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 = (int(x) for x in input().split())
xk = Base_10_to_n(n, k)

print(len(str(xk)))

Submission status: Accepted

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

def convert(n, base):
    result=""

    while n > 0:
        result = str(n % base) + result
        n //= base
    return result
    
print(len(convert(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)
xx = str(x)
print(len(xx))

Submission status: Accepted

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

for i in range(1000000):
  if pow(k, i) - 1 >= n:
    print(i)
    break

Submission status: Accepted

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

########関数部分##############
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)
############################

answer=Base_10_to_n(N,K)

print(len(str(answer)))

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
tmp = 1
for i in range(n):
  if ((k**ans) > n):
    print(ans)
    break
  ans += 1

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:
#!/usr/bin/env python3

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())

def sinsu(n ,b):
    if (int(n/b)):
        return sinsu(int(n/b), b)+str(n%b)
    return str(n%b)

print(len(sinsu(n, k)))

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,100):
    if n<k**i:
        print(i)
        break

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
def parse_base10_to_basen(x, n):
    if (int(x/n)):
        return parse_base10_to_basen(int(x/n), n) + str(x%n)
    return str(x%n)

sys.setrecursionlimit(10000)
n, k = map(int, input().split())

a = parse_base10_to_basen(n, k)
print(len(a))

Submission status: Accepted

Solution code:
import math

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

if n == 0:
    print(1)
    exit()

ans = math.log(n, k)
# ans = math.ceil(ans)
# print(ans)

# if isinstance(ans, int):
if ans.is_integer():
    print(int(ans+1))
else:
    print(math.ceil(ans))

Submission status: Accepted

Solution code:
from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n,k = inm()
for i in range(40):
    if k**i>n:
        print(i)
        exit()

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
def read():
    N, K = list(map(int, input().strip().split()))
    return N, K

def solve(N, K):
    count = 0
    while N > 0:
        N //= K
        count += 1
    return count


if __name__ == '__main__':
    inputs = read()
    print("{}".format(solve(*inputs)))

Submission status: Accepted

Solution code:
import math
n,k=map(int, input().split())
m=math.ceil(math.sqrt(n))+1
ans=0
for i in range(m):
    if n>=k**i:
        ans+=1
    else:
        break
print(ans)

Submission status: Accepted

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

dig=0

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

print(dig)

Submission status: Accepted

Solution code:
n, r = map(int, input().split())
for i in range(1, 10**100):
  if r ** (i - 1) <= n < r ** i:
    print(i)
    exit()

Submission status: Accepted

Solution code:
n, k = map(int, input().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)
############################
 
 
#####関数をつかってみる．#####
######今回は二進数に変換######
x2 = Base_10_to_n(n, k)
print( len(x2) )#"100011"が表示される．

Submission status: Accepted

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

def ntok(X, N):
    if (int(X / N)):
        return ntok(int(X / N), N) + str(X % N)
    return str(X % N)

print(len(ntok(n, k)))

Submission status: Accepted

Solution code:
# print('input >>')
N, K = map(int,(input().split()))

n = 0
while True:
    if K ** n <= N:
        n+=1
    else:
        break
# print('-----output-----')
print(n)

Submission status: Accepted

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

for i in range(40):
    if k**i<= n <k**(i+1):
        print(i+1)
        break
    else:
      pass

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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

    res = 1

    while True:
        temp1 = K ** res
        temp2 = K ** (res-1)
        if (N >= temp2) & (N < temp1):
            break
        res += 1

    print(res)



main()

Submission status: Accepted

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

import math 

def findNumberOfDigits(n, base): 
       
    dig = (math.floor(math.log(n) /
                 math.log(base)) + 1) 
      
    print(dig)
  
  
# calling the method 
findNumberOfDigits(n, k)

Submission status: Accepted

Solution code:
import numpy as np

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

print(len(str(np.base_repr(n,k))))

Submission status: Accepted

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

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 solve():
    N, M = map(int, input().split())
    n = Base_10_to_n(N, M)
    return len(n)

print(solve())

Submission status: Accepted

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

exp = 1
while True:
    if N < K ** exp:
        print(exp)
        exit()
    exp += 1

Submission status: Accepted

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

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:
N, K = map(int, input().split())
ans = 0
while N >= K:
    N /= K
    ans += 1
print(ans + 1)

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())
n = Base_10_to_n(n, k)
print(len(n))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def main():
    n, k = map(int, input().split())
    ans = 1

    # n を k 進表示
    while(n >= k):
        # print(n)
        n = int(n / k)
        ans += 1
    
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = 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(a[0], a[1])))

Submission status: Accepted

Solution code:
def A():
    N, R = map(int, input().split())
    if N >= 10:
        print(R)
    else:
        print(R + 100*(10-N))

def B():
    N, K = map(int, input().split())
    n = N
    ans = 1
    while n >= K:
        q, r = divmod(n, K)
        ans += 1
        n = q
    print(ans)
B()

Submission status: Accepted

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

c = 1
while(1):
    if N // K >=1:
        c += 1
        N = N//K
        #print(N,c)
    else:
        break
print(c)

Submission status: Accepted

Solution code:
import string
numbers = "0123456789"
alphabets = string.ascii_letters
characters = numbers + alphabets
def base_cvt(value, n=2):
    result = ''
    tmp = value
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result

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

Submission status: Accepted

Solution code:
N, K = map(int, input().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)
tmp = Base_10_to_n(N, K)
tmp = str(tmp)
print(len(tmp))

Submission status: Accepted

Solution code:
n,k = map(int, input().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)

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n, k = map(int, input().strip().split())
  count = 0
  while n:
    n //=k
    count += 1
  print(count)

if __name__=='__main__':
  main()

Submission status: Accepted

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

n, k = [int(_) for _ in input().split()]
print(len(conv(n, k)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = input().split()
b = int(a[0])
c = int(a[1])

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(b, c)))

Submission status: Accepted

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

import math
print(1+int(math.log(x,k)))

Submission status: Accepted

Solution code:
N,R=map(int,input().split())
for i in range(1000000000):
	if R**i>N:
		print(i)
		break

Submission status: Accepted

Solution code:
def func(x,n):
    if int(x/n):
        return func(int(x/n),n)+str(x%n)
    return str(x%n)    

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
ans=0
c=1
while c<=n:
  c*=m;ans+=1
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():
    import sys
    input = sys.stdin.readline
    N,K = map(int,input().split())
    print(len(Base_10_to_n(N, K)))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
a_li=[]
while n>0:
    a=n%k
    a_li.append(a)
    n=n//k
print(len(a_li))

Submission status: Accepted

Solution code:
n, k = input().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)


x = base_10_to_n(int(n), int(k))
print(len(x))

Submission status: Accepted

Solution code:
N, K = 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(str(Base_10_to_n(N, K))))

Submission status: Accepted

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

i = 0
while 1:
    if K ** (i+1) > N >= K ** i:
        break
    i += 1

print(i+1)

Submission status: Accepted

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

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:
#%%
N, K = map(int, input().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)

ans = len(str(base_10_to_n(N, K)))
print(ans)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
L=[]
while n>0:
   l=n%k
   L.append(l)
   n//=k
print(len(L))

Submission status: Accepted

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    n, k = map(int, args[0].split())

    ret = 1
    while 1 <= n/(k**ret):
        ret += 1
    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Accepted

Solution code:
n,r = 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

ans = Base_10_to_n(n, r)

print(len(str(ans)))

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

Submission status: Accepted

Solution code:
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)

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

Submission status: Accepted

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

Submission status: Accepted

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

tmp = 1
ans = 0
while (tmp <= N):
    tmp *= K
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N,K=map(int,input().split(' '))
for i in range(100):
    if K**(i-1)<=N<K**(i):
        print(i)
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
count = 1
for __ in range(100):
    if int(N//K) > 0:
        count += 1
        N = N//K
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

t = 1
x = K
while K ** t <= N:
    x = x * t
    t += 1

print(t)

Submission status: Accepted

Solution code:

def main():
    n, k = map(int, input().split())
    ans = 0
    while n > 0:
        n //= k
        ans += 1
        if n == k:
            ans += 2
            break

    print(ans)

main()

Submission status: Accepted

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

Submission status: Accepted

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

def a(x, n):
    tmp = x
    out = ''
    while tmp >0:
        out = str(tmp%n)+out
        tmp //= n
    return out

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

Submission status: Accepted

Solution code:
import string
characters = "0123456789"
def base_cvt(value, n=2):
    result = ''
    tmp = value
    while tmp >= n:
        idx = tmp % n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp % n
    result = characters[idx] + result
    return result
def resolve():
    n,k = map(int,input().split())
    print(len(base_cvt(n,k)))
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

result = 0
minus_num = K-1
while N > 0:
    N -= minus_num
    minus_num *= K
    result += 1

print(result)

Submission status: Accepted

Solution code:
import sys

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

keta=0
while n/k!=0:
    keta+=1
    n=n//k

print(keta)

Submission status: Accepted

Solution code:
N,K=map(int, raw_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(str(Base_10_to_n(N,K)))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, K):
    for i in range(10000000000):
        if K ** i > N:
            return i


def main():
    N, K = read_int_n()
    print(slv(N, K))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,K = map(int,input().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)

X = Base_10_to_n(N, K)
X_ = str(X)
print(len(X_))

Submission status: Accepted

Solution code:
import sys


N, K = map(int, sys.stdin.readline().split())

for i in range(0,10000):
    temp = pow(K, i)
    if  temp > N:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import heapq
import copy
import numpy as np
from collections import deque

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

print(int(np.floor(np.log(n)/np.log(k)))+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, K = [int(x) for x in 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
ans = Base_10_to_n(N, K)
print(len(ans))

Submission status: Accepted

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

p=1
dig=0
for i in range(1000):
    p*=K
    dig+=1
    if p>N:
        break

print(dig)

Submission status: Accepted

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

for i in range(31):
    if k**i-1 >= n:
        print(i)
        exit()

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())

d = 0
while 1:
    N //= K
    d += 1
    if N == 0:
        break

print(str(d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def Main(N, K):
    counter = 0
    while(N):
        N //= K
        counter += 1
    return counter
    

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    tmp = [int(i) for i in input().split(" ")]
    N = tmp[0]
    K = tmp[1]
    i = 1
    while True:
        if N < K**i:
            break
        i+=1
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def conv(x, n):
    if x < 0: return None
    if n < 2 or 16 < n: return None

    if x == 0: return 0

    nchar = '0123456789ABCDEF'
    digit = 0

    result = ''

    while x > 0:
        result = nchar[x % n] + result
        x = x // n

    return result

n,k=map(int,input().split())
ans=conv(n,k)
print(len(ans))

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


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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


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()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n % b)
    return str(n % b)


a = base10to(n, k)
print(len(str(a)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, K = map(int, input().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(list(Base_10_to_n(N, K))))

Submission status: Accepted

Solution code:
import math
N, K = [int(x) for x in input().split(' ')]
print(int(math.log(N, K) // 1) + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,K= map(int, input().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:
d = input().split(" ")
n = int(d[0])
k = int(d[1])
a = 0
while n != 0:
	n = n // k
	a += 1
print(a)

Submission status: Accepted

Solution code:
n,k = map(int,input().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)
  
x10 = n
x2 = Base_10_to_n(x10, k)
print(len(x2))

Submission status: Accepted

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

n = N
digit = 0

while n:
    n = n // K
    digit += 1

print(digit)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
tempk = k
ans = 1
while 1:
    if tempk<=n:
        ans+=1
        tempk*=k
        
    else:
        break



print(ans)

Submission status: Accepted

Solution code:
n,r=[int(i) for i in input().split()]
ans=0
while n>0:
    n=n//r
    ans+=1
print(ans)

Submission status: Accepted

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

num = log(N, K)
if int(num) == 0:
    print(1)
else:
    print(ceil(num))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k = [int(x) for x in input().split()]

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

Submission status: Accepted

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