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:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

    ans = []
    while N > 0:
        ans.append(N % K)
        N = N // K
    print(len(ans))


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

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


def calc(n, k):
    r = ""
    while n > 0:
        n, remainder = divmod(n, k)
        r += str(remainder)
    return r[::-1]


print(len(calc(n, k)))

Submission status: Accepted

Solution code:
import math
x, b = list(map(lambda n: int(n), input().split(" ")))
print(math.floor(math.log(x, b)) + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import product, combinations,permutations
from copy import deepcopy
import sys
sys.setrecursionlimit(4100000)



if __name__ == '__main__':
    N, K = map(int, input().split())
    cnt = 0
    while N!=0:
        N //= K
        cnt += 1
    print(cnt)

Submission status: Accepted

Solution code:
MM = input().split()
N = int(MM[0])
K = int(MM[1])
for i in range(1000000000000):
  if K**i > N:
    print(i)
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, k = list(map(int, input().split()))
ans = ''
while n > 0:
    ans = str(n % k) + ans
    n //= k
print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#template
def inputlist(): return [int(j) for j in input().split()]
def listinput(): return input().split()
#template
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)
N,K = inputlist()
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)
x2 = Base_10_to_n(N,K)
print(len(x2))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,k = inpm()
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>0:
    ans+=1
    N=N//K

print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

count=1
quo=n//k

while quo>0:
    quo=quo//k
    count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, K: int):
    return int(math.log(N, K))+1


def main():

    sys.setrecursionlimit(10 ** 6)

    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
    print(f'{solve(N, K)}')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

while a != 0:
  a = a//n
  ans += 1
  
print(ans)

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
# abc156_b.py
# https://atcoder.jp/contests/abc156/tasks/abc156_b

# B - Digits /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 整数 Nを K進数で表したとき、何桁になるかを求めてください。

# 注記
# K進表記については、Wikipedia「位取り記数法」を参照してください。

# 制約
#     入力は全て整数である。
#     1≤N≤109
#     2≤K≤10

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N K

# 出力
# 整数 Nを K進数で表したとき、何桁になるかを出力せよ。

# 入力例 1
# 11 2

# 出力例 1
# 4

# 11を 2進数で表記すると 1011 です。

# 入力例 2
# 1010101 10

# 出力例 2
# 7

# 入力例 3
# 314159265 3

# 出力例 3
# 18


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    N, K = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    if K**0 <= N < K**1:
        result = 1
    elif K**1 <= N < K**2:
        result = 2
    elif K**2 <= N < K**3:
        result = 3

    result = 1
    n = N
    while True:
        if n < K:
            return [result]
        else:
            n = n / K
            result += 1


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['11 2']
        lines_export = [4]
    if pattern == 2:
        lines_input = ['1010101 10']
        lines_export = [7]
    if pattern == 3:
        lines_input = ['1314159265 3']
        lines_export = [18]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def digits():
    # 入力
    N, K = map(int, input().split())
    # 処理
    count = 1
    while True:
        if N < K:
            return count
        else:
            N = N // K
            count += 1
            
result = digits()
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys


def main():
    input = sys.stdin.buffer.readline
    n, k = map(int, input().split())
    i = 1
    while k ** i <= n:
        i += 1
    print(i)


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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N, K = MI()

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

print(cnt)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
count = 1
while n >= k:
    n, _ = divmod(n, k)
    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:
#Good question
import sys
N,K = map(int,input().split())

if not ( 1 <= N <= 10**9 and 2 <= K <= 10 ): sys.exit()

count = 0
a = N
while a >= K:
    a = a // K
    count += 1
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:
from math import log, floor

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

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

Submission status: Accepted

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

if not ( 1 <= N <= 10**9 and 2 <= K <= 10 ): sys.exit()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def check(n,k):
  r=[]
  while n>0:
    r.append(n%k)
    n//=k
  return len(r)
n,k=map(int,input().split())
print(check(n,k))

Submission status: Accepted

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


keta = 1

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

print(keta)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
res = 1
for i in range(100):
  if b**i > a:
    res = i
    break
print(res)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

def main():
    converted = Base_10_to_n(N,K)
    print(len(converted))

main()

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

a,b =I()
for i in range(1,101):
    if b**i > a:
        print(i)
        sys.exit()

Submission status: Accepted

Solution code:
import math
N, K = [int(i) for i in input().split()]
print(math.floor(math.log(N, K)) + 1)

Submission status: Accepted

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


def II():
    return int(sys.stdin.readline())


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


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    N, K = MI()

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

D = 1
while True:
    if N//K >0:
        D += 1
        N = N//K
    else:
        break

print(D)

Submission status: Accepted

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

for i in range(31):
  if n < k ** i:
    print(i)
    break

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
r = 1
while not(K**(r-1) <= N and N < K ** r):
  r += 1
print(r)

Submission status: Accepted

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

Submission status: Accepted

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


def base(value, n):  # 10 => 2
    result = ''
    tmp = int(value)
    while tmp >= n:
        result = str(tmp % n) + result
        tmp = int(tmp / n)
    result = str(tmp % n) + result
    return result


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

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

Submission status: Accepted

Solution code:

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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())
q, r = divmod(N, K)
ans = 1
while q > 0:
    q, r = divmod(q, K)
    ans += 1
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
#156_B ans
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())
nbase = ''
tmp = n
while tmp > 0:
    nbase += str(tmp % k)
    tmp = int(tmp / k)

print(len(nbase))

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

def change(N,shinsu):
    keta=0
    for i in range(10**9):
        if N<shinsu**i:
             keta+=i
             break
    ans=[0]*keta
    check=0
    for i in range(1,keta+1):
        j=N//(shinsu**(keta-i))
        ans[check]=j
        check+=1
        N-=(j)*(shinsu**(keta-i))
    return ans

print(len(change(N,K)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

if __name__ == '__main__':

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

	cnt = 1
	while True:
		if n % k == 0:
			n = n // k
		else:
			n = n - n % k
			n = n // k
		if n // k < k:
			if n // k == 0:
				if n % k == 0:
					pass
				else:
					cnt += 1
			else:
				cnt += 2
			break
		cnt += 1
			
	print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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


for i in range(0,41):
    if n % k ** i != n:
        x += 1
    else:
        x = x
print(x)

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

while n // k ** d >= 1:
  d += 1

print(d)

Submission status: Accepted

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

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

Submission status: Accepted

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

Sum = 0

while True:
    Sum += 1

    if K ** Sum > N:
        break

print(Sum)

Submission status: Accepted

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

Submission status: Accepted

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

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:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

cnt = 0
while 0 < n:
    n //= k
    cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def pn(x, n):
	if x // n: return pn(x // n, n) + str(x % n)
	return str(x % n)
n, k = map(int, input().split())
print(len(pn(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)

rslt = base_10_to_n(n, k)

print(len(rslt))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
ans=""
while n>0:
  ans+=str(n%k)
  n//=k
print(len(ans[::-1]))

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
ans=0
for i in range(100000000):
    if n>=1:
        n=n/k
        ans+=1
    else:
        print(ans)
        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 = map(int, input().split())
x10 = n
x2 = Base_10_to_n(x10, k)
ans = str(x2)
print(len(ans))

Submission status: Accepted

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

l = []

while N > 0:
    l.insert(0, N % K)
    N = N // K

print(len(l))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
N,K=map(int,input().split())
result=0
for i in range(10**9):
  if (N<K**i):
    result+=i
    break
print(result)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
for i in range(10**5):
    if n == 1:
        ans = 1
    elif k**(i-1) <= n < k**i:
        continue
    elif k**(i-1) > n:
        ans = i-1
        break
print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
if n < k:
    print(1)
    exit()
v = []
while True:
    x = n % k
    n //= k
    v.append(x)
    if n < k:
        v.append(n)
        break
print(len(v))

Submission status: Accepted

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

Submission status: Accepted

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

for n in range(10**10):
    if N < K**n:
        print(n)
        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())
x = 0
 
while n > 0:
    n //= k
    x += 1
print(x)

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
result=''
while n>=1:
    b=n%k
    result+=str(b)
    n//=k
print(len(result))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

r=[]
i=0
a=0
while n>0:
  i=n%k
  n=n-i
  n=n//k
  r.append(i)
  a=a+1
  

print(a)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
l = []
while N // K != 0:
  l.insert(-1, N % K)
  N = N // K
l.append(N)
print(len(l))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]

class unionfind:
    def __init__(self, n):
        self.parent = [i for i in range(n)]
        self.size = [1 for i in range(n)]
    def find(self,a):
        if a == self.parent[a]: return a
        else: self.parent[a] = find(self,self.parent[a]); return self.parent[a]
    def unite(self,a,b):
        pa,pb = self.find(self,a), self.find(self,b)
        if pa == pb: return
        else: self.parent[pb] = pa; self.size[pa] += self.size[pb]
    def same(self,a,b): return find(self,a) == find(self,b)

n,k = imap()
for i in range(31):
    if k**i > n: ans = i; break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N, K = map(int, input().split())
if N <= K:
    N = str(N)
    print(len(N))
else:
    print(math.ceil(math.log(N, K)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy

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

Submission status: Accepted

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