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:
from math import log, ceil

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

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

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

Submission status: Accepted

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

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:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n, k = MAP()
if(n==1):
    print(1)
else:
    print(ceil(log(n, k)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 156b
n, k = map(int, input().split())

for i in range(n):
  n = n // k
  if n == 0:
    print(i + 1)
    exit()

Submission status: Accepted

Solution code:
N,K  = map(int,input().split())
lis = [K**i for i in range(100)]

for i in range(len(lis)):
    if N -lis[i]< 0 and i ==0:
        print(1)
        break
    if N -lis[i] <0:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,K=list(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())
i=1
while k**(i-1)>n or n>=k**i:
  i=i+1
else:
  print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
x,y = map(int ,input().split())
m = math.ceil(math.log(x, y))
if m == 0 :m=m+1
print(m)

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:
# -*- coding: utf-8 -*-
"""
Created on Thu May  7 21:59:58 2020

@author: shinba
"""
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())
count = 0
s = 1
if K == 10:
  n = list(str(N))
  keta = len(n)
  print(keta)
  exit()
else:
  while N >= K**count:
    count += 1
print(count)

Submission status: Accepted

Solution code:
from math import floor, log
n, k = [int(s) for s in input().split()]
print(floor(log(n, k)) + 1)

Submission status: Accepted

Solution code:
import sys

n,k=map(int,input().split())
for i in range(1,60):
    if k**(i-1)<=n<k**i:
        print(i)
        sys.exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def convert(n, k):
    tmp = n
    ans = ''
    while tmp > 0:
        ans += str(tmp % k)
        tmp = tmp // k
    return ans


def main():
    n, k = map(int, stdin.readline().split())
    print(len(convert(n, k)))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0
for i in range(31):
    if n//(k**i)==0:
        ans = i
        break
        
print(ans)

Submission status: Accepted

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

cnt = 0
while N != 0:
    N = (N - N%K)/K
    cnt += 1
print(cnt)

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

Submission status: Accepted

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

cnt = 0
while n >= k:
    n = n // k
    cnt += 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())
count = 0
for i in range(100) :
    if K ** i <= N :
        count += 1
    else :
        break
print(count)

Submission status: Accepted

Solution code:
# B - Digits

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

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())
count = 0
while True:
    if N>=(K**count):
        count += 1
    else:
        break
if N == 1:
    count = 1


print(count)

Submission status: Accepted

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

Submission status: Accepted

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

total=0
for i in range(1,100):
    if int(N/K**i)>0:
        total+=1
    else:
        print(total+1)
        break

Submission status: Accepted

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

ans = []
i = 0
while n > 0:
    ans.append(n%k)
    n = n//k

print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

    N, K = map(int, input().split())
    s = []
    while True:
        n = N % K
        N //= K
        if N == 0 and n == 0:
            break
        s.append(n)
    print(len(s))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

# for i in range(2**n):
#     if n <= k ** i - 1:
#         print(i)
#         break

temp = 1
cnt = 0
while n > temp - 1:
    temp *= k
    # print(temp)
    cnt += 1
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  # '123' -> 123
def Is(): return map(int, input().split())  # '123 456' -> 123, 456
def LI(): return list(map(int, input().split()))  # '123 456' -> [123, 456]
def TI(): return tuple(map(int, input().split()))  # '123 456' -> (123, 456)
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  # 'aa bb' -> 'aa','bb' or ['aa','bb']
def LS(): return list(input())  # 'abc123' -> ['a','b','c','1','2','3']
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

n, k = Is()

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

Submission status: Accepted

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


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


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n, k =list(map(int, input().split()))
l = []
while True:
    l.append(n % k)
    n = n // k
    if n == 0:
        break
ans = len(l)
print(ans)

Submission status: Accepted

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


if k == 10:
    ans = len(str(n))
else:
    l = []
    while True:
        n = n // k
        ans += 1
        if n == 0:
            break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
n,k = [int(i) for i in readline().split()]

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

print(len(Base_10_to_k(n, k)))

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

result = ""
while True:
    result = str(n % k) + result
    n = (n - (n % k)) // k
    if n <= 0:
        break
print(len(result))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def modd(x, y):
    mod(x, y)

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

Submission status: Accepted

Solution code:
N, K = [int(_) for _ in input().split()]
cnt = 0
while True:
    N = N // K
    cnt += 1
    if N == 0:
        break
print(cnt)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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)
############################
 
 
#####関数をつかってみる．#####
######今回は二進数に変換######
x10 = N
x2 = Base_10_to_n(x10, K)
print( len(str(x2)) )#"100011"が表示される．

Submission status: Accepted

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

if N<K:
  print(1)

else:
  for i in range(1,N):
    A=K**i
    if N<A*K:
      print(i+1)
      break

Submission status: Accepted

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

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

Submission status: Accepted

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

if N ==0 or N==1:
    print(1)
    exit()

for i in range(1,10000,1):
    if K**i <= N and N <= K**(i+1) -1:
        print(i+1)
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

while flg == 0:
    if n // k**ans > 0:
        ans +=  1
    else:
        flg = 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Python3 program to Find Number of digits 
# in base b. 

import math 

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

# Driver method 

# taking inputs 
n,k=map(int,input().split())

# calling the method 
print(findNumberOfDigits(n, k))

# This code is contributed by 
# Manish Shaw (manishshaw1)

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

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())
for i in range(10000):
    if N%(K**i)==N:
        print(i)
        exit(0)

Submission status: Accepted

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

print(solve())

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:
import math
a,r=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(a,r)
print(len(ans))

Submission status: Accepted

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

p = math.ceil(math.log(n,k))
if(k**p == n):p += 1
print(p)

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

for i in range(int(math.log2(N)+1)):
    if N >= pow(K,i) and N < pow(K,i+1):
        print(i+1)
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, K = lr()
answer = 0
while N:
    N //= K
    answer += 1
print(answer)

Submission status: Accepted

Solution code:

n,k=map(int,input().split())
count=0
for i in range(10000):
    n=n/k
    count+=1
    if n<1:
        break
print(count)

Submission status: Accepted

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


while n>=k**i:

    i+=1

else:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

digits = 1

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

print(digits)

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:
import sys
def input(): return sys.stdin.readline().strip()

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

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
def input(): return sys.stdin.readline().strip()

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

Submission status: Accepted

Solution code:
N,K=[int(x) for x in input().rstrip().split()]
cnt=0
ans=0
while(True):
  if N!=0:
    N=N//K
    cnt+=1
  else:
    break
    
print(cnt)

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:
n,k=map(int,input().split())
cnt = 0
while n>=k:
  n = n // k
  cnt += 1
print(cnt+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())
ans = []
while n > 0:
    ans.append(n%k) 
    n //= k

print(len(ans))

Submission status: Accepted

Solution code:
import sys

n, k = map(int, input().split())
if n <= k:
    print(len(str(n)))
    sys.exit()

def clas(n, k):
    li = []
    while True:
        c = n // k
        li.append(c % k)
        if c < k:
            li.append(c)
            break
        n = c
    return li

print(len(clas(n, k)))

Submission status: Accepted

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

cnt = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    n, k = map(int,input().split())
    y = 0
    while n:
        n //= k
        y += 1
    print(y)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    n, k = map(int,input().split())
    x = 1
    y = 0
    while n:
        n //= k
        y += 1
    print(y)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    n, k = map(int,input().split())
    x = 1
    y = 0
    if n == 1:
        print(1)
        exit()
    while x <= n:
        x *= k
        y += 1
    print(y)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import math

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

x = math.log(n, k)
x = math.floor(x)

print(x+1)

Submission status: Accepted

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

while num  >= k:
    num = num // k
    count+= 1

print(count)

Submission status: Accepted

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

i = 1
while N >= K ** i:
    if N >= K ** i:
        i += 1

print(i)

Submission status: Accepted

Solution code:
il = input().split()
N = int(il[0])
K = int(il[1])
T = N
# 整数NをK進数に変換し、その桁数を出力する

result = ""

i = 0
k = 0
while (T != 0):
    result = str(T%K)+result
    T = T//K

print (len(result))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n, r = map(int, input().split())
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
print(len(Base_10_to_n(n, r)))

Submission status: Accepted

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

i = 1
j = 1
answer = 1
while i > 0:
  if N % (K ** j) != N:
    answer += 1
    j += 1
  else:
    print(answer)
    break

Submission status: Accepted

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

Submission status: Accepted

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

tmp = B
ans = 1
while True:
  if tmp - 1 >= N:
    break
  tmp *= B
  ans += 1
  
print(ans)

Submission status: Accepted

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

rem = N
ans = 0
while rem > 0:
    rem = rem // 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)
  i += 1
print(i-1)

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
i = k
s = 1

while(n%i != n):
    s += 1
    i  = k ** s
    ans += 1

print(ans)

Submission status: Accepted

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

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
    N,K = MI()
    i = 0
    ans = 0

    while True:
        i += 1
        if N <= (K**i)-1:
            ans = i
            break
    print(ans)





if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

n,k = map(int,input().split())
if n == 1:
	print(1)
	sys.exit()
i = 0
num = 1
while True:
	if n < num:
		break
	num *= k
	i += 1

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def I():
  return input()
def II():
  return int(input())
def MII():
  return map(int, input().split())
def LMII():
  return list(map(int, input().split()))

n, r = MII()
i = 1
a = r
while True:
  if n < a:
    break
  else:
    a *= r
    i += 1
print(i)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    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())
A=math.log(N,K)
print(int(A)+1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x = input()
n = int(x.split()[0])
k = int(x.split()[1])
result = ''

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

print(len(result))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(len(base10to(N,K)))

Submission status: Accepted

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

Submission status: Accepted

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

if K == 10:
    Str = str(N)
    print(len(Str))
else:
    cnt = []
    while True:
        if N < K:
            cnt.append(N)
            break
        cnt.append(N%K)
        N = int(N/K)
    print(len(cnt))

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 sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
import math;floor,ceil=math.floor,math.ceil
from collections import deque
Yes=lambda b:print('Yes')if b else print('No');YES=lambda b:print('YES')if b else print('NO')
is_even=lambda x:True if x%2==0 else False

def main():
  n,k = ints()
  print(1+int(math.log(n,k)))

      
if __name__ == '__main__':
  main()

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())
count=0
for i in range(0, 10**100):
    if n // (k**i) != 0:
        count += 1
    else:
        break

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(d)

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 = 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(1,31):
    if n<k**i:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(10000000):
    if k**i-1>=n:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, k = map(int,input().split())
know = 1
for i in range(10**9):
    if (n+0.5)//know == 0:
        print(max(1,i))
        break
    else:
        know *= k

Submission status: Accepted

Solution code:
import sys
n, k = map(int, sys.stdin.readline().split())
cnt = 1
while n >= k:
  cnt += 1
  n //= k
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

s=str()
while n>0:
  n=n//k
  s+='1'
print(len(s))

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
while True:
    ans += 1
    if pow(k, ans)-1 >= n:
        print(ans)
        break

Submission status: Accepted

Solution code:
def base10toq(n,q):
  if int(n/q): return base10toq(int(n/q),q)+str(n%q)
  return str(n%q)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,K = (int(x) for x in input().split())
count = 0
i = 0
while N > 0:
    count += 1
    N -= K**i*(K-1)
    i += 1
print(count)

Submission status: Accepted

Solution code:

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

i = 0 

a = K

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

Submission status: Accepted

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

while K**p <= N:
  p += 1 

print(p)

Submission status: Accepted

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

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