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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, k = map(int, input().split())
c = 0
while n > 0:
    c += 1
    n //= k
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import math

def main():
  N, K = map(int, input().split())
  i = 1
  tmp = 1
  
  while i > -1:
    if N >= K ** i:
      tmp += 1
    else:
      print(tmp)
      return
    
    i += 1
  
  
main()

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

count = 0

while N > 0:
  N //= K
  count += 1
  
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)


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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

    N, K = il()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
tmp = 1
for i in range(1,40):
    if N >= K**i:
        tmp = i+1
    else:
        print(tmp)
        break

Submission status: Accepted

Solution code:
import itertools
import functools
import math
from collections import Counter
from itertools import combinations
import re


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

cnt = 1
while True:
    if cnt > 10000:
        break

    if N // K**cnt == 0:
        print(cnt)
        exit()
    cnt += 1

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

s = ""
while(True):
  if n < k :
    s += str(n)
    break
  else :
    s += str(n%k)
    n = n//k

print(len(s))

Submission status: Accepted

Solution code:
import sys

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

if N<K:
    print(1)
    sys.exit()

M=K
R=1
while M<=N:
    M*=K
    R+=1
print(R)

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

t = 0
for i in range(N):
    N = N//K
    t += 1
    if N == 0:
        print(t)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k = map(int, input().split())
res = 0
m = n-1
a = 1
while True:
    if n <= k**a - 1:
        break
    a += 1
print(a)

Submission status: Accepted

Solution code:
from math import log, ceil

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, k  = na()
ans = 1
i =1
while (k*i <= n):
  i *= k
  ans +=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
a,b=0,0
for i in range(1000000000):
  if n//k ==0:
    break
  else:
    n=n//k
    a+=1
print(a+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from string import printable
def func1(x, b):
    assert(x >= 0)
    assert(1< b < 37)
    r = ''
    while x > 0:
        r = printable[x % b] + r
        x //= b
    return r
def func2(s, b):
    assert(1 < b < 37)
    return int(s, b)
def convert(s, a, b):
    return func1(func2(s, a), b)
n, k= map(int, input().split())
x=convert(str(n), 10, k)
print(len(x))

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

n,k = map(int, input().split())
cnt = 1
a = k
while k <= n:
  k = k*a
  cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
def baseConv(n,ro,ri=10):
    n = int(str(n),base=ri)
    s = ""
    nums = "0123456789abcdefghijklmnopqrstuvwxyz"
    while n:
        s += nums[n%ro]
        n //= ro
    return s[::-1]
  
n,k = map(int,input().split())
print(len(baseConv(n,k)))

Submission status: Accepted

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

Submission status: Accepted

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

def conv(N, K):
    if (int(N/K)):
        return conv(int(N/K), K)+str(N%K)
    return str(N%K)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for x in reversed(range(0,30)):
    if N/(K**x) >= 1:
        print(x+1)
        break

Submission status: Accepted

Solution code:
# 156 B  

n, k = map(int, input().split())
sum = ""
z = n

while z >= 1:
    sum = str((z % k)) + sum
    z = z // k

# print(sum)
print(len(sum))

Submission status: Accepted

Solution code:
# 156 B  ### dbt 

n, k = map(int, input().split())
sum = ""
z = n

while z >= 1:
    sum = sum + str((z % k))
    z = z // k

print(len(sum))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
def cumsum(x):
    return list(np.cumsum(x))

def cumsum_number(N,K,x):
    ans=[0]*(N-K+1)
    number_cumsum = cumsum(x)
    number_cumsum.insert(0,0)
    for i in range(N-K+1):
        ans[i]=number_cumsum[i+K]-number_cumsum[i]
    return ans
"""
int #整数
float #小数

#for
for name in fruits: #fruitの頭から操作
    print(name)

#リスト
list0 = [] #リスト生成
list0 = [1,2,3,4] #初期化
list0 = [0]*10 #[0,0,0,0,0,0,0,0,0,0]
list1= [i for i in range(10)] #>>> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
list1 = list(map(int, input().split()))　# 複数の入力をリストに入れる
number=[int(input()) for i in range(int(input()))] #複数行の入力をリストに
list1 = list1 + [6, 7, 8] #リストの追加
list2.append(34) #リストの追加　最後に（）内が足される
list.insert(3,10) #リストの追加　任意の位置（追加したい位置,追加したい値）
len(list4) #リストの要素数
max(sa) #list saの最小値
list5.count(2) #リスト(文字列も可）内の2の数
list1.sort() #並び替え小さい順
list1.sort(reverse=True)  #並び替え大きい順
set(list1) #list1内の重複している要素を削除し、小さい順に並べる
sum([2,3,   ,3]) #リストの合計

abs(a) #aの絶対値
max(a,b) min(a,b) #最大値　最小値
text1 = text1.replace("34","test") #text1内の"34"を"test"に書き換える(文字列内の文字を入れ替える)

exit(0) #強制終了

cumsum(リスト) #累積和をリストで返す
cumsum_number(N,K,x) #N個の数が含まれるリストx内のK個からなる部分和をリストで返す
"""
N,K=map(int,input().split())
for i in range(10000):
    if K**i<=N<K**(i+1):
        print(i+1)
        exit(0)

Submission status: Accepted

Solution code:
import numpy as np
def cumsum(x):
    return list(np.cumsum(x))

def cumsum_number(N,K,x):
    ans=[0]*(N-K+1)
    number_cumsum = cumsum(x)
    number_cumsum.insert(0,0)
    for i in range(N-K+1):
        ans[i]=number_cumsum[i+K]-number_cumsum[i]
    return ans
"""
int #整数
float #小数

#for
for name in fruits: #fruitの頭から操作
    print(name)

#リスト
list0 = [] #リスト生成
list0 = [1,2,3,4] #初期化
list0 = [0]*10 #[0,0,0,0,0,0,0,0,0,0]
list1= [i for i in range(10)] #>>> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
list1 = list(map(int, input().split()))　# 複数の入力をリストに入れる
number=[int(input()) for i in range(int(input()))] #複数行の入力をリストに
list1 = list1 + [6, 7, 8] #リストの追加
list2.append(34) #リストの追加　最後に（）内が足される
list.insert(3,10) #リストの追加　任意の位置（追加したい位置,追加したい値）
len(list4) #リストの要素数
max(sa) #list saの最小値
list5.count(2) #リスト(文字列も可）内の2の数
list1.sort() #並び替え小さい順
list1.sort(reverse=True)  #並び替え大きい順
set(list1) #list1内の重複している要素を削除し、小さい順に並べる
sum([2,3,   ,3]) #リストの合計

abs(a) #aの絶対値
max(a,b) min(a,b) #最大値　最小値
text1 = text1.replace("34","test") #text1内の"34"を"test"に書き換える(文字列内の文字を入れ替える)

exit(0) #強制終了

cumsum(リスト) #累積和をリストで返す
cumsum_number(N,K,x) #N個の数が含まれるリストx内のK個からなる部分和をリストで返す
"""
N,K=map(int,input().split())
for i in range(10000):
    if K**i<=N<K**(i+1):
        print(i+1)

Submission status: Accepted

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

ans = 1
while True:
    n = n // k
    if n == 0:
        break
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
N = 0
i = 1
c = 0
while c >= 0:
  c = a - b**i
  i += 1
  N += 1
print(N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def conv_num2x(num, x):
    if (int(num/x)):
        return conv_num2x(int(num/x), x)+str(num%x)
    return str(num%x)

def main():
    N,K = LI()
    num_k = conv_num2x(N,K)
    print(len(str(num_k)))

main()

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

M = 0
i = 0

while M < N:
  M += (K-1)*K**i
  i += 1
print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(N,K):
  if N == 0:
    return 1

  digit_num = 0
  while(1):
    if N >= pow(K,digit_num):
      digit_num += 1
    else:
      return digit_num
    
N, K = map(int,input().split())
ans = solve(N,K)
print(ans)

Submission status: Accepted

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

while n >= temp:
    temp *= k
    cnt += 1
print(max(1,cnt))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k=map(int,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())
a = []
if n//k == 0:
  print(1)

else:
  while n//k != 0:
    a.append(n%k)
    n = n//k
  
    if n//k ==0:
      a.append(n%k)
  a.reverse()
  
  print(len(a))

Submission status: Accepted

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

while (n/k != 0):
	tmp = n%k
	digitlist.insert(0,(tmp))
	n = n//k

print(len(digitlist))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,K = (int(x) for x in input().split())
Conv = []
while N!=0:
    Conv.append(N%K)
    N = N//K
    
Disp = ''.join([str(x) for x in Conv[::-1]])
print(len(Disp))

Submission status: Accepted

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

i = 1
while n >= k:
    n //= k
    i += 1

print(i)

Submission status: Accepted

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

N = int(math.floor(math.log(n)/math.log(k)))+1
m = n
L = []
for i in range(N+1):
  L.append(m//(k**(N-i)))
  m = m%(k**(N-i))
  
if L[0] == 0:
  L.pop(0)

print(len(L))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
number, base = map(int, input().split())
result_list = []
while number / base > 0:
  mod = number % base
  result_list.append(str(mod))
  number = number // base

result_list.reverse()
result = "".join(result_list)
print(len(result))

Submission status: Accepted

Solution code:
N,K = map(int, input().split())
ans = 0
while True:
    if N ==0:
        break
    N = N//K
    ans += 1
print(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:
a, b = 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)

print(len(base10to(a,b)))

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

Submission status: Accepted

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

Submission status: Accepted

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

print(c + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

def main():
    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)))
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

D=[]
while N>=K :
    D.append(N%K)
    N=N//K
print(len(D)+1)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

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

ans=1

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

print(ans)

Submission status: Accepted

Solution code:
import math
# N = int(input())
N, K = [int(i) for i in input().split()]
print(math.floor(math.log(N, K))+1)

Submission status: Accepted

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

Submission status: Accepted

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





    
if __name__ == "__main__":
    main()

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,k=map(int,input().split())
d = max(1, math.ceil(math.log(n,k)))
print(d)

Submission status: Accepted

Solution code:
import sys
# 整数の入力
z = list(map(int, input().split()))
# 整数
N = z[0]
# 進数
K = z[1]

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

Submission status: Accepted

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

N = int(math.floor(math.log(n)/math.log(k)))
L = []
for i in range(N+1):
  L.append(n//(k**(N-i)))
  n = n % k**(N-i)
  
print(len(L))

Submission status: Accepted

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



if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

if K == 10:
    print(len(str(N)))
    exit()
cnt = 1
while True:
    if N / (K ** cnt) < 1:
        print(cnt)
        exit()
    cnt += 1

Submission status: Accepted

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

abc156_b()

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
def transform(X, n):
    if (int(X/n)):
        return transform(int(X/n), n)+str(X%n)
    return str(X%n)

print(len(transform(N, K)))

Submission status: Accepted

Solution code:
import math

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

r = int(math.log(N, K))

print(r+1)

Submission status: Accepted

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

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

print(digits)

Submission status: Accepted

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

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:
n,k=list(map(int,input().split()))
import sys
ans=1
import copy
num=copy.deepcopy(k)

while(1):
  if num>n:
    print(ans)
    sys.exit()
  num=num*k
  ans=ans+1

Submission status: Accepted

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

if n < k:
   print(1)
   exit()

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
while(True):
    if n >= k ** count:
        count += 1
    else:
        break

print(count)

Submission status: Accepted

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

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

ans = 0

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

print(ans)

Submission status: Accepted

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

count=1

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

print(count)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
A = ''
while True:
    if N <= 0:
        break
    N = N // K
    B = N % K
    A = A + str(B)
print(len(A))

Submission status: Accepted

Solution code:
def ans(x,n):
    if (int(x/n)):
        return ans(int(x/n),n)+str(x%n)
    return str(x%n)
x,y=map(int,input().split())
result=ans(x,y)
print(len(str(result)))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, k = map(int, open(0).read().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:
def actual(n, k):
    """10進数のnをk進数に変換してその桁数を返す"""

    # 文字列で考えていく方が楽 
    s = ''
    
    while True:
        n, y = divmod(n, k)

        s += str(y)

        if n == 0:
            num_as_k = s[::-1]  # 不要だけど一応やっとく

            return len(num_as_k)

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

print(actual(n, k))

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)

x10,a = map(int,input().split())
xa = Base_10_to_n(x10, a)
print( len(xa) )

Submission status: Accepted

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

Submission status: Accepted

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

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 = 35
x2 = Base_10_to_n(N,K)
print(len(x2))#"100011"が表示される

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


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

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

    print(keta)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


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

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

    print(keta)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
def B():
    n,k = list(map(int, input().split()))
    i = 1
    while True:
        if n < k**i:
            print(i)
            return
        i += 1
B()

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

def main():
    n, k = map(int, input().split())
    num = len(list(Base_10_to_n(n, k)))
    print(num)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
result = 0
# 2進数10進数はそれぞれk種類だからkで割り切れる。
# 1回割るごとにカウントしていく
while N != 0:
    result += 1
    N //= K
print(result)

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())
A=0
while N>=K**A:
    A=A+1

print(A)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率

def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 10**9+7
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    #N = int(input())
    N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    ans=math.floor(math.log(N)/math.log(K))+1
    print(ans)




if __name__ == "__main__":
    main()

Submission status: Accepted

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

n = 1

while True:
    if K ** n > N:
        break

    n = n + 1

print(n)

Submission status: Accepted

Solution code:
import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


# 処理内容
def main():
    N, K = map(int, input().split())
    
    i = 0
    while K**i <= N:
        i += 1
    print(i)


if __name__ == '__main__':
    main()

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:
i=0
N,L=map(int,input().split())
while True:
  if N<L**i:
    print(i)
    break
  elif N==L**i:
    print(i+1)
    break
  i=i+1

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

exp = 1
while pow(k, exp) <= n:
    exp += 1
print(exp)

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

n=n-n%k
ans=1
while n>=k:
  n//=k
  #print(n)
  ans+=1
print(ans)

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:
import math
n,k=map(int,input().split())
print(int(math.log(n, k))+1)