Problem:


Score : 200 points

Problem Statement

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

Notes

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

Constraints

All values in input are integers.

1 \leq N \leq 10^9

2 \leq K \leq 10

Input

Input is given from Standard Input in the following format:

N K

Output

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

Sample Input 1

11 2

Sample Output 1

4

In binary, 11 is represented as 1011.

Sample Input 2

1010101 10

Sample Output 2

7

Sample Input 3

314159265 3

Sample Output 3

18



Sample input:
11 2


Sample output:
4

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    n, k = map(int, input().split())
    res = ''
    while n > 0:
        res += str(n % k)
        n //= k
    print(len(res))

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

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

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N, K = MAP()

i = 0
while K**i <= N:
    i += 1
print(i)

Submission status: Accepted

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

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

print(keta)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
N,k=map(int,input().split())
idx=1
for i in range(N):
    if k**i>N:
        idx=i
        break
print(idx)

Submission status: Accepted

Solution code:
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys
sys.setrecursionlimit(1000000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

def factorial(i):
    if i == 1:
        return 1
    else:
        return i*factorial(i-1)
 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)




def main(): #startline--------------------------------------------
    def Base_10_to_n(X, n):
        X_dumy = X
        out = ''
        while X_dumy>0:
            out = str(X_dumy%n)+out
            X_dumy = int(X_dumy/n)
        return out
    n,k = map(int,input().split())
    print(len(str(Base_10_to_n(n,k))))
#endline===============================================
if __name__ == "__main__":
    main()

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

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

print(c)

Submission status: Accepted

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

def main(N, K):
    
    count = 0
    while N > 0:
        count += 1
        N = N // K

    return count

if __name__ == "__main__":

    answer = main(N, K)
    print(answer)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
[N,K] = list(map(int,input().split()))
output = 0
while N>0:
    output += 1
    newN = N//K
    if newN == N:
        break
    N = newN
print(output)

Submission status: Accepted

Solution code:

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

NK = input().split()

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

#print(Base_10_to_n(n, k))
x = Base_10_to_n(n, k)
print(len(str(x)))

Submission status: Accepted

Solution code:
a,b=list(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(a, b)))

Submission status: Accepted

Solution code:
#B

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil, log

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

Submission status: Accepted

Solution code:
import math

N, K = map(int, input().split())
count = 0
now = 1
while True:
    if N < now:
        break
    else:
        count += 1
        now *= K
        
print(count)

Submission status: Accepted

Solution code:
import numpy as np

n, k = np.asarray(input().split(), dtype=np.float64)

number = 1
while True:
    if n < k:
        break
    else:
        n = (n/k)
        number += 1

print(number)

Submission status: Accepted

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

res = 0

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

print(res+1)

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:
import sys
sys.setrecursionlimit(4100000)

import math

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)

# from collections import defaultdict
# d = defaultdict(list)

# from itertools import combinations
# comb = combinations(range(N), 2)

# 累積和
# from itertools import accumulate
# _list = list(accumulate(a_list)

# from functools import lru_cache
# @lru_cache(maxsize=None)
# def setUp(self):
#     dp.cache_clear()


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


def resolve():
    # S = [x for x in sys.stdin.readline().split()][0]  # 文字列 一つ
    # N = [int(x) for x in sys.stdin.readline().split()][0]  # int 一つ
    N, K = [int(x) for x in sys.stdin.readline().split()]  # 複数int
    # h_list = [int(x) for x in sys.stdin.readline().split()]  # 複数int

    # grid = [list(sys.stdin.readline().split()[0]) for _ in range(N)]  # 文字列grid
    # v_list = [int(sys.stdin.readline().split()[0]) for _ in range(N)]
    # grid = [[int(x) for x in sys.stdin.readline().split()]
    #         for _ in range(N)]  # int grid

    logger.debug('{}'.format([]))

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


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """11 2"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """1010101 10"""
        output = """7"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """314159265 3"""
        output = """18"""
        self.assertIO(input, output)

Submission status: Accepted

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

i = 1
ans = 0

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt + 1)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

answer = count + 1
print(answer)

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

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,k = LI()
cnt = 0
tmp = 1
while tmp <= n:
    tmp *= k
    cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
if k==2:
    print(len(bin(n)[2:]))
else:
    c = 1
    while True:
        if n // k**c > 0:
            c += 1
        else:
            break
    print(c)

Submission status: Accepted

Solution code:
#coding:utf-8

def base(num, n):
    if int(num/n):
        return(base(int(num/n), n)+str(num%n))
    return(str(num%n))

if __name__ == "__main__":
    n, k = map(int, input().split())
    base_num = base(n, k)
    print(len(base_num))

Submission status: Accepted

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

print(int(math.log(n,r))+1)

Submission status: Accepted

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

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

print(answer)

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)

x2 = Base_10_to_n(N, K) # x2 = K進数表示
print(len(list(str(x2))))

Submission status: Accepted

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

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

print(n)

Submission status: Accepted

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

ans = 0

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

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

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

Submission status: Accepted

Solution code:
def num():
    return int(input())
def nums():
    return list(map(int,input().split()))
import string
numbers = "0123456789"
alphabets = string.ascii_letters # a-z+A-Zをロード
characters = numbers + alphabets
 
def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
 
    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)
 
    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result

N,K = nums()
print(len(str(base_cvt(N,K))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
def main():
    n,k=map(int,input().split())
    print(int(math.log(n,k))+1)
if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
import string
numbers = "0123456789"
alphabets = string.ascii_letters # a-z+A-Zをロード
characters = numbers + alphabets

def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)
    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result
print(len(base_cvt(N,K)))

Submission status: Accepted

Solution code:

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

    count = 1
    while True:
        tmp = K ** count
        if tmp > N:
            print(count)
            break
        count += 1

    return 0


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from math import log, ceil

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

if ceil(log(N, K)) == log(N, K):
    print(ceil(log(N, K)) + 1)
else:
    print(ceil(log(N, K)))

Submission status: Accepted

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

ans = Base_10_to_n(X, Y)
print(len(ans))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
c = 1
while True:
    if N < K ** c:
        print(c)
        exit()

    c += 1

Submission status: Accepted

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

Submission status: Accepted

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

now = 1
count = 0

while n >= now:
    count += 1
    now = now * k

print(count)

Submission status: Accepted

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

print(len(Base_10_to_n(n, k)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def main():
  n, k = na()

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

if __name__ == '__main__':
  main()

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

Submission status: Accepted

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


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


x2 = Base_10_to_n(N, K)
test = list(x2)
print(len(x2))

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, raw_input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

a = f(n, k)
print(len(a))

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


def resolve():
    N, K = map(int, input().split())

    ans = Base_10_to_n(N, K)
    ans_list = list(str(ans))

    print(len(ans_list))


resolve()

Submission status: Accepted

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

def translate(n, k):
    tmp = n
    out = ""
    while tmp > 0:
        out = str(tmp % k) + out
        tmp = int(tmp / k)
    return out

print(len(translate(n, k)))

Submission status: Accepted

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

x = 1

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

print(x-1)

Submission status: Accepted

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

Submission status: Accepted

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

n,k=list(map(int,input().split()))
x2=Base_10_to_n(n,k)
print(len(str(x2)))

Submission status: Accepted

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

def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
 
x10 = a
c = Base_10_to_n(a,b )
print( len(c) )

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,k = inpl()
cnt = 0
while True:
    if n >= k ** cnt:
        cnt += 1
    else:
        print(cnt)
        break

Submission status: Accepted

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

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

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

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

numDigits = 1
while K ** numDigits <= N:
    numDigits += 1
print(numDigits)

Submission status: Accepted

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


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 solve(N: int, K: int):
    print(len(str(Base_10_to_n(N, K))))
    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 = 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(list(str(base10to(n,k)))))

Submission status: Accepted

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

c = 0
i = 1
while True:
    if N <= K ** i - 1:
        break
    i += 1

print(i)

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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


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


ans = len(str(conv(N, K)))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n,k = map(int,input().split())
ans = 1
count = 0
while True:
    ans *= k
    count += 1
    if n < ans:
        print(count)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N,K = LI()

i = 0
while 1:
    if K**(i-1) <= N < K**i:
        print(i)
        exit()
    else:
        i += 1

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 1

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

print(count)

Submission status: Accepted

Solution code:
import numpy as np
N, K = map(int, input().split(" "))

i = 1
while K ** i <= N:
    i += 1
else:
    print(i)

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

Submission status: Accepted

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


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

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

print(i)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

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

Submission status: Accepted

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

print(cnt)

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:
# B
import math

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

a = math.floor(math.log(N, K))+1

print(a)

Submission status: Accepted

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


def encode_x_base(n, x):
    ret = ''
    while n:
        ret += str(n % x)
        n //= x

    return ret[::-1]


print(len(encode_x_base(N, K)))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

l = math.log(n,k)

print(math.floor(l+1))

Submission status: Accepted

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

Submission status: Accepted

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

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

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