Problem:


Score : 200 points

Problem Statement

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

Notes

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

Constraints

All values in input are integers.

1 \leq N \leq 10^9

2 \leq K \leq 10

Input

Input is given from Standard Input in the following format:

N K

Output

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

Sample Input 1

11 2

Sample Output 1

4

In binary, 11 is represented as 1011.

Sample Input 2

1010101 10

Sample Output 2

7

Sample Input 3

314159265 3

Sample Output 3

18



Sample input:
11 2


Sample output:
4

Submission status: Accepted

Solution code:
import math
n, k = map(int, input().split())
ret = math.floor(math.log(n, k) + 1)
print("{}".format(ret))

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

Submission status: Accepted

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

count = 1

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

print(count)

Submission status: Accepted

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

ans = 0

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

print(ans+1)

Submission status: Accepted

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

r = 0
n = N
while True:
    q, m = divmod(n, K)
    r += 1

    if q < K:
        if q != 0:
            print(r+1)
        else:
            print(r)
        break

    n = q

Submission status: Accepted

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

cnt = 0
while True:
    N = N - ((K-1) * (K ** cnt))
    cnt = cnt + 1
    if (N <= 0):
        break

print(cnt)

Submission status: Accepted

Solution code:
n, k = [int(x) for x in input().split()]
count = 1
while True:
    if (n>=k**count):
        count += 1
    else:
        break
print(count)

Submission status: Accepted

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

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

for i in range(10000000):
    #print("i={}, n={}, k={}".format(i,n,k))
    #print(k**i)
    if k**i > n:
        break

print(i)

Submission status: Accepted

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

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

i = 0

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

Submission status: Accepted

Solution code:
number, base = map(int, input().split())
devision = number
list = []
while(devision>=base):
    surplus = devision % base
    devision = int(devision / base)
    #print(devision, surplus)
    list.insert(0,surplus)
    #print(list)
list += [devision]
#print(list)
print(len(list))

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
q = ''
while True:
    q += str(N % K)
    N = N // K
    if N == 0:
        break
print(len(q))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

disits()

Submission status: Accepted

Solution code:
def calculate_num(m, n):
  integer = m
  base = n
  result = ''
  digit = 0
  while integer > 0:
    result += str(integer%base)
    integer = integer//base
    digit = len(result)
  return digit

def main():
  num = input()
  num_list = num.split()
  number = int(num_list[0])
  base = int(num_list[1])
  result = calculate_num(number, base)
  print(result)
main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python

i = 1
nums = input()
nums = nums.split(' ')
x, y = (int(val) for val in nums)

while x >= y:
    x = x / y
    i += 1

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = 0
while N > 0:
    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:
import math

N, K = map(int, input().split())
ans = int(math.log(N, K))
print(ans + 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())
ans=0
while n:
    n = n//k
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
numbers =input().rstrip().split()
#print(numbers)
n =int(numbers[0])
k =int(numbers[1])
i=1
while n>=k**i:
    i=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())
print(len(Base_10_to_n(n, k)))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 27 09:12:42 2020

@author: 17664
"""

a, k = map(int, input().split())
cnt = 0

while a:
    a //= k
    cnt += 1
    
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

for i in range(1,50):
  if n < k ** i:
    print(i)
    break

Submission status: Accepted

Solution code:
list = input().split()
N = int(list[0])
K = int(list[1])
x = 0
while N != 0:
  N = N // K
  x += 1
print(x)

Submission status: Accepted

Solution code:
NandK = input()
NandK = NandK.split(' ')
N = int(NandK[0])
K = int(NandK[1])
ans = []
while (N / K) >= K:
    ans.append(N % K)
    N = int(N / K)
if len(ans) != 0:
    print(len(ans) + 2)
else:
    print(len(ans) + 1)

Submission status: Accepted

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

s = []
while N >= 1:
  q, mod = divmod(N, K)
  s.append(mod)
  N = q

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

print(a)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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



def kurai(n,k):
	for i in range(100):
		if k**(i) > n:
			return i



print(kurai(n,k))

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
InputValue = input().split(' ')

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

MaxN = 10
for i in range(9):
    MaxN = MaxN * 10

Count  = 1
if 1<=N<=MaxN and 2<=K<=10:
    Result = N // K
    while Result > 0:
        Result = Result // K
        Count+=1
print (Count,end='\n')

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
N,K=map(int, input().split())
i=1
while 1:
    if K>N:
        print(1)
        break
    elif K**i>N:
        print(i)
        break
    else:
        i=i+1
        continue

Submission status: Accepted

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

ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
N, K = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
while N > 0:
    N //= K
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(digits)

Submission status: Accepted

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

degit = 1

Q = N%K
R = (N-Q)/K

while R>0:
  Q = R%K
  R = (R-Q)/K
  degit += 1

print(degit)

Submission status: Accepted

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

digit = 1
while src[1] ** digit - 1 < src[0]:
    digit += 1

print(digit)

Submission status: Accepted

Solution code:
raw = input().split()
li = list(map(int, raw))
n = li[0]
k = li[1]

flag = 0
while 0 < n:
    flag += 1
    n = int(n / k)

print(flag)

Submission status: Accepted

Solution code:
N,K=map(int,input().split())
for p in range(0,1000):
    if K**p > N:
        break

print(p)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=1
hoge=a
for i in range(a):
  hoge=hoge//b
  if(hoge==0):
    print(ans)
    break
  ans+=1

Submission status: Accepted

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

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

for i in range(0,1000000000):
    t=k**i
    if n<t:
        print(i)
        break

Submission status: Accepted

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

wrk=1
for i in range(1,10**9):
    wrk*=k
    if n < wrk:
        print(i)
        exit()

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:
# cook your dish here
a,b=map(int,input().split())
c=0
while(a>0):
    a=a//b
    c=c+1
print(c)

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

cnt = 1
while n > k - 1 :
    n = n // k
    cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N,K=map(int,input().split())
print(len(str(np.base_repr(N,K))))

Submission status: Accepted

Solution code:
import numpy as np
import math
i = list(map(int, input().split()))
N = i[0]
K = i[1]

z = math.log(i[0],i[1])
z = int(z)
print(z+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():

    # sys.stdin = open('input156b.txt')

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

    ans = 0
    m = 1
    while n >= m:
        m *= k
        ans += 1

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split());c=0;
while n:c,n=-~c,n//k;
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(len(base_to_n(n,k)))

Submission status: Accepted

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

Submission status: Accepted

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

n = input[0]
baseK = input[1]

#x = b^y
#y = log b (x)

#log b a = log x (a) / log x (b)
count=0
while(n>0):
    count = count + 1
    n= n//baseK

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
from collections import deque, Counter
from itertools import chain, combinations
import json
import numpy as np
import bisect


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

    for i in range(10000000):
        if N < K ** i:
            print(i)
            return

    # A = [int(a) for a in input().split()]
    #
    # A = sorted(A)
    # A = np.array(A)
    #


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def solve(n, k):
    res = 0
    while n > 0:
        n = n // k
        res += 1
    return res


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


def test():
    assert solve(11, 2) == 4
    assert solve(1010101, 10) == 7
    assert solve(314159265, 3) == 18


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

Submission status: Accepted

Solution code:
inputNumber, baseNumber = list(map(int,input().split()))
count = 0

if baseNumber == 10:
    print(len(str(inputNumber)))
else:
    while not inputNumber == 0:
        inputNumber = inputNumber // baseNumber
        count += 1
    
    print(count)

Submission status: Accepted

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

ans = 0

while True:
  q,mod = divmod(N,K)
  N = q
  ans += 1
  if q == 0:
    break

print(ans)

Submission status: Accepted

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

ans = ""
while True:
    q, mod = divmod(N, K)
    ans = str(mod) + ans
    if q == 0:
        break
    N = q
print(len(ans))

Submission status: Accepted

Solution code:
x=input().split()
N=int(x[0])
D=int(x[1])
for k in range(31):
  if N//D**k==0:
    print(k)
    break

Submission status: Accepted

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

import math
a = (int(math.ceil(math.log(n)/math.log(k) )))
if a==0:
  print(1)
else:
  print(a)

Submission status: Accepted

Solution code:
def Digits(N, K):
  if not N:
    return 1
  digits = 0
  while N:
    N = N // K
    digits += 1
  return digits
 
N, K = map(int, input().split())
print (Digits(N, K))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
def inputS(): return input().rstrip().decode()
readlines = sys.stdin.buffer.readlines 

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())
box = []
a = n
b = n
while a>0:
    a, b = divmod(a,k)
    box.append(b)
#print(box)

l = len(box)
print(l)
#tot = ''
#for i in range(l):
#    tot = tot + str(box[l-1-i] * k**i)
#print(tot)
#print(len((tot)))

Submission status: Accepted

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

Submission status: Accepted

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

    print(digit)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

#kで何回割れるか
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 :
    ans+=1
    n//=k
print(ans)

Submission status: Accepted

Solution code:
def convert(t:int,k:int) -> str:
    ans = []
    if t == 0:
        return ans
    while(t >= k):
        ans.append(str(t%k))
        t = t//k
    ans.append(str(t))
    return "".join(ans[::-1])

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

Submission status: Accepted

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

"""
10進数をn進数に変換するには
10進数で表された数値をnで割り
それのあまりを逆から並べると、答えになる
今回は、ただ何回割れるかを出せばいいだけ
"""

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

Submission status: Accepted

Solution code:
import unittest


class TestB(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think(11, 2), 4)

    def test_2(self):
        self.assertEqual(think(1010101, 10), 7)

    def test_3(self):
        self.assertEqual(think(314159265, 3), 18)


def solve():
    n, k = read()
    result = think(n, k)
    write(result)


def read():
    return read_int(2)


def read_int(n):
    return read_type(int, n, sep=' ')


def read_float(n):
    return read_type(float, n, sep=' ')


def read_type(t, n, sep):
    return list(map(lambda x: t(x), read_line().split(sep)))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(n, k):
    buf = ''
    while n > 0:
        buf += str(n % k)
        n //= k
    return len(buf)


def write(result):
    print(result)


if __name__ == '__main__':
    # unittest.main()
    solve()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=0
while 1:
  if a==0:
    break
  a//=b
  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:
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


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

    print(a)
    return


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

cnt=0
#if a%b==0:
#            cnt=0
while a>=b:
            a=a//b
            cnt+=1
            
print(cnt+1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
n=0
while b**n<=a:
            n = n + 1

print(n)

Submission status: Accepted

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

c = 0
while N:
    c += 1
    N //= K

print(c)

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:
tmp = input().split(" ")
N = int(tmp[0])
K = int(tmp[1])
c = 0
while N!=0:
  N = int(N/K)
  c += 1
print(c)

Submission status: Accepted

Solution code:
n,k = list(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:
	c+=1
	n//=k
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, K = list(map(int, input().split()))
d = []
while N > 0:
    d.append(N % K)
    N = N // K

print(len(d))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

i = 1

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

print(i)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
while N >= K**ans:
    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:
import sys
l = sys.stdin.readline()
n, k = map(int, l.split())
if n == 0:
  print(1)
  sys.exit(0)
count = 0
while n > 0:
    n //= k
    count += 1
print(count)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def solve():
  n,k = (int(i) for i in input().split())
  digit = 0
  while n>0:
    n //= k
    digit += 1
  print(digit)
solve()

Submission status: Accepted

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

i=1
ans=1
while n>=i:
   i*=k
   ans+=1
print(ans-1)

Submission status: Accepted

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

while 1:
    if comp > n:
        break
    r += 1
    comp = k ** r

print(r)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
def t2n(n, b):
    if int(n/b):
        return (t2n(int(n/b), b) + str(n%b))
    return str(n%b)
N,R =[int(i) for i in input().split()]
print(len(t2n(N,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:
N,K=map(int,input().split())
x=0
while K**x<=N:
    x=x+1
print(x)

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())
ans = 1
#
while (n >= k):
    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 = 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 to_n(n,k):
    count =0
    while n!=0:
        n = n // k
        count+=1
    return count
print(to_n(n,k))

Submission status: Accepted

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

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
a, b = input().split()
N = int(a) #整数N
K = int(b) #K進数

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

print(i)

Submission status: Accepted

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

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())
ans = 1
if n <= k:
  print(ans)
else:
  for i in range(n):
    ans += 1
    n = int(n/k)
    if n < k:
      break
  print(ans)

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
ct = 0

while n > 0:
  ct+=1
  n//=m
  
print(ct)

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
  
i = list(map(int, input().split()))
out = Base_10_to_n(i[0], i[1])
print(len(str(out)))

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
count=1
num=n
while True:
    if num<k:
      print(count)
      exit()
    else:
      num=num/k
      count+=1

Submission status: Accepted

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

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

    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math


def main():
    N, K = map(int, input().split())
    ans = int(math.log(N, K)) + 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
d = k
ans = 1
while True:
    if k > n:
        break
    ans += 1
    k *= d
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())
cnt = 0

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

if N >= 1:
    cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
def base_10_to_n(x, n):
    tmp = x
    res = ''
    while tmp > 0:
        res = str(tmp % n)+res
        tmp = int(tmp/n)
    return res


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

Submission status: Accepted

Solution code:
import sys
import itertools
input = sys.stdin.readline
sys.setrecursionlimit(100000)


def read_values():
    return map(int, input().split())


def read_index():
    return map(lambda x: x - 1, map(int, input().split()))


def read_list():
    return list(read_values())


def read_lists(N):
    return [read_list() for n in range(N)]


def main():
    import math
    N, K = read_values()
    d = math.log(N, K)
    print(math.floor(d) + 1)


if __name__ == "__main__":
    main()

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

Submission status: Accepted

Solution code:
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


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


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N, K = read_int_list()
    res = 0
    while N > 0:
      N //= K
      res += 1
    print(res)

main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
n,k = [int(i) for i in 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)


m = Base_10_to_n(n,k)


print(len(m))

Submission status: Accepted

Solution code:
inp = list(map(int, input().split()))
n = inp[0]
k = inp[1]
for i in range(50):
    if(k ** i > n):
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

while n > 0:
    n //= k
    if n == 0:
        break
    else:
        count += 1

print(count)

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

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

a = len(base10to(n,b))
print(a)

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:
n, k = map(int, raw_input().split())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
numbers = [int(i) for i in input().split()]
N,K = numbers[0],numbers[1]


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

print(keta)