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 = N // K
    cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
x, n = map(int, input().split())
digit = []
while(True):
    if x < n:
        digit.append(str(x))
        break
    d, m = divmod(x, n)
    digit.append(str(m))
    x = d
print(len(digit))

Submission status: Accepted

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

Submission status: Accepted

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


for i in range(1,N):
    if N > K**i:
        continue
    elif N == K**i:
        print(i+1)
        exit()
    else:
        print(i)
        exit()
print(1)

Submission status: Accepted

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

n = 1
while N // K >=1:
    n += 1
    N = N//K
print(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(str(Base_10_to_n(n,k))))

Submission status: Accepted

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

Submission status: Accepted

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

ans = []

while n > 0:
  n = n // k
  ans.append(1)
  
print(sum(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 = (int(x) for x in input().split())

D = 0

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

print(D)

Submission status: Accepted

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

while True:
  if a//b!=0:
    c+=1
    b=d**c
  else:
    break
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
# coding: utf-8
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 = 0
while N:
  ans += 1
  N //= K

print( ans )

Submission status: Accepted

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

ans = 0
n = N
while n:
    ans += 1
    n //= K

print(ans)

Submission status: Accepted

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

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

ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

n, k = map(int, input().split())
lint = math.ceil(math.log(n, k))
l = math.log(n, k)
print(lint if lint != l else int(l) + 1)

Submission status: Accepted

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

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

print(counter)

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

print (ans)

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:
def f(N,K):
    if N<K:
        return 1
    return f(N//K,K)+1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

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())
i = 0

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(10**9):
    if n < k**i:
        print(i)
        exit(0)
    else:
        pass

Submission status: Accepted

Solution code:
x = 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)
y = Base_10_to_n(x[0], x[1])
print(len(str(y)))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

cnt = 0
tmp = n
while tmp != 0:
    tmp //= k
    cnt += 1

print(cnt)

Submission status: Accepted

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

def base_y(x, y):
    if int(x/y) > 0:
        return base_y(int(x/y), y) + str(x%y)
    return str(x%y)
         
print(len(base_y(n, k)))

Submission status: Accepted

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

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


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

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc156/tasks/abc156_b
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 = 1
while N >= K:
    N = N // K
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

judge = False
i = 0
while judge == False:
  if K**i <= N and N < K**(i+1):
    judge == True
    print(i+1)
    exit()
  else:
    i+=1

Submission status: Accepted

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

Submission status: Accepted

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

i = 0
x = 1
while n >= x:
    x *= k
    i += 1

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,K=map(int,input().split())
li=[]
A=True
while A==True:
    S=N%K
    N=(N-S)//K
    if N==0:
        break
    li.append(S)
li.append(S)
li=li[::-1]

print(len(li))

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

Submission status: Accepted

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

Submission status: Accepted

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

main()

Submission status: Accepted

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

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:
#! env/bin/local python3

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

counter = 0
while True:
    n = n // k 

    counter += 1
    if n == 0:
        print(counter)
        break

Submission status: Accepted

Solution code:
import sys

def ISI(): return map(int, sys.stdin.readline().rstrip().split())

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

Submission status: Accepted

Solution code:
def resolve():
    n,k=map(int,input().split())
    order=1
    while not(k**(order-1)<= n < k**(order)):
        order+=1
    print(order)
resolve()

Submission status: Accepted

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

count = 0
while n != 0:
    # print(n)
    div, mod = divmod(n, k)
    # print(mod)
    n = div
    
    count += 1
    
print(count)

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:
N, K = map(int, input().split())
a = []
while N != 0:
  div = divmod(N, K)
  N = div[0]
  a.append(div[1])

print(len(a))

Submission status: Accepted

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

while True:
    if k ** zzz > n:
        maxkun = zzz
        break
    zzz += 1

print(maxkun)

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
for i in range(10000):
	if N//(K**i) >= K:
	  	continue
	else:
  		print(i+1)
  		exit(0)

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:
#!/usr/bin/env python3
n, k = map(int, input().split())
ans = 0
while n > 0:
    ans += 1
    n //= k
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

amari = []

while n != 0:
    amari.append(n%k)
    n = n // k

print(len(amari))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N,K = map(int,input().split())
Ans = (int(math.log(N,K)) +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:
N, K = map(int, input().split())
digit = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
from bisect import bisect_left
from itertools import product
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
#文字列を一文字ずつ数字に変換、'5678'を[5,6,7,8]とできる
def LSI(): return list(map(int, list(sys.stdin.readline().rstrip())))
def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
#文字列として取得
def ST(): return sys.stdin.readline().rstrip()
def LST(): return sys.stdin.readline().rstrip().split()
def LST2(N): return [sys.stdin.readline().rstrip().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**6+10)

N, K = MI()
ans = 0

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

Submission status: Accepted

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

ans = 0
for i in range(31):
    if k ** i > n:
        ans = i
        break
if ans == 0:
    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())
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
count = 0
while N >= 1:
    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 = 0
#while n>0:
#    n = n// k
#    ans += 1
#print(ans)
i = 1
now = k
while True:
    if n < now:
        print(i)
        break
    i += 1
    now *= k

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

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

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:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

import math

n,k=nm()

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

Submission status: Accepted

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

Submission status: Accepted

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


res = 0

while (K**res <= N):
    res += 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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:
import sys
import math
from collections import deque
from collections import defaultdict

def main():
    n,k = list(map(int,sys.stdin.readline().split()))
    ans = 1
    while(n>=k):
        n=n//k
        ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n, k = map(int, input().split())
    ans = []
    while n > 0:
        ans.insert(0, n % k)
        n = n // k
    print(len(ans))


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

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

def div(a,b):
    cnt = 0
    k = b
    while(True):
        if(a<k):
            break
        k *= b
        cnt += 1
    return cnt

ans = div(n,k) + 1
print(ans)

Submission status: Accepted

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

count = 0

while True:
    temp = K**count
    if temp > N:
        break
    count += 1

print(count)

Submission status: Accepted

Solution code:
def digit(n, k):
    buff = n
    x = ''
    while buff > 0:
        x = str(buff % k) + x
        buff = int(buff / k)
    return x


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

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

Submission status: Accepted

Solution code:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n,k=map(int,stdin.readline().split())
curr=1
ans=0
while(curr<=n):
    curr*=k
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

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

# code here
N, K = na()
d = 0

while 0 < N:
    N //= K
    d += 1

print(d)

Submission status: Accepted

Solution code:
# ABC156B

import math
def f(n, k):
    a = math.log(n, k)
    print(math.floor(a)+1)

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

Submission status: Accepted

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

q, mod = divmod(N, K)
count = 1

while q > 0:
    q, mod = divmod(q, K)
    count += 1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
q=1
while n>=k:
    [quo,rem]=divmod(n,k)
    n=quo
    q+=1
    
print(q)

Submission status: Accepted

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools
import heapq

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)

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


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

    N, K = il()
    print(math.floor(math.log(N, K))+1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

a=0

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

Submission status: Accepted

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

print(i-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B
import math
n, k = map(int, input().split())
i=0
while True:
    tmp=k**i
    if tmp > n:
        break
    i += 1
print(i)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(10**10):
  if n <= k**(i+1) -1:
    print(i+1)
    exit()

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

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
n,k = map(int, raw_input().split(' '))
def f(n,k):
	count = 0
	while(n):
		n /= k
		count +=1
	return count
print f(n,k)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


n, k = inpl()
tmp = math.log(n) / math.log(k) + 1
print(int(tmp))

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

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)

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

print(c)

Submission status: Accepted

Solution code:
import sys
import math
import bisect


def main():
    n, m = map(int, input().split())
    A = []
    while n:
        A.append(n % m)
        n //= m
    if len(A) == 0:
        A.append(0)
    print(len(A))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math 

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

Submission status: Accepted

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

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

Submission status: Accepted

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

    res = 1
    x = 1
    for i in range(100):
        if n < x:
            res = i
            break
        else:
            x *= k

    print(res)



main()

Submission status: Accepted

Solution code:
import math
import queue
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=qb
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
def dq():
	return queue.deque()
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1

n,k = readInts()

i = 1
while 1:
	if n<k:
		break
	n = n//k
	i+=1

print(i)

Submission status: Accepted

Solution code:

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

r = 10
c = 0
while r != 0:
    r = n//k
    n = n/k
    c+=1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = list(map(int, input().split()))
i = 0
j = 0
for i in range(1000):
    j = K ** i
    if j > N:
        print(i)
        break

Submission status: Accepted

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

list = []

for i in range(num, -1, -1):
    n = str(N_//(K**i))
    N_ = N_ % (K**i)
    # print(N_, n)
    list.append(n)


while list[0] == "0":
    list.remove("0")

print(len(list))

Submission status: Accepted

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

Submission status: Accepted

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

a = n//k
b = n%k

ans = 1
if a==0:
    ans = ans
elif a > 0:
    while  a > 0 :
        a = a//k
        b = a%k
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
s=[]
while n>=m:
    n=n//m
    s.append(n%m)
print(len(s)+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A=[]
while N:
    A.append(N%K)
    N//=K
print(len(A))

Submission status: Accepted

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

ans = 0

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

print(ans+1)

Submission status: Accepted

Solution code:
import math

def main():
    strA = input()
    listA = strA.split(" ")

    N = int(listA[0])
    K = int(listA[1])

    x = N
    y = 0
    while(1):
        x = math.floor(x/K)

        y = y + 1
        if(x < K):
            if (x != 0):
                y = y + 1
            break

    print(y)

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

Submission status: Accepted

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

cnt = 0
while N >= K:
    N, _ = divmod(N, K)
    cnt += 1
print(cnt + 1)

Submission status: Accepted

Solution code:
import sys
a,b=map(int,input().split())
i=0
while True:
  if b**i>a:
    print(i)
    sys.exit()
  i+=1