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:
#--Digits

N, K = map(int, input().split(" "))
i = 0

while (N > 0):
  i = i + 1
  q, mod = divmod(N, K)
  N = q

print(i)

Submission status: Accepted

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

i = 0
while N != 0:
  i += 1
  N = N // K

print(i)

Submission status: Accepted

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

N = a[0]
K = a[1]
count = 1
while 1:
    if N <= (K**count-1):
        print(count)
        break
    count += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

num = []
while not N < K:
  num.append(N % K)
  N = N // K
num.append(N)

print(len(num))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
# int(input()) # 入力が1つ
n, k = map(int, input().split()) # 入力が複数
# [int(i) for i in input().split()] # 配列で数字

ans = 0

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

Submission status: Accepted

Solution code:
#ABC156 - Virtual
sel='B'
#B
if sel=='B':
    N,K=map(int,input().split())
    cnt=0
    while N>0:
        N//=K
        cnt+=1
    print(cnt)

#C
if sel=='C':
    def ceilT(a,b): #ceil(a/b)
        return (a+b-1)//b

    N=int(input())
    X=[int(i) for i in input().split()]
    p=ceilT(sum(X),N)
    ans=sum((x-p)**2 for x in X)
    p-=1
    ans=min(ans,sum((x-p)**2 for x in X))
    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 = map(int,input().split())
for i in range(35):
  if K**(i) <= N and N < K**(i+1):
    print(i+1)
    exit()

Submission status: Accepted

Solution code:
inputted = list(map(int, input().split()))
N = inputted[0]
K = inputted[1]

digits = 0
temp = N
while True:
    digits += 1
    temp = int(temp / K)
    if temp == 0: break

print(digits)

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

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

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

res = 1

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = (int(i) for i in input().split());
 
res = 0;
 
while a > 0:
    res += 1;
    a //= b;
 
print(res);

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:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
N,K=map(int,input().split())
x=[]
while True:
    if N>=K:
        x.append(N%K)
        N=int(N/K)
    else:
        x.append(N)
        break
x.reverse()
print(len(x))

Submission status: Accepted

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

from math import log, ceil, floor

def solve(dec, base):
    count = 0
    exp = floor(log(dec, base))
    return exp + 1


#def solve(n, base):
    #return len() - 2

print(solve(N, BASE))

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
A=[]
while N >= K:
    r = N % K
    A.append(r)
    N = N // K
if N != 0:
    print(len(A)+1)
else:
    print(len(A))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if n==1:
  print(1)
  exit()
  
print(int(math.ceil(math.log(n,k))))

Submission status: Accepted

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


import sys

# 再起回数上限変更
sys.setrecursionlimit(1000000)

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


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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, 1000000000):
    n = n // k
    if n == 0:
        print(i)
        break

Submission status: Accepted

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


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


print(len(base_10_to(N, K)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n,k=n1()

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

Submission status: Accepted

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

s=0
count=0
while N>=1:
	s+=(N%K)*(10**count)
	N=N//K
	count+=1

print(len(str(s)))

Submission status: Accepted

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

# use log
c=math.log(N,K)

if c == round(c):
	print(int(c)+1)
else:
	print(int(c//1+1))

Submission status: Accepted

Solution code:
N,D=[int(s) for s in input().split()]
d=1
n=D
while n<=N:
  d+=1
  n*=D
print(d)

Submission status: Accepted

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

cnt = 1
i = 0
while True:
    if r**i > n:
        if i != 0:
            cnt -= 1
        break
    else:
        cnt += 1
        i += 1

print(cnt)

Submission status: Accepted

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

i=0

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

result=""
while i>=0:
  result=result+str(n//k**i)
  n=n-(n//k**i)*k**i
  i=i-1

  
  
print(len(str(int(result))))

Submission status: Accepted

Solution code:
import math

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

count = 0
val = math.floor(N/K)
while val > 0:
    val=math.floor(val/K)
    count += 1

print(count+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inp=list(map(int,input().strip().split()))[:2]
n,r=inp[0],inp[1]
count=0
while(n > 0):
    n=n//r
    count+=1
print(count)

Submission status: Accepted

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

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 = (int(i) for i in input().split());

res = 0;

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

print(res);

Submission status: Accepted

Solution code:
base = input().split()
n = int(base[0])
k = int(base[1])
ans = []
lenx = 1
while k**lenx<=n:
    ans.append(1)
    lenx += 1
print(len(ans)+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())
cnt = 0
while n > 0:
    n = int(n/k)
    cnt += 1
print(cnt)

Submission status: Accepted

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

aa = []
while N > 0:
    # print(N)
    # print("a", N % K)
    aa.append(N % K)
    N = N // K

aa = list(reversed(aa))
# print(aa)
print(len(aa))

Submission status: Accepted

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

ans = 1

while True:
    if n < k:
        break
    else:
        n = n // k
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p,q= input().split()
a,b =(int(p), int(q))
ans= 0
for i in range(a + 1):
    rank = a / (b ** i)
    if  rank < 1:
        print(i)
        break

Submission status: Accepted

Solution code:
def convert(N, K):
  if N // K:
    return convert(N//K, K) + str(N % K)
  else:
    return str(N % K)

print(len(convert(*list(map(int, input().split())))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
  
def main():
  n,k = map(int,input().split())
  cnt = 1
  while n//k != 0:
    cnt += 1
    n //= k
  print(cnt)
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
import sys
import math

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

tmp = 1
times = 0
while n > tmp-1:
    tmp *= k
    times += 1

print(times)

Submission status: Accepted

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

d = 1

while True:
  if n >= k ** d:
    d += 1
  else:
    print(d)
    exit()

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

order=0
digit=0

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

Submission status: Accepted

Solution code:
#template
from collections import Counter
def inputlist(): return [int(j) for j in input().split()]
#template
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)
N,K = inputlist()
print(len(base10to(N,K)))

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
f = 0
for i in range(31,-1,-1):
    p,q = divmod(n,k**i)
    if p!= 0:
        break
    n = q
print(i+1)

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:
N,K = list(map(int,input().split()))
n=0
while 1==1:
    n += 1
    if K**(n-1) <= N < K**n:
        break
print(n)

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 = list(map(int,input().split()))
n=0
while 1==1:
    n += 1
    if K**(n-1) <= N < K**n:
        break
print(n)

Submission status: Accepted

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

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

a = 0
while pow(K, a) <= N :
  a += 1
  
print(a)

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:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time
# import numpy as np
from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


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 = inp_list()
n_base_k = base_10_to_n(N, K)
print(len(n_base_k))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def digit(n, k, d):
    if n // (k ** d) > 0:
        d += 1
        return digit(n, k, d)
    else:
        return d
      
print(digit(n, k, 1))

Submission status: Accepted

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

i = 1
j = k

while n >= j:
    i += 1
    j *= k

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

while(n is not 0):
    n = int(n / k)
    cnt = cnt + 1

print(cnt)

Submission status: Accepted

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

	c = 0
	ans = 0

	while(c < N):
		c = (c+1) * K - 1
		ans += 1

	print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

a = Base_10_to_n(n, k)

print(len(a))

"""
#####関数をつかってみる．#####
######今回は二進数に変換######
x10 = 35
x2 = Base_10_to_n(x10, 2)
print( x2 )#"100011"が表示される．
#
#http://www.pursue.ne.jp/jouhousyo/sysad/sysad010.htm
#
"""

Submission status: Accepted

Solution code:
import numpy as np
n , k = map(int,input().strip().split())
n = np.base_repr(n, base=k)
print(len(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def change_base(n, k):
    if int(n/k):
        return change_base(int(n/k), k)+str(n%k)
    return str(n%k)

print(len(change_base(n, k)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = n
judge = True
cnt = 0
while True:
    if x < k:
        break
    x = x // k
    cnt += 1
cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, 100):
    if N >= K ** (i - 1) and N < K ** i:
        print(i)
        break

Submission status: Accepted

Solution code:
n, k = [int(i) for i in 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())
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 > 0:
    N //= K
    ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

i = 0
while n >= pow(k, i):
    i += 1

print(i)

Submission status: Accepted

Solution code:
import math

n, k = map(int, input().split())
if n == 1:
  print(1)
else:
  x = int( math.ceil( math.log( n , k )))
  print(x)

Submission status: Accepted

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

ans = 0
flag = True
while flag:
    if N // (K**ans) < 1:
        flag = False
    else:
        ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(100):
  if n < pow(k, i):
    print(i)
    break

Submission status: Accepted

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

    for i in range(100):
        if k ** i <= n:
            continue
        else:
            print(i)
            return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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


print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:

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

def check_digits(n, k):
    if k == 10:
        return len(str(n))
    
    count = 0
    while n > 0:
        n //= k
        # print(n)
        count += 1
    return count

print(check_digits(N, K))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

i = 0
while K ** i <= N:
    ans = i + 1
    i += 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())
digits = []
while N > 0:
    digits.append(N % K)
    N = N // K

print(len(digits))

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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)
  
x = Base_10_to_n(a, b)

print(len(x))

Submission status: Accepted

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

print(s)

Submission status: Accepted

Solution code:
N,K=[int(s) for s in 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())

ketasuu = 1

while N >= K:
    N = math.floor(N / K)
    ketasuu += 1

print(ketasuu)

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

print(count)

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

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

c=0

while(1):
  n=int(n/k)
  c+=1
  if n==0:
    break

print(c)

Submission status: Accepted

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

list = []

if N==1:
    print(1)
else:
    for i in range(100000000):
        list.append(N % K)
        N = N / K
        i = i + 1
        if N < K:
            print(i + 1)
            break

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
# problem B
N, K = input().split()
n = int(N)
k = int(K)

ans = 0

for i in range(0,31):
    x = k**i
    if n < x:
        print(ans)
        break
    else:
        ans += 1

Submission status: Accepted

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

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:

# xをn進数に変換
def To_Base_number(x, n):
    ret = []
    while x > 0:
        ret.insert(0, x % n)
        x = x // n
    return ''.join(map(str, ret))


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

Submission status: Accepted

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

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

print(count)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/B-Digits.py
#
# 1<= n <= 10**9
# 2<= k <= 10
#

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

digits = int(1)

for digit in range(1, 30):  # 2**29 < 10**9 < 2**<30 なので最高でも30桁
    if k ** digit <= n:
        digits = digits + 1
    else:
        break

print(digits)

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())
c=1

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

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def f(n, k):
    if n//k:
        return f(n//k, k) + str(n%k)
    return str(n%k)

print(len(f(N, K)))

Submission status: Accepted

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

Submission status: Accepted

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

n_s = n + 1

cnt = 1

while True:
    if n < k**cnt:
        print(cnt)
        exit()
    else:
        cnt += 1

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

i = 1

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

    i += 1

print(i)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string
d = string.digits + string.ascii_letters


def con(x, base):
    if x < 0:
        sign = -1
    elif x == 0:
        return d[0]
    else:
        sign = 1
    x *= sign
    digits = []

    while x:
        digits.append(d[int(x % base)])
        x = int(x / base)

    if sign < 0:
        digits.append('-')
    digits.reverse()

    return ''.join(digits)
n,k = map(int,input().strip().split())
v = con(n,k)
print(len(v))

Submission status: Accepted

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

print(cnt)