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 = int(input())
n,k = map(int,input().split())
#a_L = list(map(int,input().split()))

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

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

Submission status: Accepted

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

	if N == 0:
		break

print(ans)

Submission status: Accepted

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

def Base10toN(x, n):
    if x//n > 0:
        return Base10toN(x//n, n) + str(x%n)
    return str(x%n)

N = Base10toN(N, K)
print(len(N))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N, K = [int(i) for i in input().split()]
c = 0
while N > 0:
  c += 1
  N = N //K
print(c)

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 nsinho(x, N):
    ans = ''
    while x > 0:
        ans = ans+str(x%N)
        x = x//N
    return int(ans[::-1])

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

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

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

Submission status: Accepted

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

res=0
while n:
    n//=k
    res+=1

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
a = []
while 1:
    a.append(str(N%K))
    N//=K
    if N==0:break
print(len(a))

Submission status: Accepted

Solution code:
from math import log, ceil


N, K = [int(i) for i in input().split()]
print(max(1, ceil(log(N, K))))

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
x=1
while True:
    cnt=k**x
    if cnt>n:
        print(x)
        exit()
    x+=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 sys
import math
import itertools
from collections import deque
import copy
import bisect

MOD = 10 ** 9 + 7
INF = 10 ** 18 + 7
input = lambda: sys.stdin.readline().strip()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

while N >= Atai:
  Atai = Atai * K
  Ans = Ans + 1

print(Ans)

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
ans = 1
for _ in range(40):
    N = N // K
    if N == 0:
        break
    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:
n,k = map(int,input().split())

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

Submission status: Accepted

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

 

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



if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq
import sys
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N,K = IL()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def nbase(value,n):
    nbasevalue = 0
    digit = 0
    while value > 0:
        nbasevalue += (value%n)*(10**digit)
        value //= n
        digit += 1
    return nbasevalue

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

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

Submission status: Accepted

Solution code:
def main():

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

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)

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:
    count += 1
    n //= k
if k == 0:
    print(1)
else:
    print(count)

Submission status: Accepted

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

while True:
    if N <= K ** ans -1:
        break
    else:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
NN = 2020202
MOD = 10**9+7
INF = float("inf")

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

print(count)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]

    ans = 1
    a = K
    while N >= a:
        a *= K
        ans += 1

    print(ans)


if __name__ == '__main__':
    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 = int(n/k)
    count +=1
print(count)

Submission status: Accepted

Solution code:
import string

N,K = list(map(int,input().split()))
numbers = "0123456789"
alphabets = string.ascii_letters
characters = numbers + alphabets

def base_cvt(value, n=2):
    tmp = int(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:
N,K=map(int,input().split())
i=1
while K**i<=N:
  i+=1
print(i)

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

Submission status: Accepted

Solution code:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(input()) #整数読み込み
def ifn(): return float(input()) #浮動小数点読み込み
def isn(): return input().split() #文字列読み込み
def imn(): return map(int, input().split()) #整数map取得
def fmn(): return map(float, input().split()) #浮動小数点map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, input().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD

N,K = imn()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
ans=0
while 0<n:
    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):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X % n)
    return str(X % n)


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

Submission status: Accepted

Solution code:

#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    n,k = mi()
    cnt = 0
    while n:
        n//=k
        cnt+=1
    print(cnt)



main()

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 Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out


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

x = Base_10_to_n(N, K)

print(len(str(x)))

Submission status: Accepted

Solution code:
N,K = [int(i) for i in input().split()]
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)
k = base10to(N,K)
print(len(k))

Submission status: Accepted

Solution code:
import math 
  
# function to print number of 
# digits 
def findNumberOfDigits(n, base): 
      
    # Calculating log using base 
    # changing property and then 
    # taking it floor and then  
    # adding 1. 
    dig = (math.floor(math.log(n) /
                 math.log(base)) + 1) 
      
    # printing output 
    return dig

a, b = [int(i) for i in input().split()]

print(findNumberOfDigits(a,b))

Submission status: Accepted

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

N, K = map(int, readline().split())
res = 1
while N >= K:
    N //= K
    res += 1
print(res)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
# coding: utf-8
N,K=map(int,input().split())

ans=0

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

print(ans)

Submission status: Accepted

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

if N == 0:
	S = "0"
else:
	S = ""
	while N > 0:
		S = str(N % K) + S
		N = N // K

print(len(S))

Submission status: Accepted

Solution code:
import math
[n,k] = [int(i) for i in input().split()]
if k ** math.log(n,k) == n:
    print(math.ceil(math.log(n,k)) +1)
else:
    print(math.ceil(math.log(n,k)))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

def dec_to_n(N, n):
    if N == 0:
        return "0"
    digits = []
    base = 1
    while N != 0:
        if N % (base * n) == 0:
            digits.append('0')
        else:
            digits.append(str(N % (base * n) // base))
            N -= N % (base * n)
        base *= n
    return "".join(digits[::-1])

n = dec_to_n(N, K)
print(len(n))

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:
import sys
N,K = map(int,input().split())

now = 1
ind = 0

while True:
    now *= K
    ind += 1

    if now > N:
        print (ind)
        sys.exit()

Submission status: Accepted

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

Submission status: Accepted

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


def func(n, k):
    cnt = 0
    while n > 0:
        n = n // k
        cnt += 1
    return cnt


print(func(N, K))

Submission status: Accepted

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

Submission status: Accepted

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

k = 0
p = 1
while True:
    if N < p:
        break
    k += 1
    p *= K

print(k)

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:
a,b = map(int,input().split())
x = ""
while a > 0:
  x += str(a%b)
  a = a//b
  
print(len(x))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(digit)

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 = ""
while (N):
    ans += str(N % K)
    N //= K
print(len(ans))

Submission status: Accepted

Solution code:
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n,k  = i2()
def B(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(B(n,k)))

Submission status: Accepted

Solution code:

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29

DIV = (10**9) + 7

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)

def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max,mod=DIV):
    fac,finv,inv = [0]*max, [0]*max, [0]*max
    fac[0]=fac[1]=1
    finv[0]=finv[1]=1
    inv[1]=1
    for i in range(2,max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod -inv[mod%i] * (mod//i)%mod
        finv[i] = finv[i-1]*inv[i]%mod
    class CONV:
        def __init__(self):
            pass
        def ncr(self,n,k):
            if(n<k):
                return 0
            if(n<0 or k<0 ):
                return 0
            return fac[n]*(finv[k]*finv[n-k]%mod)%mod
    return CONV()


def main():
    N,K = isRaw()
    ans = 1
    while N !=0:
        N = N//K
        if N==0:
            return ans
        ans+=1
    return ans
    


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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

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

x=0

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

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 = map(int, input().split())
from math import log, ceil
print(ceil(log(n, k)) if not n==1 else 1)

Submission status: Accepted

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

count = 0

while a != 0:
    a = a // b
    count += 1

print(count)

Submission status: Accepted

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

def intput():
	return int(input().rstrip())

def sinput():
	return input().rstrip().split()

def intsput():
	return map(int, sinput())

def main():
	n, k = intsput()
	for i in range(1,100):
		if k**i>n:
			print(i)
			return

if __name__ == '__main__':
	main()

Submission status: Accepted

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


def solve(N: int, K: int):
    answer = 1
    while True:
        if K**(answer-1) <= N < K**answer:
            break
        answer += 1
    print(answer)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
count = 0
a, b = MAP()
while 1:

    a = a // b
    count += 1
    if a == 0:
        print(count)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
ans = []
while N > 0:
    ans.append(N%K)
    N = N // K 
print(len(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
print(len(str(Base_10_to_n(n,k))))

Submission status: Accepted

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

print(keta)

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:
a, b = map(int, input().split())
c = 0

while a > 0:
    c += 1
    a //= b

print(c)

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

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 sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""


n,k = m()

co = 0

while n:
    co += 1
    n //= k

print(co)

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

n, k = na()

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def shinsu(n,k):#nをk進数で
    if n==0:
        return 0
    bi=''
    while n!=0:
        r=n%abs(k)
        n=(n-r)//k
        bi+=str(r)
    return (bi[::-1])
n,k=map(int,input().split())
s=shinsu(n,k)
print(len(s))

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

x2 = Base_10_to_n(n, k)

cnt=str(x2)
print(len(cnt))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def DecimalNumber(n, k):  # nをk進法にする
    bi = ''
    while n != 0:
        bi += str(n % abs(k))
        if k < 0:
            n = -(-n // k)
        else:
            n = n // k
    return bi[::-1]


def resolve():
    n, k = map(int, input().split())
    print(len(DecimalNumber(n, k)))


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import sys
import math
n, k = [int(i) for i in sys.stdin.readline().split()]
print(math.floor(math.log(n, k)) + 1)

Submission status: Accepted

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

ans = 1
num = 1
while(1):
    num *= K
    if num > N:
        break
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N, K = map(int,input().split())
ans = 1
while N >= K:
    ans += 1
    N //= K
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 change(n,k):
    res=[]
    m=n
    while(m>0):
        res.append(m%k)
        m=m//k
    return res
print(len(change(N,K)))

Submission status: Accepted

Solution code:
def main():
    N, K = map( int, input().split())
    for i in range(1,100):
        if N//pow(K,i) == 0:
            print(i)
            break
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#s = input()
#n = int(input())
n,k = map(int,input().split())
#lst1 = list(map(int,input().split()))
ans = 0
while True:
    if n//k >= 1:
        n//=k
        ans += 1
    else:
        ans += 1
        break
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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,k=map(int,input().split())
while pro <= n:
  pro *= k
  count += 1
print(count)

Submission status: Accepted

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

for i in range(100):
    if base ** i <= n < base ** (i+1):
        print(i+1)
        exit()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import deque, Counter
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math
INF = 10 ** 20

def main():
    a, b = getList()
    ans = 1
    while(a >= 1):
        ans += 1
        a = a/b

    print(ans - 1)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

print(ans)