Problem:


Score : 200 points

Problem Statement

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

Notes

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

Constraints

All values in input are integers.

1 \leq N \leq 10^9

2 \leq K \leq 10

Input

Input is given from Standard Input in the following format:

N K

Output

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

Sample Input 1

11 2

Sample Output 1

4

In binary, 11 is represented as 1011.

Sample Input 2

1010101 10

Sample Output 2

7

Sample Input 3

314159265 3

Sample Output 3

18



Sample input:
11 2


Sample output:
4

Submission status: Accepted

Solution code:
import math

if __name__=="__main__":
    n, k = map(int, input().split())
    log_k_n = math.log10(n)/math.log10(k)
    if math.floor(log_k_n) == math.ceil(log_k_n):
        print(math.ceil(log_k_n) + 1)
    else:
        print(math.ceil(log_k_n))

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

print(i)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

ans=0

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


print(ans)

Submission status: Accepted

Solution code:
def main():
    from math import log,floor,ceil
    n,k=map(int,input().split())
    x=log(n,k)
    if floor(x)==ceil(x):
      x+=1
    x=ceil(x)
    print(x)
  
if __name__=='__main__':
    main()

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

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

Submission status: Accepted

Solution code:
def conv(num,b):
    convStr = "0123456789abcdefghijklmnopqrstuvwxyz"
    if num<b:
        return convStr[num]
    else:
        return conv(num//b,b) + convStr[num%b]

first_line = input().split(" ")

print(len(conv(int(first_line[0]), int(first_line[1]))))

Submission status: Accepted

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

digit = 0
k = K
while N:
  r = N % k
  N -= r
  k *= K
  digit += 1

print(digit)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N, K = map(int, input().split())

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

    print(len(func(N, K)))


main()

Submission status: Accepted

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

a, b = map(int, input().split())
print("{}".format(len(Base_10_to_n(a,b))))

Submission status: Accepted

Solution code:
import itertools
import sys

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

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

c = Base_10_to_n(n , k)

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


main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n,k = map(int,input().split())
ans = 1
while True:
    if n >= k**ans: ans += 1
    else: break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

def calculate(n,k):
    m = 0
    while k**m <= n:
        m = m + 1

    return m


result = calculate(n,k)

print(result)

Submission status: Accepted

Solution code:

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

def main():
    #a = int(input())
    #l = list(map(int, input().split()))
    n,k = map(int, input().split())

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




if __name__ == '__main__' :
    main()

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(_) for _ in input().split()]

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

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

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

Submission status: Accepted

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

f=False
p=0
while f==False:
    if N/(K**p) < 1:
        f=True
        p-=1
    p+=1
print(p)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n, k = map(int, input().split())

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

print(m)

Submission status: Accepted

Solution code:
import sys

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

def solve(N, K):
    print(len(str(base10to(N, K))))

if __name__ == '__main__':
    N, K = map(int, sys.stdin.readline().strip().split(" "))
    solve(N, K)

Submission status: Accepted

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

Submission status: Accepted

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

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)
N, K = map(int, input().split())
print(len(base10to(N, K)))

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
ans = 0
for i in range(10**9):
    if n >=k:
        n = n//k
        ans +=1
    else:
        break
print(ans+1)

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 = input().split()
print(len(Base_10_to_n(int(N), int(K))))

Submission status: Accepted

Solution code:
time_line = input().rstrip().split(" ")
time_a = int(time_line[0])
time_b = int(time_line[1])
keta=0


while(time_a>time_b-1):
    time_a=time_a//time_b
    keta+=1


print(keta+1)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, K = list(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())
num = 0
while True:
  if K ** num > N:
    break
  num += 1
print(num)

Submission status: Accepted

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

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

Submission status: Accepted

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

i = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

result = 0
for i in range(100000):
    if k**i > n:
        break
    else:
        result += 1
print(result)

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:
s = input().split()
N = int(s[0])
K = int(s[1])

for i in range(10000):
    if K**i <= N and N < K**(i+1):
        ans = i+1
        break

print(ans)

Submission status: Accepted

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

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

print(len(str(convert(n,r))))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-02-22 21:06:15 +0900
# LastModified: 2020-02-22 21:11:34 +0900
#


import os
import sys
import numpy as np


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



if __name__ == "__main__":
    main()

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 = 35
# x2 = Base_10_to_n(x10, 2)
# print(x2)  # "100011"が表示される．def Base_10_to_n(X, n):
# print(len(x2))

n,k=map(int,input().split())
result = Base_10_to_n(n,k)
# print(result)
print(len(result))
# http://pixelbeat.jp/how_to_convert_n_ary_value_to_-decimal_and_decimal_to_n_ary/
#http://techtipshoge.blogspot.com/2010/05/10n.html
# http://iatlex.com/python/base_change#10n-2
# を参考にした

Submission status: Accepted

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

n,k = input().rstrip().split(' ')

n = int(n)
k = int(k)
K = k
count = 1

while(1):
    if K > n:
        print(count)
        break
    K = K*k
    count += 1

Submission status: Accepted

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

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

Submission status: Accepted

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

def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
    
    
s = Base_10_to_n(N, K)
print(len(s))#

Submission status: Accepted

Solution code:


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

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

print(count+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, K = list(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:
import math

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

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

print(result)

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
list=[]
for i in range(n+2):
    c=n//k
    d=n%k
    n=c
    if c==0:
        e=1
        break
    if c < k:
        e=i+2
        break
print(e)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    vn = vk = vn_k = 1
    for i in range(1, n+1):
        vn = vn * i % modp
        if i == k:
            vk = vn
        if i == n-k:
            vn_k = vn
    return vn * get_inv(vk, modp) * get_inv(vn_k, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

def main():
    N,K=mis()
    import numpy as np
    print(len(str(np.base_repr(N,K))))

main()

Submission status: Accepted

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

Submission status: Accepted

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

a=0
b=0
c=0
if N<K:
        c+=1
        print(c)
        exit()
for _ in range(36): #log2 10^9=9log2 10<36
    a=N//K
    b=N%K
    N=a
    c+=1
    if a<K:
        c+=1
        print(c)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

def main():

    input = stdin.readline

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


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

def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=0
s=''
if b>a:
    print(1)
else:
    while a>=1:
        s+=str(a%b)
        a//=b
        c+=1
    print(len(s))

Submission status: Accepted

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

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 = list(map(int, input().split()))
x = change(N, K)
print(len(x))

Submission status: Accepted

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

ans = 0
while True:
  if n < k ** ans:
    print(ans)
    break
  else :
    ans += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Code for B - Digits
# Use input() to fetch data from STDIN
import math

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

total = 0
while math.floor(n / k) != 0:
    total += 1
    n = math.floor(n / k)

print(total + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

s=N
a=0
ans=""
while s!=0:
    N=s
    s = N//K
    a = N%K
    ans += str(a)

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

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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(100):
  if n<r**i:
    print(i)
    break

Submission status: Accepted

Solution code:
def main():
    n,k = map(int,input().split())
    bi = ''
    while n != 0:
        bi += str(n % abs(k))
        if k < 0:
            n = -(-n // k)
        else:
            n = n // k
    bilast = bi[::-1]
    print(len(bilast))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out


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

x = int(Base_10_to_n(n, k))
#print(x)
ans = 0
while x >= 1:
    x /= 10
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
# スペース区切りの整数の入力
n, k = map(int, input().split())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
def base_10_toi_n(x,n):
    if int(x/n):
        return base_10_toi_n(int(x/n),n)+str(x%n)
    return str(x%n)
print(len(base_10_toi_n(N,K)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8 ff=unix


def solv(N, K):
    ans = 1
    while N >= K:
        N = N // K
        ans += 1
    return ans


if __name__ == "__main__":

    # N K
    #
    N, K = map(int, input().split())
    ans = solv(N, K)

    print(ans)

Submission status: Accepted

Solution code:



def main():
    def digit(x, n):
        x_tmp = x
        res = ''
        while x_tmp > 0:
            res += str(x_tmp % n)
            x_tmp = int(x_tmp/n)
        return len(res)

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

    print(digit(n, k))



if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

n,r=map(int,input().split())
x2 = Base_10_to_n(n, r)
print( len(x2) )

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest

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

    c=1
    s=k
    while 1:
        if s>n:
            print(c)
            return
        s*=k
        c+=1

    return

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

N = (int)(N)
K = (int)(K)

ans=""

while(N >= K):
    ans += str(N%K)
    N = N//K
ans += (str)(N)

print(len(ans))

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:
inp = [int(i) for i in input().split()]
N = inp[0]
K = inp[1]
n = N
c = 0
while n>=1:
  n /= K
  c += 1
print(c)

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:
x,y = 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

x2 = Base_10_to_n(x, y)
print(len(str(x2)))

Submission status: Accepted

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

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# %%
stdin = open(0)

# %%
N, K = map(int, stdin.read().split())


# %%
digits = 0
while N:
    digits += 1
    N //= K

# %%
print(digits)

# %%

Submission status: Accepted

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

result = ''
while N>0:
    result = str(N%K) + result
    N //= K

print(len(result))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B
N,K = map(int,input().split())
amari = []
while N != 0:
    amari.append(N%K)
    N = N // K
amari.reverse()
print(len(amari))

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())
r=int(math.log(N,K))
print(r+1)

Submission status: Accepted

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

n, k = map(int, input().split())
k0 = k
r = 1
fl = True
while k <= n:
    k *= k0
    r += 1

print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n, k = map(int,input().split()) 
    ret = 1

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

    print(ret)


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

target = Base_10_to_n(a, b)

ans = list(target)

print(len(target))

Submission status: Accepted

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

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

x10 = N
x2 = Base_10_to_n(x10, K)
print( len(str(x2)) )

Submission status: Accepted

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

Submission status: Accepted

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

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

print(keta)

Submission status: Accepted

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

ans=""
for i in range(100):
    ans+=str(N//(K**(99-i)))
    N%=(K**(99-i))
ans=int(ans)
ans=str(ans)
print(len(ans))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 22 20:52:04 2020

@author: H_Hoshigi
"""

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

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

print(keta)

Submission status: Accepted

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

########関数部分##############
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
############################
 
 
x10 = N
x2 = Base_10_to_n(x10, K)
print( len(x2) )#"100011"が表示される．

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

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

Submission status: Accepted

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

print(i)

Submission status: Accepted

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


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

cnt = 0
while K ** cnt < N + 1:
    cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import math

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

ans=math.floor(math.log(N,K))

print(ans+1)

Submission status: Accepted

Solution code:
def toStr(n,base):
    convertString = "0123456789ABCDEF"
    if n < base:
        return convertString[n]
    else:
        return toStr(n//base,base) + convertString[n%base]

a,b = map(int,input().split())
print(len(toStr(a,b)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(map(int,input().split()))
def sin(X,n):
    a=X
    out=''
    while a>0:
        out=str(a%n)+out
        a=int(a/n)
    return out
b=sin(s[0],s[1])
print(len(b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque

def _ia(): return [int(x) for x in sys.stdin.readline().strip().split()]


n, k = _ia()
c = 0
while n>0:
   m = n%k
   n = (n-m)//k
   c += 1
print(c)

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

keta = 1
for i in range(1,1000):
    if N//K**i > 0:
        keta += 1
        
print(keta)

Submission status: Accepted

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

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

if __name__ == "__main__":
    N, K = tuple(map(int, input().split(" ")))
    print(solve(N, K))

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
b = ""
while n != 0:
    b += str(n%k)
    n //= k
print(len(b))