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:
#https://atcoder.jp/contests/abc156/tasks/abc156_b
N,K = map(int,input().split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    #print(q)
    #print(mod)
    if q <=0 :
        break
if mod_list[-1] == 0:
    result = len(mod_list) - 1
else:
    result =len(mod_list)
print(result)

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

    return str(n % k)


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

print(len(calc_digits(n, k)))

Submission status: Accepted

Solution code:
import math  
def findNumberOfDigits(n, b): 
    dig = (math.floor(math.log(n) /math.log(b)) + 1) 
    return dig
n, k = map(int, input().strip().split())
print(findNumberOfDigits(n, k))

Submission status: Accepted

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

list=[]
while N>=K:
    x=N%K
    N=N//K
    list.append(x)

list.append(N)
print(len(list))

Submission status: Accepted

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

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

def ans156(N:int, K:int):
    length=1#0桁はないため、1からスタート
    while True:
        if N<K:
            break
        N=int(N/K)#割り切れるごとに1桁ずつ増えていく。
        length+=1
    return length

print(ans156(N,K))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os, sys, re, math

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

d = 0
a = K ** 0
while a <= N:
    d += 1
    a *= K

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s, k = map(int,input().split())
c = []
while s > 0:
    a = s % k
    c.append(a)
    s //= k

print(len(c))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if(N==1):
    print(1)
    exit()
print(math.ceil(math.log(N,K)))

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

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

print(ans+1)

Submission status: Accepted

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


for i in range(100):
    if n//(k**i) == 0:
        if n%(k**i)>=1:
            print(i)
            break
        else:
            print(i-1)
            break

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

bit = 0
while(N >= K**bit):
  bit += 1
print(bit)

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
[n, k] = [int(i) for i in input().split()]
for i in range(40):
    if n < k**i:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    n, k = map(int, input().split())
    cnt = 0
    i = 1
    # nが大きい
    while n >= i:
        i *= k
        cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
n, k = map(int, input().split())
r=0
while n > 0:
  r=r+1
  n=n//k
print(r)

Submission status: Accepted

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

k_shinsu_list = []
while True:
    k_shinsu_list.append(N % K)
    N = N // K
    if N == 0:
        break
print(len(k_shinsu_list))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
import bisect
def main():
    N, K = MI()
    ans = 0
    p = 1
    while p <= N:
        p *= K
        ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

if n == 1:
    print(1)
else:
    a=1
    ans = 0
    while a<=n:
        a *=k
        ans += 1

    print(ans)

Submission status: Accepted

Solution code:
import math

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

print(math.ceil(math.log(N,K)) if N!=1 else 1)

Submission status: Accepted

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

p=int(math.log2(n))

for i in range(p+2):
    if n//(k**i)<1:
        print(i)
        sys.exit()

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())
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, m = divmod(n, k)
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n, k = (int(n) for n in input().split())
count = 0
while True:
    n = n // k
    count += 1
    if n == 0:
        break
print(count)

Submission status: Accepted

Solution code:
def Base(X, n):
    if (int(X/n)):
        return Base(int(X/n), n)+str(X%n)
    return str(X%n)

def main():
  N, K = map(int, input().split())
  ans1 = Base(N, K)
  ans = len(ans1)
  print(ans)

main()

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())
b = ''
while n > 0:
    b += str(n % k)
    n = n // k
print(len(b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ri = lambda S: [int(v) for v in S.split()]
def rii(): return ri(input())

N, K = rii()

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

print(count)

Submission status: Accepted

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

i = 1
temp = k

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

Submission status: Accepted

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

for i in range(1000000):
    if k**i > n:
        print(i)
        break

Submission status: Accepted

Solution code:
import sys
n,k = map(int, sys.stdin.readline().rstrip("\n").split())
ans = 0
while n != 0:
    n = n // k
    ans += 1
print(ans)

Submission status: Accepted

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

D = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,k = mi()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B
N, K = map(int,input().split())
num=[]
while N >= K:
    num.append(N%K)
    N=N//K
num.append(N)
print(len(num))

Submission status: Accepted

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

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

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

print(cnt)

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
import sys
sys.setrecursionlimit(10**9)


INF=10**20
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:
N, K = map(int, input().split())

# NをK進数で表したときの表記を求める必要はない
# K進数で表したときの桁数を求めればよい

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

print(ans)

Submission status: Accepted

Solution code:
def from_10_to_n(x, n):
  tmp = x
  out = ''
  while tmp > 0:
    out = str(x % n) + out
    tmp = tmp // n
  return out
 
N, K = map(int, input().split())
N = from_10_to_n(N, K)
print(len(N))

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N, K = map(int, readline().split())

    digit = 0
    cur = 0

    while cur < N:
        digit += 1
        cur = K ** digit - 1

    print(digit)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

i=1
rr=r
while rr <= n:
    i+=1
    rr=rr*r
print(i)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# vim: fileencoding=utf-8


def main():
    n, k = map(int, input().split())
    ans = 0
    while True:
        t = n - k ** ans
        if t == 0:
            print(ans + 1)
            return
        if t < 0:
            print(ans)
            return
        ans += 1


if __name__ == "__main__":
    main()

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

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

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:
N, K = map(int, input().split())
ans = []
while N > 0:
    ans.append(N % K)
    N //= K
print(len(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:
r=input().split()
N=int(r[0])
K=int(r[1])
l=[]
while N>=1:
    l.append(N%K)
    N=N//K
print(len(l))

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue, copy, array

# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

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


def combinations_count(n, r, mod=MOD):
    def factorial_mod(N, mod=MOD):
        ret = 1
        for n in range(1, N + 1):
            ret *= n
            ret %= mod
        return ret

    q = factorial_mod(n + r, mod)
    b = factorial_mod(n, mod)
    d = factorial_mod(r, mod)
    b = pow(b, mod - 2, mod)
    d = pow(d, mod - 2, mod)
    return (q * b * d) % mod


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)


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue, copy, array

# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

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


def combinations_count(n, r, mod=MOD):
    def factorial_mod(N, mod=MOD):
        ret = 1
        for n in range(1, N + 1):
            ret *= n
            ret %= mod
        return ret

    q = factorial_mod(n + r, mod)
    b = factorial_mod(n, mod)
    d = factorial_mod(r, mod)
    b = pow(b, mod - 2, mod)
    d = pow(d, mod - 2, mod)
    return (q * b * d) % mod


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

    N, K = il()
    ret = 0
    while N != 0:
        N //= K
        ret += 1
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    N, K = map(int, open(0).read().split())
    i = 0
    while N != 0:
        N = N // K
        i += 1
    print(i)


main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

n, k = inm()
count = 1
ans = 0
while count <= n:
    count *= k
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
a=0
b=n
while b>=k:

    b=b//k

    a+=1

print(a+1)

Submission status: Accepted

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

num = ""
while(N > 0):
  num += str(N % K)
  N = int(N / K)

print(len(num))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n,k=map(int,input().split())
a=[]
while n>=1:
    s=n%k
    n=n//k
    a.append(s)

print(len(a))

Submission status: Accepted

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

    while True:
        a *= k
        if a > n:
            break
        b += 1

    ans = b + 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def main():
    N, K = map(int, input().split())

    for i in range(10 ** 9):
        if N <= K ** i - 1:
            print(i)
            break


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if N == 1:
  print(1)
  
else:
  for i in range(1, N):
    if K**i > N:
      print(int(i))
      break

Submission status: Accepted

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

ans = 0
div = K
while N/pow(K, ans) >= 1:
    ans += 1
    div *= ans
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,R=map(int,input().split())
num=0
while N>=R:
    N=N/R
    num+=1
print(num if N==0 else num+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())
tmp=N
count=0
while tmp!=0:
    tmp = tmp//K
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
i = 0
while True:
    if N//(K**i)==0:
        print(i)
        break
    i += 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:
def base10to(x, n):
  if (int(x/n)):
    return base10to(int(x/n), n)+str(x%n)
  return str(x%n)
n,k = map(int, input().split())
print(len(base10to(n,k)))

Submission status: Accepted

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

def abc(n,m):
    a,b = divmod(n,m)
    return a,b

count = 0 
a = 1
while a !=0 :
    a,b = abc(N,K)

    N = a
    count += 1
print(count)

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

Submission status: Accepted

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

Submission status: Accepted

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

count=1
subk=k

while subk<=n:
  subk*=k
  count+=1
  
print(count)

Submission status: Accepted

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

cnt = 1
power = K

while power <= N:
    power *= K
    cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
score = list(map(int,input().split()))
keta = 0
answer = 1
while score[0] >= answer:
    answer *= score[1]
    keta += 1
print(keta)

Submission status: Accepted

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

Submission status: Accepted

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

import math

taisu=math.log(n,k)

print(int(taisu)+1)

Submission status: Accepted

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

    c = 0
    while True:
        if n >= k ** c:
            c += 1
        else:
            break
    
    print(c)
    return
main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math

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

n = int(math.sqrt(N)) + 1

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
xx=k
c=0
while xx<=n:
  xx=k**c
  c+=1
if c<1:
  c=2
print(c-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())
p,c=1,1
while p<=N:
    p*=K
    c+=1
print(c-1)

Submission status: Accepted

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

print(i+1)

Submission status: Accepted

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

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:
sus = ['0','1','2','3','4','5','6','7','8','9']
def base_sus(dig,n):
    if dig == 0: return ""
    return sus[dig%n]+base_sus(dig//n,n)
a,b = map(int,input().split())
print(len(base_sus(a,b)))

Submission status: Accepted

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

Submission status: Accepted

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

if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
for i in range(10*10):
    num = N // (K**i)
    if num < 1:
        print(i)
        exit()

Submission status: Accepted

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

print(a + 1)

Submission status: Accepted

Solution code:
# Digits
N, K = map(int, input().split())
div = N // K
digits = []
while div > K:
    div = N // K
    digits.append(str(N % K))
    N   = div
digits.append(str(N % K))
if N // K != 0:
    digits.append(str(N // K))
ans = len(digits)
print(ans)

Submission status: Accepted

Solution code:
import sys

N, K = map(int, sys.stdin.buffer.read().split())

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

print(i)

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:
X,n = 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(X, n)
print(len(str(a)))

Submission status: Accepted

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

Submission status: Accepted

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

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

n = 0
x = 0

while True:
    x = K**n
    if x > N:
        n -= 1
        break
    n += 1

ans = []

for i in range(n, -1, -1):
    if K**i < N:
        ans.append(N//(K**i))
        N = N % (K**i)
    else:
        ans.append(0)

print(len(ans))

Submission status: Accepted

Solution code:
import sys

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

if K == 10:
    print(len(str(N)))
    sys.exit()

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

print(p)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(digits)

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

def dec2n(int1, int2):
  l = ""
  while int1 != 0:
    l += str(int1 % int2)
    int1 = int1 // int2
  return l[::-1]

if K == 10:
  print(len(str(N)))
else:
  print(len(dec2n(N, K)))

Submission status: Accepted

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

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