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:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
import pprint
sys.setrecursionlimit(10 ** 9)


INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007



n, k = LI()
ret = 1
cnt = 0
while ret - 1 < n:
    ret *= k
    cnt += 1


print(cnt)

Submission status: Accepted

Solution code:
N,K = list(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())
count = 0
while N:
    N //= K
    count += 1
print(count)

Submission status: Accepted

Solution code:
def main(n, k):
    i = 0

    while n != 0:
        n -= n % (k ** i)
        i += 1

    print(i - 1)


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

    main(n, k)

Submission status: Accepted

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

i=0
a=[]
if K==10:
    print(len(str(N)))
else:
    while N>=K**i:
        i+=1
    i-=1
    for j in range(i+1):
        a.append(N//(K**(i-j)))
        N%=(K**(i-j))
        
    print(len(a))

Submission status: Accepted

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

d = 0

while (k ** d - 1) < n:
    d += 1
print(d)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

length = 1

if N == 1:
    print(1)
    exit()

while True:

    N //= K
    length += 1

    if N < K:
        break

print(length)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

b = a[0]
cnt = 1
while b >= a[1]:
    cnt = cnt + 1
    b = b / a[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)
############################
 
 
#####関数をつかってみる．#####
######今回は二進数に変換######
num, k = input().split()
x2 = Base_10_to_n(int(num), int(k))
print( len(str(x2)) )

Submission status: Accepted

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

def ten_to_K(N,K,conv):
  if N // K == 0:
    conv += str(N % K)
    return conv
  else:
    N = N // K
    conv += str(N % K)
    return ten_to_K(N,K,conv)

ans = ten_to_K(N,K,conv)
print(len(ans))

Submission status: Accepted

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


def solve(N: int, K: int):
    ans=[N%K]
    a=N//K
    b=N%K
    if K==2:
        print(len(bin(N))-2)
        exit()
    elif K==8:
        print(len(oct(N))-2)
        exit()
    while True:
        a=a//K
        ans.append(a%K)
        if a==0:
            break
    print(len(ans))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin

N, K = stdin.readline().rstrip().split()
N = int(N)
K = int(K)

keta = 1
#num = 0
K_ = K
while 1:
	if N < K:
		break
		
	else:
#		num += 1
		keta += 1
#		print(num)
		K *= K_
#		print('keta ... ' + str(keta))
#		print('K    ... ' + str(K))
	
print(keta)

Submission status: Accepted

Solution code:
N, K = map(int, input().rstrip().split())
l = []
mod = -1
while N != 0:
    N, mod = divmod(N, K)
    # print(N, mod)
    l.append(mod)
print(len(l))

Submission status: Accepted

Solution code:
import sys

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

q = N // K
count = 1
while q:
    q //= K
    count += 1

print(count)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
dig = (math.floor(math.log(a) / math.log(b)) + 1)
print(dig)

Submission status: Accepted

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

for i in range(100):
  if K ** i > N:
    Ans = i
    break

print(Ans)

Submission status: Accepted

Solution code:
N,K=input().split(' ')
N=int(N)
K=int(K)
i=0
while N!=0:
    N//=K
    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)
  
N,K = map(int,input().split())
A = Base_10_to_n(N, K)
print(len(A))

Submission status: Accepted

Solution code:
import math

NK = input().split()
N = int(NK[0])
K = int(NK[1])

if N == 0:
  result = 1
else:
    result = int((math.log(N, K) + 1) // 1)

print(result)

Submission status: Accepted

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

ans = int(math.log(n, k))

print(ans+1)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
#%%time
i = 0
ans = 0
while i <= 10**9:
    if N < K:
        ans = 1
        break
    elif N == K:
        ans = 2
        break
    elif K**i > N:
        ans =  i
        break
    else :
         i += 1 
print(ans)

Submission status: Accepted

Solution code:
import math
 
s = input().split()
n, k = int(s[0]), int(s[1])
 
ans = int(math.log(n, k) + 1.0)
print(ans)

Submission status: Accepted

Solution code:
s = input().split() 
n = int(s[0])
k = int(s[1])

i = 1

while k ** i <= n:
  i += 1

print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# coding: utf-8
# Your code here!
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(list(x2)))

Submission status: Accepted

Solution code:
import sys
[N,K] = [int(s) for s in sys.stdin.read().split()] #リスト作成
a = 0
l = 1
while l != 0:
  if N >= K**a:
    a += 1
  else:
    l = 0
print(a)

Submission status: Accepted

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


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


x = base10to(n, k)

print(len(x))

Submission status: Accepted

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

out = []
while 1:
  out.append(N%K)
  N = int(N/K)
  if N == 0:
    break
  elif 0 < N <= K-1:
    out.append(K-1)
    break
print(len(out))

Submission status: Accepted

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

count=0

while N>=K:
    a=N%K
    N=N//K
    count+=1

print(int(count)+1)

Submission status: Accepted

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

def solve(N: int, K: int):
    print(str(math.floor(math.log(N,K))+1))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()

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())
cnt = 0
while True:
    if N <= 0:
        break
    else:
        N = N//K
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
if n <= k-1:
    print(1)
else:
    n -= (k-1)
    for s in range(1, 1000000000):
        if n > (k**s)*(k-1):
            n -= (k**s)*(k-1)
        else:
            print(s+1)
            break

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt+1)

Submission status: Accepted

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics
import heapq


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

data = getInputListInt()
n = data[0]
k = data[1]

counter = 1
num = k

flg = True
while flg:
    if n > num-1:
        num *= k
        counter += 1
    else:
        flg = False

print(counter)

Submission status: Accepted

Solution code:
a,b = input().split()
A = int(a)
B = int(b)
import numpy as np
print(len(np.base_repr(A,B)))

Submission status: Accepted

Solution code:
n, k = input().split()
import math
def findNumberOfDigits(n, base):
    dig = (math.floor(math.log(n) /
                      math.log(base)) + 1)
    print(dig)

findNumberOfDigits(int(n), int(k))

Submission status: Accepted

Solution code:
def main():
    n,k = map(int,input().split())
    temp = n
    answer = ""
    while temp > 0:
        answer = str(temp % k) + answer
        temp = temp // k
    print(len(answer))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

while N != 0:
    digit.append(N%K)
    N = N//K

print(len(digit))

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

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

Submission status: Accepted

Solution code:
import string
numbers = "0123456789"
alphabets = string.ascii_letters # a-z+A-Zをロード
characters = numbers + alphabets

def base_cvt(value, n=2):
    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

def main():
  n,k = map(int,input().split())
  if k==10:
    print(len(str(n)))
  else:
    nbr = base_cvt(str(n), k)
    print(len(str(nbr)))
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n, k = map(int, input().split(" "))
    smaller = True
    index = 0
    while (smaller):
        index+=1
        smaller = n >= k ** index
    print(index)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

def shinsu(n,k):
    if(int(n/k)):
        return shinsu(int(n/k),k) + str(n%k)
    return str(n%k)

print(len(shinsu(N,K)))

Submission status: Accepted

Solution code:
import math as m

N,K=[int(e) for e in input().split(' ')]

print(int(m.log(N)//m.log(K) + 1))

Submission status: Accepted

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

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

print(ans - 1)

Submission status: Accepted

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

Submission status: Accepted

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

def b(x,n):
    xd=x
    o=""
    while xd>0:
        o=str(xd%n)+o
        xd=int(xd/n)
    return o
    
print(len(b(n,k)))

Submission status: Accepted

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

count = 0
while y**count <= x:
    count += 1
print(count)

Submission status: Accepted

Solution code:
from sys import stdin

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 = [int (x) for x in stdin.readline().rstrip().split()]
    result = len(str(N)) if K == 10 else len(Base_10_to_n(N, K)) 
    print(result)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (n, k) = [int(e) for e in lines[0].split(" ")]

    return (n, k)


def solve(n, k):

    tmp = math.log(n, k)
    if tmp.is_integer():
        result = math.ceil(tmp) + 1
    else:
        result = math.ceil(tmp)

    return result
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

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 = [int(x) for x in input().split(" ")]

i=1
x=K

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

print(i)

Submission status: Accepted

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

n = int(input[0])

k=  input[1]

ln = len(str(n))
sum =0
i=0
while True :
    i+=1
    # print( k,i,k**i,"////",n % (k**i) )
    
    if n % (k**i)== n :
        break
    # print( k,"**",i,"=",k**i)
    
print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    N, K = map(int, input().split())
    
    ex = 1
    while K ** ex <= N:
        ex += 1
    print(ex)
    
if __name__ == '__main__':
    solve()

Submission status: Accepted

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

N_nketa = (int(N_n)+1)

print(N_nketa)

Submission status: Accepted

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

mod = 100
count = 0
while n > 0:
    n, mod = divmod(n,k)
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,R = input().split()
i = int(N)
j = 0

while i // int(R) > 0:
    j += 1
    i = i // int(R)
print(j+1)

Submission status: Accepted

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

x=0
while k**(x)<=n:
  x+=1
print(x)

Submission status: Accepted

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

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 = str(Base_10_to_n(N, K))
print( len(x) )

Submission status: Accepted

Solution code:
def base_oct_to_n(x, n):
    tmp = x
    out = ''
    while tmp > 0:
        out = str(tmp % n) + out
        tmp = int(tmp/n)
    return out


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

Submission status: Accepted

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

if K == 2:
    ans = len('{:b}'.format(N))
elif K == 8:
    ans = len('{:o}'.format(N))
elif K == 10:
    ans = len(str(N))
else:
    nn = N
    out = ''
    while nn>0:
        out = str(nn%K)+out
        nn = int(nn/K)
    ans = len(out)



print(ans)

Submission status: Accepted

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

ans = []
while True:
    q, mod = divmod(n, k)
    ans.append(mod)
    n = q
    if n == 0:
        break

# print(ans[::-1])
print(len(ans))

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:
n, k = map(int, input().split())
if n == 1:
    print(1)
else:
    for i in range(10**9):
        n /= k
        if k > n:
            print(i+2)
            break

Submission status: Accepted

Solution code:
N, K = [int(n) for n in input().split()]
ans = []
while 0<N:
    N, m = divmod(N, K)
    ans.append(m)
print(len(ans))

Submission status: Accepted

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

def base(n, b):
    k = 97 + abs(b - 10)
    dic= {}
    k2 = ""
    k3 = 10
    for i in range(97, k +1):
        dic[k3] = chr(i)
        k3 +=1
    while n>=b:
        mod= int(n%b)
        n = int(n//b)
        if mod in dic.keys():
            k2 += dic[mod]
            continue
        k2 += str(mod)
    k2 += dic[n] if n in dic.keys() else str(n)
    return k2[::-1]
print(len(base(n, k)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list = list(map(int, input().split()))
original = list[0]
n = list[1]
x = 0
ans = 0

if original//n != 0:
  x = original//n
  ans += 2
  while x//n != 0:
    x = x // n
    ans += 1
  print(ans)
else:
  print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N,K = inpl()
ans = 0
while K**ans <= N:
    ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

     return str(X%n)

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

print(len(Base10_n(p, k)))

Submission status: Accepted

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

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

for i in range(35, -1, -1):
    if n >= k**i:
        result = i+1
        break
print(result)

Submission status: Accepted

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

temp=1
for i in range(10**5):
    temp*=k
    if(temp>n):
        print(i+1)
        break

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:
from math import log
def solve():
    N, K = map(int, input().split())
    print(int(log(N, K)) + 1)

solve()

Submission status: Accepted

Solution code:
import string
n,k = map(int, input().split())
digs = string.digits + string.ascii_letters


def int2base(x, base):
    if x < 0:
        sign = -1
    elif x == 0:
        return digs[0]
    else:
        sign = 1

    x *= sign
    digits = []

    while x:
        digits.append(digs[int(x % base)])
        x = int(x / base)

    if sign < 0:
        digits.append('-')

    digits.reverse()

    return ''.join(digits)
  
print(len(int2base(n,k)))

Submission status: Accepted

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

import math

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

i = k
cnt = 0

while True:
  
  if math.floor(n / i) <= 0:
    print(cnt+1)
    break
  
  cnt+=1
  i *= k

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))
dec_num, base_num = n[0], n[1]
ans, n = "", 0

while True:
    if dec_num <= 0:
        break
    
    n = dec_num % base_num
    dec_num = int(dec_num / base_num)
    ans += str(n)

if ans[:1:-1] == "0":
    ans += "1"

ans[::-1]
print(len(ans))

Submission status: Accepted

Solution code:
line = input('')
n = int(line.split(' ')[0])
k = int(line.split(' ')[1])
ret = 0
for i in range(1,100):
  n2 = k**i
  if n2 > n:
    ret = i
    break
print(ret)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

if n == 1:
    res = 1
else:
    res = 1
    while True:
        res += 1
        n = n // k 
        if n < k:
            break

print(res)

Submission status: Accepted

Solution code:
s = input().split()
n = int(s[0])
k = int(s[1])
k2 = k

i = 1
while True:
  if (n / k) < 1:
    break
  else:
    i += 1
    k *= k2
print(i)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(32):
    if n // (k**(31-i)) > 0:
        print(31-i+1)
        break

Submission status: Accepted

Solution code:
N, K = list(map(int, input().split(' ')))
count = 1
com_val = K
while com_val <= N:
    count += 1
    com_val = pow(K, count)
print(count)

Submission status: Accepted

Solution code:
from math import *
n,k=map(int,input().split())
if k>=n:
    print(1)
    exit()
print(ceil(log(n,k)))

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
ans=[]
while n:
    if n%k != 0:
        ans.append(n%k)
        n=n//k
    else:
        ans.append(0)
        n = n//k

print(len(ans))

Submission status: Accepted

Solution code:
N,K=map(int,input().split())
a=N
s=""
while(a):
    a=a//K
    b=a%K
    s=str(b)+s

print(len(s))

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
n = []
temp = N
count = temp
for i in range(N):
    while count >=K:
        a = count//K
        b = count%K
           #  print(a)
   #     print(b)
        n.append(b)
        count = a
    #    print(count)
    else:
        n.append(count%K)
        break
print(len(n))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
xxx = 1000000000
yyy = 0
for i in range(xxx):
    if i == 0:
        continue
    elif A <= (B ** i ) -1:
        yyy = i
        break
print(yyy)

Submission status: Accepted

Solution code:
from sys import stdin
n, k = [int(x) for x in stdin.readline().rstrip().split()]

#print(n, k)

def convert_to_n(num, n):
    if (int(num/n)):
        return convert_to_n(int(num/n), n)+str(num%n)
    return str(num%n)

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

Submission status: Accepted

Solution code:
import math
a = list(map(int, input().split()))
print(math.floor(math.log(a[0],a[1])) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    n = n // k 
    count += 1
    if n <= 0:
        break
    
    

print(count)

Submission status: Accepted

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

a = []
i = 0
while N > 0:
    a.append(N % K)
    N = N // K
    i += 1

ans = ''
while i > 0:
    ans += str(a[i - 1])
    i -= 1

ansl = len(ans)

print(ansl)

Submission status: Accepted

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

i=0
a=1
r=[]

while(N!=0):
  a=N%K
  N=N//K
  i+=1

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

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

m = 1

while K ** (m-1) <= N:
    m += 1

print(m - 1)

Submission status: Accepted

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

Submission status: Accepted

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

keta = 0
while 1:
  if n%k == 0:
    n = n/k
  else:
    n = n-n%k
    n = n/k
  keta = keta + 1
  if n == 0:
    break
print(keta)

Submission status: Accepted

Solution code:
inpl = lambda: list(map(int,input().split()))
N, K = inpl()
n = 1
ans = 0
while n <= N:
    n *= K
    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)
x2 = 0
x10, n = input().split()
x10 = int(x10)
n = int(n)
x2 = Base_10_to_n(x10, n)
print(len(x2))

Submission status: Accepted

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

r = 0
while k ** r <= n:
  r +=1
print(r)

Submission status: Accepted

Solution code:
n,k = (int(x) for x in input().split())
l = 1
m = k
while n >= k:
   k = k * m
   l = l+1
   
print(l)

Submission status: Accepted

Solution code:
import math

l=input().split()
N=int(l[0])
K=int(l[1])
cnt=0
a=N

while True:
    a=math.floor(a/K)
    cnt+=1
    if a==0:break

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

  
print(len(a))