Problem:


Score : 200 points

Problem Statement

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

Notes

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

Constraints

All values in input are integers.

1 \leq N \leq 10^9

2 \leq K \leq 10

Input

Input is given from Standard Input in the following format:

N K

Output

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

Sample Input 1

11 2

Sample Output 1

4

In binary, 11 is represented as 1011.

Sample Input 2

1010101 10

Sample Output 2

7

Sample Input 3

314159265 3

Sample Output 3

18



Sample input:
11 2


Sample output:
4

Submission status: Accepted

Solution code:
import math

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from sys import stdin

N, K = [int(x) for x in stdin.readline().rstrip().split()]

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

print(count(N, K))

Submission status: Accepted

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


def solve(N: int, K: int):
    print(len(Base_10_to_n(N, K)))
    return


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)


# 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=int(input())
n,k=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
N, 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)
############################
 
x2 = Base_10_to_n(N, R)
print(len(x2))

Submission status: Accepted

Solution code:
N = [int(str) for str in input().split()]
n = N[0]
k = N[1]

import math

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

Submission status: Accepted

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

while True:
    if n < k ** count:
        break
    else:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(100000):
    if N // (K**i) == 0:
        print(i)
        break

Submission status: Accepted

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


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


leng = str(Digit(N, K))
print(len(leng))

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

Submission status: Accepted

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

count = 0

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

print(count + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def base_changer(number,base):
    buff=97+abs(base-10)
    dic={};buff2='';buff3=10
    for i in range(97,buff+1):
        dic[buff3]=chr(i)
        buff3+=1   
    while(number>=base):
        mod=int(number%base)
        number=int(number//base)
        if (mod) in dic.keys():
            buff2+=dic[mod]
            continue
        buff2+=str(mod)
    if (number) in dic.keys():
        buff2+=dic[number]
    else:
        buff2+=str(number)

    return buff2[::-1]  
N,K = map(int, input().split())
print(len(base_changer(N,K)))

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

Submission status: Accepted

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

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:
numbers = "0123456789"

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

tmp = N
res = ''
while tmp >= K:
  idx = tmp%K
  res = numbers[idx] + res
  tmp = int(tmp / K)
idx = tmp%K
res = numbers[idx] + res
print(len(res))

Submission status: Accepted

Solution code:
# 入力が10**5とかになったときに100ms程度早い
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


N, K = read_ints()

ans = ''
a = N
while a >= K:
    a, b = divmod(a, K)
    ans += str(b)

print(len(ans[::-1]) + 1)

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(str(Base_10_to_n(n,k))))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def numberToBase(n, b):
    if n == 0:
        return [0]
    digits = []
    while n:
        digits.append(int(n % b))
        n //= b
    return digits[::-1]

n, b = input().split()
result = len(numberToBase(int(n), int(b)))
print(result)

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

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 = [int(i) for i in input().split()]
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
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:
n, k = map(int, input().split())

for i in range(100):
    if k ** i <= n:
        continue
    else:
        break

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def koike(X, n):
    if (int(X/n)):
        return koike(int(X/n), n)+str(X%n)
    return str(X%n)
x = N
new_x = koike(x, K)
print(len(new_x))

Submission status: Accepted

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

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

Submission status: Accepted

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


n, k = map(int, input().split())
cnt, ans = 1, 0

while cnt <= n:
    cnt *= k
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

for i in range (1,1000):
  if K ** i > N:
    print(i)
    sys.exit()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

arr=input().split(" ")
n,k=int(arr[0]),int(arr[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


count = 1
num = k
while True:
    if n < num:
        break
    num = num * 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 = [int(x) for x in input().split()]

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

Submission status: Accepted

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

    ans = [K**i for i in range(30)]
    from bisect import bisect
    print(bisect(ans, N))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
c=math.log(a,b)
if c//1==c:
    print(int(math.log(a,b))+1)
    exit()
print(math.ceil(math.log(a,b)))

Submission status: Accepted

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

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

print(digit)

Submission status: Accepted

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

hoge = 1

for i in range(32):
  if hoge > n:
    print(i)
    exit()
  else:
    hoge *= k

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 1

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

print(cnt)

Submission status: Accepted

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

import string
digs = string.digits + string.ascii_letters


def conv(num,b):
    convStr = "0123456789"
    if num<b:
        return convStr[num]
    else:
        return conv(num//b,b) + convStr[num%b]


def solve(N: int, K: int):
    print(len(conv(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:
import math

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

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

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 = input().split()
N = int(N)
K = int(K)

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

Submission status: Accepted

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

Submission status: Accepted

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

ct = 1

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

Submission status: Accepted

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

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
a,n=map(int,input().split())
print(len(str(Base_10_to_n(a, n))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
Author    : co_devil Chirag Garg
Institute : JIIT
"""
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
# from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
# from bisect import bisect_left,bisect_right
# from decimal import *,threading
from fractions import Fraction
mod = int(pow(10, 9)+7)


def ii(): return int(input())


def si(): return str(input())


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


def li(): return list(mi())


def fii(): return int(stdin.readline())


def fsi(): return str(stdin.readline())


def fmi(): return map(int, stdin.readline().split())


def fli(): return list(fmi())


abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12,
       'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24,
       'z': 25}


def getKey(item): return item[0]


def sort2(l): return sorted(l, key=getKey)


def d2(n, m, num): return [[num for x in range(m)] for y in range(n)]


def isPowerOfTwo(x): return (x and (not (x & (x - 1))))


def decimalToBinary(n): return bin(n).replace("0b", "")


def ntl(n): return [int(i) for i in str(n)]


def powerMod(x, y, p):
    res = 1
    x %= p
    while y > 0:
        if y & 1:
            res = (res * x) % p
        y = y >> 1
        x = (x * x) % p
    return res


graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000


def bfs(d, v):
    q = []
    q.append(v)
    visited[v] = 1
    while len(q) != 0:
        x = q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i] != 1:
                visited[i] = 1
                q.append(i)
        print(x)


def make_graph(e):
    d = {}
    for i in range(e):
        x, y = mi()
        if x not in d:
            d[x] = [y]
        else:
            d[x].append(y)
        if y not in d:
            d[y] = [x]
        else:
            d[y].append(x)
    return d


def gr2(n):
    d = defaultdict(list)
    for i in range(n):
        x, y = mi()
        d[x].append(y)
    return d


def connected_components(graph):
    seen = set()

    def dfs(v):
        vs = set([v])
        component = []
        while vs:
            v = vs.pop()
            seen.add(v)
            vs |= set(graph[v]) - seen
            component.append(v)
        return component

    ans = []
    for v in graph:
        if v not in seen:
            d = dfs(v)
            ans.append(d)
    return ans


def primeFactors(n):
    s = set()
    while n % 2 == 0:
        s.add(2)
        n = n // 2
    for i in range(3, int(sqrt(n)) + 1, 2):
        while n % i == 0:
            s.add(i)
            n = n // i
    if n > 2:
        s.add(n)
    return s


def find_all(a_str, sub):
    start = 0
    while True:
        start = a_str.find(sub, start)
        if start == -1:
            return
        yield start
        start += len(sub)


def SieveOfEratosthenes(n, isPrime):
    isPrime[0] = isPrime[1] = False
    for i in range(2, n):
        isPrime[i] = True
    p = 2
    while (p * p <= n):
        if (isPrime[p] == True):
            i = p * p
            while (i <= n):
                isPrime[i] = False
                i += p
        p += 1
    return isPrime


def dijkstra(edges, f, t):
    g = defaultdict(list)
    for l, r, c in edges:
        g[l].append((c, r))

    q, seen, mins = [(0, f, ())], set(), {f: 0}
    while q:
        (cost, v1, path) = heappop(q)
        if v1 not in seen:
            seen.add(v1)
            path = (v1, path)
            if v1 == t:
                return (cost, path)

            for c, v2 in g.get(v1, ()):
                if v2 in seen:
                    continue
                prev = mins.get(v2, None)
                next = cost + c
                if prev is None or next < prev:
                    mins[v2] = next
                    heappush(q, (next, v2, path))
    return float("inf")


def binsearch(a, l, r, x):
    while l <= r:
        mid = l + (r-1)//2
        if a[mid]:
            return mid
        elif a[mid] > x:
            l = mid-1
        else:
            r = mid+1
    return -1


def reVal(num):

    if (num >= 0 and num <= 9):
        return chr(num + ord('0'))
    else:
        return chr(num - 10 + ord('A'))

# Utility function to reverse a string


def strev(str):

    len = len(str)
    for i in range(int(len / 2)):
        temp = str[i]
        str[i] = str[len - i - 1]
        str[len - i - 1] = temp

# Function to convert a given decimal
# number to a base 'base' and


def fromDeci(res, base, inputNum):

    index = 0  # Initialize index of result

    # Convert input number is given base
    # by repeatedly dividing it by base
    # and taking remainder
    while (inputNum > 0):
        res += reVal(inputNum % base)
        inputNum = int(inputNum / base)

    # Reverse the result
    res = res[::-1]

    return res


n, k = mi()
res = ""
s = str(fromDeci(res, k, n))
print(len(s))

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)

li = list(map(int, input().split()))
ans = len(base_10_to_n(li[0], li[1]))
print(ans)

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

kazu, sinsuu = map(int, input().split())
print(len(Base_10_to_n(kazu, sinsuu)))

Submission status: Accepted

Solution code:
# coding:utf-8

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

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

print(cnt)

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

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)
print(len(Base_10_to_n(a, b)))

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)
print(len(str(x2)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)
x10 = k[0]
x2 = Base_10_to_n(x10, k[1])
print(len(x2))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

#n=int(sys.stdin.readline())
n,k=map(int,sys.stdin.readline().split())
#a=np.array([sys.stdin.readline().split() for i in range(n)],np.int64)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#!python3.4
# -*- coding: utf-8 -*-
# abc156/abc156_b
import sys
import numpy as np

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N, K = i2nn()
    print(len(np.base_repr(N, K)))
    return

main()

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 = map(int,input().split())
x = len(str(Base_10_to_n(n,k)))
print(x)

Submission status: Accepted

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

ans = 1

for i in range(10000):
  if n // k > 0:
    ans += 1
    n = n // k
  else:
    break
print(ans)

Submission status: Accepted

Solution code:
import sys

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

def main():
    tmp = input().replace('\n','').split(' ')
    n = int(tmp[0])
    r = int(tmp[1])
    res = a(n, r)
    print(len(res))
if __name__ == '__main__':
    input = sys.stdin.readline
    main()

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:
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 = 0
while True:
    s = k ** i
    if n / s >= 1:
        i += 1
        continue
    else:
        break
print(i)

Submission status: Accepted

Solution code:
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft


def main():
    n,k = map(int, input().split())
    t = 1
    for i in range(100):
        t *= k
        if n < t:
            print(i+1)
            return
        
   

main()

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

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

Submission status: Accepted

Solution code:
N , M = (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 , M)
print(len(str(ans)))

Submission status: Accepted

Solution code:
def digits(k, x):
    ans = 0
    while (k):
        ans += 1
        k //= x
    print(ans)

if __name__ == "__main__":
    import sys
    in_str = []
    for line in sys.stdin:
        in_str.append(line)
    k, x = [int(_) for _ in in_str[0].split(' ')]
    digits(k, x)

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

N, K = MI()

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

Submission status: Accepted

Solution code:
N,K=list(map(int,input().split()))
q=N
count=0
while(q>0):
  q,mod=divmod(q,K)
  count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

print(len(cb(x,n)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
ans = Base_10_to_n(n,k)
print(len(ans))

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]


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:
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N, K = [int(x) for x in input().strip().split()]
cnt = 1
c = K
while c <= N:
    c *= K
    cnt += 1

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

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

Submission status: Accepted

Solution code:
N, K = 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(N, K)))

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,p=map(int,input().split())
for i in range(10000):
  if p**i<=n<p**(i+1):
    print(i+1)
    exit()

Submission status: Accepted

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

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

print(len(base10to(n, k)))

Submission status: Accepted

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

def solve():
    for i in range(1, 1000000):
        if n < k ** i:
            return i

print(solve())

Submission status: Accepted

Solution code:
# coding: utf-8
import math

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

lg = math.log(n, k) + 1
print int(lg)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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