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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(10000000001) :
    p = pow(K,i)
    # print(K,i,p)
    if (N < p) :
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

con = True
i = 0
while con:
    if N - K**i <0:
        print(i)
        break

    else:
        i += 1

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(Base_10_to_n(N,K)))

Submission status: Accepted

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

while n > 0:
    n = n // k #// = 切り捨て除算
    ans += 1
print(ans)

Submission status: Accepted

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

    i = 1
    #if N > K:
    #    print(1)
    
    while N // K > 0:
        i += 1 
        N = N / K
 
    print(i)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

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

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:
def main():
    n,k=map(int,input().split())
    i=0
    while n:
        n//=k
        i+=1
    print(i)
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)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
def trans(x,k):
    string=""
    while x!=0:
        u,v=divmod(x,k)
        string=str(v)+string
        x=u
    return string
print(len(trans(n,k)))

Submission status: Accepted

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

cnt = 1
while True:
    if N < K:
        break
    else:
        N = N/K
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(string):
    n, k = map(int, string.split())
    c = 1
    while n >= k:
        c += 1
        n //= k
    return str(c)


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
n, k = map(int, input().split())
print(int(math.log2(n) / math.log2(k)) + 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:
N,K=list(map(int,input().split()))
i=0
while N>0:
    N//=K
    i+=1
print(i)

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


def hoge(n, k):
    if N == K:
        return len(str(n))
    for i in range(n + 1):
        tmp = k ** i
        if tmp > n:
            # if tmp < K:
            return i
            # else:
            #    continue


print(hoge(N, K))

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 = 1

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

print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Mar  2 23:52:06 2020

@author: Kanaru Sato
"""

N,K = list(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())

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

Submission status: Accepted

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

count = 1

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from itertools import takewhile, count


def solve(N: int, K: int):
    return max(takewhile(lambda i: N >= (K ** i), count(0))) + 1

# 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
    print(solve(N, K))

if __name__ == '__main__':
    main()

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:
# -*- coding: utf-8 -*-

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

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

print(c)

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

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())
pointer = 0
while (k**pointer <= n):
    pointer += 1
    
print(pointer)

Submission status: Accepted

Solution code:
N,K=map(int, input().split())
l=[]
for i in range(40):
    if N>=K**i:
        l.append(i)

    else:
        break

print(l[-1]+1)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
result = ''
while n != 0:
    result = str(n % k) + result
    n = n // k
result = int(result)
i = 0
while  result / 10 ** i >= 1:
    i += 1
print(i)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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)

i, N = map(int,input().split())
print(len(base10to(i,N)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(d)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split()) 
lst_b=[] 
lst_c=[] 
while(True): 
    b=n//m 
    c=n%m 
    lst_b.append(b) 
    lst_c.append(c) 
    n=b 
    if b==0: 
    	print(len("".join(map(str,lst_c[::-1])))) 
    	break

Submission status: Accepted

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

digit_count = 0
while n != 0:
    n //= k 
    digit_count += 1
print(digit_count)

Submission status: Accepted

Solution code:
import os

def main():

    N,K = (int(x) for x in input().split())
    count = 0

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

    print(count)

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:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, K = map(int, input().split())
q=N

keta = 0
for num in range(100):
    q, mod = divmod(q, K)
    keta=keta+1
    if q==0:
        break


print(keta)

Submission status: Accepted

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

Submission status: Accepted

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


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


print(len(conv(N, K)))

Submission status: Accepted

Solution code:
def main():

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

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

Submission status: Accepted

Solution code:
N,K=map(int,input().split())
ans = 0
while N > 0:
    N -=(K -1)*(K**ans)
    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:
import sys
sys.setrecursionlimit(int(1e6))

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

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

print(ans)

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

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

Submission status: Accepted

Solution code:
import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
from functools import lru_cache
INF = 1 << 60

#ここから書き始める
n, k = map(int, input().split())
ans = 0
while n > 0:
    if n < k:
        ans += 1
    else:
        ans += 1
    n //= k
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:
def resolve():
    n, k = map(int, input().split())
    div_val = k
    i = 1
    while True:
        if n / div_val < 1:
            print(i)
            return
        else:
            div_val *= k
            i += 1
            
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

l = []
while N >= K:
    a = N % K
    N = N // K

    l.append(a)


print(len(l) + 1)

Submission status: Accepted

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

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

Submission status: Accepted

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

digits = []
N_tmp = N
while N_tmp > 0:
    digits.append(N_tmp % K)
    N_tmp //= K

# print(''.join(map(str, digits[::-1])))
print(len(digits))

Submission status: Accepted

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

Submission status: Accepted

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

counter = 0
while n!=0:
    n = int(n/k)
    counter+=1
print(counter)

Submission status: Accepted

Solution code:
list_input = list(map(str,input().split()))
n, k = int(list_input[0]), int(list_input[1])

counter = 0

while n!=0:
    n = int(n/k)
    counter+=1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def change(n,k):
    if n == 0 :
        return x
    else:
        x.append(n % k)
        return change(n // k,k)

n,r = map(lambda x: int(x),input().split())
global x
x = []
print(len(change(n,r)))

Submission status: Accepted

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

Submission status: Accepted

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

n, k = list(map(int, input().split()))
r = 1
while (n >= k**r):
  r = r + 1
print(r)

Submission status: Accepted

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

ans = 0
i = 0

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

Submission status: Accepted

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

counter = 0
if a == 0:
    pass
else:
    while a!= 0:
        a = int(a/b)
        counter+=1

print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A = int(N)
count = 0
while (A!=0):
  A = int(A/K)
  B = int(A%K)
  count +=1
print(count)

Submission status: Accepted

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

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())
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:
def main():
    info = input()
    info = info.split()
    
    number = info[0]
    add_cim = int(info[1])
    
    replace_number = "".join(list(reversed(number)))
    check_number = 0
    for num in range(len(replace_number)):
        check_number = check_number + int(replace_number[num])*(10**num)
    
    result_num = ""
    while True:
        if check_number < add_cim:
            result_num = result_num + str(check_number % add_cim) 
            break
        else:
            result_num = result_num + str(check_number % add_cim)
            check_number = int(check_number / add_cim)
    
    print(len(str(result_num)))

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Mar  1 14:25:07 2020

@author: Kanaru Sato
"""

N, K = map(int, input().split())
r = N
res = 0

while r >= K:
    r /= K
    res += 1

print(res+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, x = map(int, input().split())
ans = []
while n!=0 :
    ans.append(n % x)
    n = n // x
print(len(ans))

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())
c = k
t = 1
while  c<=n  :
    c*=k
    t+=1
print(t)

Submission status: Accepted

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

def func(n,k):
    count = 0
    while True:
        if n / k >= 1:
            n //= k
            count += 1
        else:
            break
    return count + 1

print(func(n,k))

Submission status: Accepted

Solution code:
N, K = [int(x) for x in input().split(' ')]
 
x = 0
 
while True:
  if N < (K ** x):
    print(x)
    break
  x+=1

Submission status: Accepted

Solution code:
import math
import string


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


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = 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)


a = Base_10_to_n(a, b)
print(len(a))

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)
 
data_list = list(map(int,input().split(" ")))
ans = Base_10_to_n(data_list[0], data_list[1])
print(len(ans))

Submission status: Accepted

Solution code:
def reVal(num):
	if (num >= 0 and num <= 9):
		return chr(num + ord('0'))
	else:
		return chr(num - 10 + ord('A'))
def strev(str):
	par = len(str)
	for i in range(int(par / 2)):
		temp = str[i]
		str[i] = str[par - i - 1]
		str[par - i - 1] = temp
def fromDeci(res, base, inputNum):
	index = 0
	while (inputNum > 0):
		res+= reVal(inputNum % base)
		inputNum = int(inputNum / base)
	res = res[::-1]
	return res

n,k = list(map(int,input().split()))
res = ""; 
x = fromDeci(res, k, n)
print(len(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())

digit = 1
while N >= K**digit:
    digit += 1
print(digit)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def f(x, y):
  a = x // y
  if a:
    return 1 + f(a, y)
  else:
    return 1

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

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:
def from_n_to_k(n, k):
  keta = []
  while n >= k:
    a = n % k
    keta.append(a)
    n = n // k
  return len(keta) + 1

num = [int(n) for n in input().split()]

r = from_n_to_k(num[0], num[1])
print(r)

Submission status: Accepted

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

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(max(1,math.ceil(math.log(n,k))));

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,K = input().split()
N1 = int(N)
K1 = int(K)
for i in range (1000):
    if K1**(i-1) <= N1 and N1 < K1**i:
        print(i)
        break

Submission status: Accepted

Solution code:
inputs=input().split(" ")
N=int(inputs[0])
K=int(inputs[1])
i=0

while N>=K:
    N=int(N/K)
    i+=1

i+=1

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:
import math
n = [int(e) for e in input().split(" ")]
print(math.ceil(math.log(n[0], n[1])) if n[0] != 1 else 1)

Submission status: Accepted

Solution code:
def cal(N, K, cnt):
  return cnt if N < K else cal(N/K, K, cnt + 1)

N, K = map(int, input().split())
print(cal(N, K, 1))

Submission status: Accepted

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

ans = ''
while n:
	ans += str(n % k)
	n //= k
print(len(ans))

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
answer = 0
while True:
    if n // k != 0:
        n = n // k
        answer += 1
    else:
        break
print(answer + 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:
N, K = map(int, input().split())

import numpy as np

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k=map(int, input().split())
keta=0
w = True
t = n
while w:
    t = t /k
    keta = keta+1
    if t < 1 :
         w = False
print(keta)

Submission status: Accepted

Solution code:
import numpy as np
import math as m

def main(**kwargs):
    r = int(m.log(n) / m.log(k)) + 1
    return r

if __name__ == "__main__":
    cin = np.array(input().split(" ")).astype("int")
    n, k = cin

    cout = main(n=n, k=k)
    print(cout)

Submission status: Accepted

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

while N >= K:
    a = N % K
    ans_list.append(a)
    N = N / K

ans_list.append(N / K)

print("{}".format(len(ans_list)))

Submission status: Accepted

Solution code:
import numpy as np

def main(n, k):
    res = int(np.log(n) / np.log(k)) + 1
    return res

if __name__ == "__main__":
    cin = input()
    n = int(cin.split(" ")[0])
    k = int(cin.split(" ")[1])
    cout = main(n, k)
    print(cout)

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)
s = list(' '.join(x2).split())
print(len(s))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import log, ceil

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

if ceil(log(n,k)) != log(n,k):
    print(ceil(log(n,k)))
else:
    print(ceil(log(n,k))+1)

Submission status: Accepted

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

integer = num[0]
base = num[1]
count = 1

while integer >= base:
  integer = integer // base
  count = count + 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

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

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

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)


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

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
i = 0
if n == 0:
    print(1)
    exit()
else:
    while k ** i <= 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:
N,K=map(int,input().split())

import string
numbers = "0123456789"
alphabets = string.ascii_letters # a-z+A-Zをロード
characters = numbers + alphabets
 
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

print(len(base_cvt(N,K)))

Submission status: Accepted

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

print(digit)

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:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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

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

    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def Base_10_to_n(n, k):
  if int(n/k):
    return Base_10_to_n(int(n/k), k)+str(n%k)
  return str(n%k)
 
x = Base_10_to_n(n, k)
print(len(x))

Submission status: Accepted

Solution code:
def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))


n,k = miinps()

ans = 0

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

print(ans)

Submission status: Accepted

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

c=1
while n >= k:
  n = int(n/k)
  c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input().split(" ")
suji = a[0]
sinsu = a[1]
count = int(0)

for i in range(100):
  if suji == 0:
    break
  else:
    suji = int(suji) // int(sinsu)
    count = count + 1 

print(count)

Submission status: Accepted

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

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

for i in range(31):
    if k**i > n:
        break
        
print(i)

Submission status: Accepted

Solution code:
from math import *

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

print(floor(log(n, k)) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
while True:
    cnt+=1
    if n < k:
        break
    n //= k

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import math

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

ans = math.floor(np.log(N)/np.log(K))+1

print(ans)

Submission status: Accepted

Solution code:
N, K = tuple(list(map(int, input().split(' '))))
count = 1
while True:
    if N < K:
        break
    else:
        N = int(N / K)
        count += 1

print(count)

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:
l=[int(x) for x in input().split()]
N=l[0]
K=l[1]
ans = []

while True:
  ans.append(int(N) % int(K))
  N = int(N) / int(K)
  if int(N) == 0:
    break
  elif N < K:
    ans.append(int(N))
    break
    
print(len(ans))

Submission status: Accepted

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

ans = 1

for i in range(n):
    if k**(i-1) <= n and n < k**i:
        ans = i
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=[str(x) for x in input().split()]
n=int(l[0])
base=l[1]
op=str()
while n>0:
	op=op+str(int(n)%int(base))
	n=int(n)//int(base)
print(len(op))

Submission status: Accepted

Solution code:
import math
[n, r] = map(int, input().rstrip().split(' '))

count = 1

while True:
    res = n // r
    if res == 0:
        break
    else:
        n = n // r
        count += 1

print(count)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
if n < k:
  print(1)
else:
  c = n // k
  ans = 1
  while (c >= 1):
    ans += 1
    c = c // 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)
    
N,K=(int(x) for x in input().split())
ksinstr = Base_10_to_n(N, K)
ketasuu = len(list(ksinstr))
print(ketasuu)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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