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

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

Submission status: Accepted

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

Submission status: Accepted

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

x = ""

while n > 0:
    x = str(n % k) + x
    n //= k

print(len(x))

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
m = N

while m!=0:
    if m//K!=0:
        ans += 1
    m //= K
    
print(ans)

Submission status: Accepted

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

for a in range(1,35):
  if n//(k**a) == 0:
    print (a)
    break

Submission status: Accepted

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


def solve(N: int, K: int):
    c = 0
    while True:
        if K ** c > N:
            print(c)
            return
        else:
            c += 1


# 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())
keta = 0
while(N>0):
    keta += 1
    N //= K
print(keta)

Submission status: Accepted

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

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

print(len(solver2(N, K)))

Submission status: Accepted

Solution code:
N, K = input().rstrip().split(' ')
N = int(N)
K = int(K)
n = N
ans = 0
while n != 0:
    n = n//K
    ans += 1
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:
N, K = map(int, input().split())
digit = 1
while N >= K:
  digit += 1
  N //= K
print(digit)

Submission status: Accepted

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

# process
ans = 0
num = N
while num > 0:
    num //= K
    ans += 1

# output
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,2**27):
  if K**(i-1) <= N < K**i:
    print(i)
    break

Submission status: Accepted

Solution code:
# import math
# import bisect
# import heapq
# from collections import deque
# import numpy as np

n, k = map(int, input().split())
count=1
base = k
while n >= k:
    count += 1
    k *= base

print(count)

Submission status: Accepted

Solution code:
def Base_10_to_n(X, K):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%K)+out
        X_dumy = int(X_dumy/K)
    return out
n, k = map(int, input().split())
print(len(Base_10_to_n(n, k)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n,k = map(int, input().split())
    
    ans = 1
    for j in range(100000):
        ans *= k
        if ans > n:
            print(j+1)
            break
        elif ans == n:
            print(j+2)
            break

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
x, ans = k, 1
while x <= n: x *= k; 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 = 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:
# -*- coding: utf-8 -*-

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

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

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=(int (x) for x in input().split())
for i in range(30):
    if((k**i<=n)&(n<k**(i+1))):
        break
print(i+1)

Submission status: Accepted

Solution code:
import math

def resolve():
    N,K = list(map(int, input().split()))
    if N==0:
        print('1')
    else:
        print(int(math.log(N, K))+1)

resolve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,k=list(map(int,input().split()))
def Base_10_to_n(X,n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n),n)+str(X%n)
    return str(X%n)
print(len(Base_10_to_n(n,k)))

Submission status: Accepted

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

print(cnt)

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().strip().split())
ans = 0
while N > 0:
  ans += 1
  N //= k
print(ans)

Submission status: Accepted

Solution code:
import math

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(10**7):
    if k**i > n:
        print(i)
        exit()

Submission status: Accepted

Solution code:
def main():
    N, K = map(int, input().split(' '))
    tmp = 1
    cnt = 1
    while True:
        tmp *= K
        if tmp > N:
            break
        cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

result = 0

r = n
while(True):
    r //=  k
    result += 1
    if r <= 0:
        break
    
    
print(result)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
 
tmp = 1
for i in range(100):
    tmp = k * tmp

    if n < tmp:
        print(i+1)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N, K = [int(_) for _ in input().split()]
    i = 1
    while True:
        N_quotient = N // K
        N = N_quotient
        if N != 0:
            i += 1
        else:
            break
    print(i)
main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def contest(N, R):
    i = 0

    while(N >= R):
        i += 1
        N = N // R
    
    return i+1

if __name__ == "__main__":
    N, R = map(int, input().split())
    print(contest(N,R))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

Solution code:
#coding:utf-8
#!/usr/bin/python

import math

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

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

Submission status: Accepted

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

ans=0
for i in range(30):
  n=N-K**i
  if n<0:
    break
  ans+=1

print(ans)

Submission status: Accepted

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

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

x10 = N
output = int(Base_10_to_n(x10, K))

count = 1



while output>=10:
    count+=1
    output/=10

print(count)

Submission status: Accepted

Solution code:
import sys

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

N, K = 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
for i in range(30):
  n=N-K**i
  if n<0:
    break
  ans+=1

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)
    

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,k = list(map(int,input().split()))
tmp = n
count = 0
f = True
while f:
  tmp = int(tmp / k)
  count += 1
  if tmp == 0:
    f = False
  #print(tmp)
print(count)

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

Submission status: Accepted

Solution code:
MAX_N = pow(10, 9)
n, k = map(int, input().split())

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

Submission status: Accepted

Solution code:
from sys import stdin
n,k=map(int,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())
count = 0
while N >=1:
  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 = ans + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
# -*- coding: utf-8 -*-
n,k = list(map(int,input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
def ans(n, k):
    if (int(n/k)):
        return ans(int(n/k), k)+str(n % k)
    return str(n % k)


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

a=list[0]
b=list[1]
c=0
while a>0:
	a=a//b
	c=c+1
print(c)

Submission status: Accepted

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

while N > 0:
    a.append(N % K)
    N = N // K

print(len(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import math

n, k = [int(x) for x in stdin.readline().rstrip().split()]

cnt = 1
if n < k:
    print(cnt)

else:
    kk = k
    while n >= kk:
        kk = kk * k
        cnt += 1
    print(cnt)

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,r=map(int,input().split())
count=0
while n>0:
    n//=r
    count+=1
print(count)

Submission status: Accepted

Solution code:
def ten_to_n(X, n):
    i = X // n
    s = str(X % n)
    if (i):
        return ten_to_n(i, n) + s
    return s

def solve():
    N, M = map(int, input().split())
    return len(str(ten_to_n(N, M)))

print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
for i in range(1, 100)[::-1]:
    if N // (K ** i) != 0:
        print(i + 1)
        break
else:
    print(1)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
z = 1
a = 0
while x >= z:
  z = z * y
  a = a + 1
  if x < z:
  	print(a)
  	break

Submission status: Accepted

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


########関数部分##############
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
############################
 
 
#####関数をつかってみる．#####
######今回は二進数に変換######
ans = Base_10_to_n(n, k)
print( len(ans) )

Submission status: Accepted

Solution code:
import string
digs = string.digits + string.ascii_letters
def int2base(x, base):
    if x < 0:
        sign = -1
    elif x == 0:
        return digs[0]
    else:
        sign = 1
    x *= sign
    digits = []
    while x:
        digits.append(digs[int(x % base)])
        x = int(x / base)
    if sign < 0:
        digits.append('-')
    digits.reverse()
    return ''.join(digits)

n,m=map(int,input().split())
xx=int2base(n,m)
# print(xx)
print(len(xx))

Submission status: Accepted

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

keta = 0
for i in range(10**10):
    ki = k**i
    if ki > n:
        print(keta)
        break
    else:
        keta += 1

Submission status: Accepted

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

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

Submission status: Accepted

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

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

ans = len(base_N(N, K))
print(ans)

Submission status: Accepted

Solution code:
import math
n,k = map(int,input().split())
if n == 1:
  ans = 1
else:
  ans = math.ceil(math.log(n,k))
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:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


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

    print(ans+1)
    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 math
inp = input().split()
N = int(inp[0])
K = int(inp[1])
S = 0
while N > 0:
	N = math.floor(N / K)
	S += 1

print(S)

Submission status: Accepted

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

def to_baseK(decimal, K):
    result = ""
    while decimal:
        surplus = decimal % K
        result = str(surplus) + result
        decimal //= K
    return result

print(len(to_baseK(N, K)))

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n,k = LI()
    if n == 0:
        return 1
    r = 0
    while n > 0:
        r += 1
        n //= k

    return r


print(main())

Submission status: Accepted

Solution code:
import numpy as np

i = list(map(int, input().split()))
N = i[0]
K = i[1]

N_ = np.base_repr(N, K)

print(len(str(N_)))

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a=n
seq=""
while a>=k:
    a=a//k
    b=a%k
    seq=seq+str(b)
seq=seq+str(a)
print(len(seq))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

ii = 0
while True:
    if n < pow(k,ii):
        print(ii)
        sys.exit()

    ii = ii + 1

Submission status: Accepted

Solution code:
import math
number,base=input().split()
num=int(number)
bas=int(base)
converted=0
reminder=0
i=0
#counter=0
while num!=0:
    reminder=num%bas
    num=num//bas
    converted=converted+reminder*10**i
    i+=1

#print(converted)
#To convert integer into string
y=str(converted)
print(len(y))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a = n
c = 0
while True:
    a = a // k
    c += 1
    if a == 0:
        print(c)
        exit()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, N = 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

 
aws = Base_10_to_n(X,N)
a = len(aws)
print(a)

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())
ans = 0
tmpN = N
while tmpN != 0:
    tmpN //= R
    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:
import math

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

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
for i in range(10**9):
    if N == 0:
        break
    N = N//K
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
count = 0       #初期値を0とするcount変数を作る.
n,k = map(int,input().split())      #整数とn進数を入力する。

while n > 0:         #nをkで割った商が0になるまでcountに1を足し続ける。
    count += 1
    n //= k

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def solve(inp):
    (N, K) = map(int, inp.readline().strip().split(' '))

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

    return str(i)


def main():
    import sys
    result = solve(sys.stdin)
    if result is not None and result != '':
        print(result)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

while True:
  count = count + 1
  n, amari = divmod(n, k)
  if  n == 0:
    break

print(count)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
for i in range(100):
  if N >= K**(i):
    ans = i+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

def Base(x,n):
    if (int(x/n)):
        return Base(int(x/n),n) + str(x % n)
    return str(x % n)
    
print(len(Base(N,K)))

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
ans = []
while N > 0:
    M = N % K
    ans.append(M)
    N = N // K
print(len(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 = [int(x) for x in input().split()]
count = 1
a = k
while n//k > 0:
    k *= a
    count += 1
print(count)

Submission status: Accepted

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

maxDigits = 0

for i in range(1000):
  if N/K**i >= 1:
    maxDigits = i+1
  else:
    break;

print(maxDigits)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

 
print(result)

Submission status: Accepted

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

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

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

flag = True
keta=0

while flag:
	keta += 1
	if k**keta > n:
		flag = False

print(keta)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
import math

n,k = [int(x) for x in input().split()]
ans = math.ceil(np.log(n)/np.log(k))
if n == 1:
  ans =1

print(ans)

Submission status: Accepted

Solution code:
def base10to(n, k):
  if (int(n/k)):
    return base10to(int(n/k), k) + str(n%k)
  return str(n%k)

n, k = map(int, input().split())
print(len(base10to(n, k)))

Submission status: Accepted

Solution code:
import math
def main():
    N,K = map(int,input().split())
    count = 0
    while N != 0:
        N = math.floor(N / K)
        count = count + 1

    print(count)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
l =[]
while a/b >=1:
  l.insert(0,a%b)
  a /=b
  
if a >=1 and a<b:
  l.insert(0,a)
print(len(l))

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())
k = K
a = 1
while N + 1 > k:
    k = K * k
    a += 1
print(a)

Submission status: Accepted

Solution code:
tmp = list(input().split(" "))

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

count = 0

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

print(count)

Submission status: Accepted

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

a = list(map(int, input().split()))
print(len(base10to(a[0], a[1])))

Submission status: Accepted

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

count = 1

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

print(count-1)

Submission status: Accepted

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

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())
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:
if __name__ == "__main__":
    n,k = (int(x) for x in 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()))
ans=0
while(N!=0):
  N//=K
  ans+=1
print(ans)

Submission status: Accepted

Solution code:
def base10to(n, r):
    ans = 0
    while n > 0:
        n //= r
        ans += 1
    return ans

N,R = map(int,input().split())
print(base10to(N, R))

Submission status: Accepted

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


N,R = map(int,input().split())
res = base10to(N, R)
print(len(res))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i = list(map(int, input().split()))
count = 0
while True:
    i[0] = int(i[0] / i[1])
    count += 1
    if i[0] == 0:
       break;

print(count)

Submission status: Accepted

Solution code:
N,K= map(int,input().split())
d = 100
while 1:
    if N >= K**d:
        print(d+1)
        exit()
    d -= 1

Submission status: Accepted

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

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

Submission status: Accepted

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