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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import fractions
import collections
from collections import deque
import math
import itertools

N,K=map(int,input().split())
tmp=1
t=K
while(N>t):
   t=t*K
   tmp+=1
   
print(tmp)

Submission status: Wrong Answer

Solution code:
import string
numbers = "0123456789"
alphabets = string.ascii_letters # a-z+A-Zをロード
characters = numbers + alphabets
NK=list(map(int,input().split()))
n=NK[0]
k=NK[1]
result = ''
while n>=k:
    idx=n%k
    result=characters[idx]+result
    n=int(n/k)
    idx=n%k
    result=characters[idx]+result
#     return result
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, k = list(map(int,(input().split())))
ans = 1
c  = 0
count = 0
while True:
  count_temp = k**c
  count +=count_temp
#  print(count,count_temp,n)
  if count<= n:
    c +=1
    ans +=1
  else:
    if count_temp >= n:
      ans -=1
    break

print(ans)

Submission status: Wrong Answer

Solution code:
n, k = list(map(int,(input().split())))
ans = 1
c  = 0
count = 0
while True:
  count_temp = k**c
  count +=count_temp
  print(count,count_temp,n)
  if count<= n:
    c +=1
    ans +=1
  else:
    if count_temp >= n:
      ans -=1
    break

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N,K = map(int,input().rstrip().split(" "))
if N > 0:
  print(math.ceil(math.log(N , K)))
else:
  print(1)

Submission status: Wrong Answer

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

def calc(n, k):
  i = 1
  tmp = n
  while (tmp > k):
    print(tmp, i, k**i, tmp - k**1)
    tmp = tmp - k**i
    i +=1
  return i

print(str(calc(n,k)))

Submission status: Wrong Answer

Solution code:
import fractions
import collections
from collections import deque
import math
import itertools

N,K=map(int,input().split())
print(math.ceil(math.log10(N)/(math.log10(2))))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

sum = 0
cnt = 0

while True:
    sum += int(k**cnt)
    if n >= sum:
        cnt += 1
    else:
        cnt += 1
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
[N,K] = list(map(int,input().split()))
if N<=K:
    print(1)
else:
    i=N
    j=0
    while i>K:
        i = i/K
        j=j+1
    print(j+1)

Submission status: Wrong Answer

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

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

print(i)

Submission status: Wrong Answer

Solution code:
import numpy as np
N,K = map(int,input().split())
a = True
b=0

while(a):
    if N<K:
        a=False
    else:
        N=N//K+N%K
        if N==0:
            break
        b+=1
if K==10:
    print(b+1)
else:
    print(b)

Submission status: Wrong Answer

Solution code:
[N,K] = list(map(int,input().split()))
if N<K:
    print(1)
else:
    i=N
    j=0
    while i>K:
        i = i/K
        j=j+1
    print(j+1)

Submission status: Wrong Answer

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

def calc(n, k):
  i = 1
  tmp = n
  while (tmp > k):
    print(tmp, i)
    tmp = tmp - k**i
    i +=1
  return i + 1

print(str(calc(n,k)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

rank = len(str(n))
while n > 0:
  ans = []
  ans.append(n % k)
  n = int(n / k)
  i = rank - len(str(n))
  n = n * 10**i
  k = k * k

print(len(ans))

Submission status: Wrong Answer

Solution code:
import math

N,K = map(int,input().rstrip().split(" "))
if N > 0:
  print(math.ceil(math.log(N + 1 , K)))
else:
  print(1)

Submission status: Wrong Answer

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

d = 1
C = K
while N > C:
    d += 1
    C *= K
print(d)

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
x= 0
for i in range(0,a):
  x = x + b**i
  if x >= a:
    print(i+1)
    break
  else:
    continue

Submission status: Wrong Answer

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

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

print(i)

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

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

print(len(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, p = [int(x) for x in input().split()]
rem = []
while p <= n:
    r = n % p
    if rem == [] and r == 0:
        pass
    else:
        rem.append(r)
    n = n // p
rem.append(n)
print(len(rem))

Submission status: Wrong Answer

Solution code:
def x_base(n, x):
  j = []
  while(1):
    j.append(n % x)
    n //= x
    if(n < x):
      j.append(n)
      break
  return j


n = [int(i) for i in input().split()]
print(len(x_base(n[0], n[1])))

Submission status: Wrong Answer

Solution code:
input = input()

arr = input.split(" ")
N = int(arr[0])
K = int(arr[1])

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

R = Base_10_to_n(11, 2)

print(len(str(R)))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

num = log(N, K)
print(ceil(num))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(num(n, b))

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split());print(sum(n>k**i for i in range(1,100))+1)

Submission status: Wrong Answer

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

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

print(num(n, b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
import math
dec, base = list(map(int, input().split(' ')))
print(math.ceil(math.log(dec,base)))

Submission status: Wrong Answer

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

c=1

for _ in range(0,10**9):
  n=n/k
  if n>=k:
    c+=1
  else:
    break
print(c+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c=1

for _ in range(0,100):
  n=n/k
  if n>=k:
    c+=1
  else:
    break
print(c+1)

Submission status: Wrong Answer

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

def calc(n, k):
    i = 1
    tmp = n
    while(tmp < k):
        tmp = tmp - k**i
        i+= 1
    return i+1

print(str(calc(n,k)))

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
ans = 0
while n: # 一番下の桁を削る
  ans += 1
  n /= k
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
x, y = [int(x) for x in input("").split()]
a = math.log(x,y)
b=x%y
c=x/y
d=math.floor(c)
if(c==0):
    print ("1")
elif(c==d):
    print (math.ceil(a)+1) 
else:
    print (math.ceil(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

#print(a)
#print(b)

a1 = math.ceil(a)
b1 = math.floor(b)

#print(a1)
#print(b1)

if a.is_integer():
    print(int(a))
elif b.is_integer():
    print(int(b))
else:
    print(a1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

i=0
a=[]
if K==10:
    print(len(str(N)))
else:
    while N>=K**i:
        i+=1
    i-=1
    for j in range(i+1):
        a.append(N//(K**(i-j)))
        N%=(K**(i-j))
        
    print(a)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
import pprint
sys.setrecursionlimit(10 ** 9)


INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007



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


if n == 1:
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
strings = input().split(' ')
N = int(strings[0])
K = int(strings[1])
 
ans = 1
max = 1

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

Submission status: Wrong Answer

Solution code:
from math import log, ceil
print(ceil(log(*map(int, input().split())) - 0.001))

Submission status: Wrong Answer

Solution code:
n, r = input().split(" ")
n=int(n)
r=int(r)
if n<10:
    print((100*(10-n))+r)
else:
    print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

#print(a)
#print(b)

a1 = math.ceil(a)
b1 = math.floor(b)

#print(a1)
#print(b1)

if a.is_integer():
    print(b1)
elif b.is_integer():
    print(a1)
else:
    print(a1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
import pprint
sys.setrecursionlimit(10 ** 9)


INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007



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


print(cnt)

Submission status: Wrong Answer

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

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

print(len(ans))

Submission status: Wrong Answer

Solution code:
strings = input().split(' ')
N = int(strings[0])
K = int(strings[1])
 
ans = 0
max = 1

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N,K=map(int,input().split())

temp=1
ans=0
while N>temp:
    temp*=K
    ans+=1

if ans==0 and N!=0:
    print(1)
elif K==10 and N==temp:
    print(ans+1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
nums=[int(i) for i in input().split()]
k=nums[0]
cnt=1
if nums[0]>nums[1]:
    while k>1:
        k=int(k/nums[1])
        cnt+=1
    if nums[0]%nums[1]==0:
        print(cnt-1)
    else:
        print(cnt)
elif nums[0]==nums[1]:
    print(2)
else:
    print(1)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
nums=[int(i) for i in input().split()]
k=nums[0]
cnt=1
if nums[0]>=nums[1]:
    while k>1:
        k=int(k/nums[1])
        cnt+=1
    if nums[0]%nums[1]==0:
        print(cnt-1)
    else:
        print(cnt)
else:
    print(1)

Submission status: Wrong Answer

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

i = 1

while k ** i < n:
  i += 1

print(i)

Submission status: Wrong Answer

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

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

length = 0

while True:
    length += 1

    if N // K < K:
        length += 1
        break
    else:
        N //= K


print(length)

Submission status: Wrong Answer

Solution code:
def Base_10_to_K(N, K):
    if (int(N/K)):
        return Base_10_to_K(int(N/K), K)+str(N%K)
    return str(N%K)

Submission status: Wrong Answer

Solution code:
def main(n, k):
    t = 0
    i = 0

    while n > t:
        t = k ** i
        i += 1

    print(max(i - 1, 0))


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

    main(n, k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

i = 0

while k ** i < n:
  i += 1

print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N,K=map(int,input().split())

temp=1
ans=0
while N>temp:
    temp*=K
    ans+=1

if ans==0 and N!=0:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
#%%time
i = 0
ans = 0
while i <= 10**9:
    if N < K:
        ans = 1
        break
    elif N == K:
        ans = 2
        break
    elif K**i < N:
        i += 1
    else :
        ans = i
        break 
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(math.ceil(math.log(N, K)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

out = []
while 1:
  if N == 0:
    out.append(0)
    break
  else:
    out.append(N%K)
    N = int(N/K)
    if N <= K-1:
      out.append(K-1)
      break
#print(out)
print(len(out))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
x, y = [int(x) for x in input("").split()]
a = math.log(x,y)
b=x%y
c=x/y
if(c==0):
    print ("1")
elif(b==0):
    print (math.ceil(a)+1) 
else:
    print (math.ceil(a))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    n, k = map(int, input().split(" "))
    smaller = True
    index = 0
    while (smaller):
        index+=1
        smaller = n > k ** index
    print(index)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())

res = ''
count = 0
while y**count < x:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
nums=[int(i) for i in input().split()]
k=nums[0]
cnt=1
while k>1:
    k=int(k/nums[1])
    cnt+=1

if nums[0]%nums[1]==0:
    print(cnt-1)
else:
    print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

NK = input().split()
N = int(NK[0])
K = int(NK[1])

if N == 0:
  result = 1
else:
  result = math.ceil(math.log(N, K))

print(result)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

b = a[0]
cnt = 1
if a[0] == a[1]:
    cnt = 2
else:
    while b > a[1]:
        cnt = cnt + 1
        b = b / a[1]

print(cnt)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N,K=map(int,input().split())

temp=1
ans=0
while N>temp:
    temp*=K
    ans+=1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

i=1
x=K

while x < N:
  x *= K
  i += 1

print(i)

Submission status: Wrong Answer

Solution code:
def main():
    s = input().split(" ")
    n = int(s[1])
    c = 1
    if n == 2:
        y = int(s[0])
        c = len(bin(y)) - 2
    elif n == 4:
        y = int(s[0])
        c = (round(len(bin(y)) - 2)) // 2
    elif n == 5:
        y = s[0]
        c = round(len(y) / 2)
    elif n == 8:
        y = int(s[0])
        c = len(oct(y)) - 2
    elif n == 10:
        y = s[0]
        c = len(y)
    else:
        y = int(s[0])
        while y > 1:
            y = int(y / n)
            c += 1
    print(c)

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics
import heapq


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

data = getInputListInt()
n = data[0]
k = data[1]

counter = 0
num = 1

flg = True
while flg:
    counter += 1
    if n > num:
        num *= k
    else:
        flg = False

print(counter)

Submission status: Wrong Answer

Solution code:
import math
x, y = [int(x) for x in input("").split()]
a = math.log(x,y)
b=x%y
if(b==0):
    print (math.ceil(a)+1) 
else:
    print (math.ceil(a))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
for i in range(10**9):
    n /= k
    if k > n:
        print(i+2)
        break

Submission status: Wrong Answer

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

out = []
while 1:
  out.append(N%K)
  #print(N)
  N = int(N/K)
  if N <= K-1:
    out.append(K-1)
    break
print(len(out))

Submission status: Wrong Answer

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

while 1:
    digit.append(N%K)
    N = N//K
    if N < K:
        digit.append(N)
        break

print(len(digit))

Submission status: Wrong Answer

Solution code:
def main():
    s = input().split(" ")
    n = int(s[1])
    c = 1
    if n == 1:
        c = y
    elif n == 2:
        y = int(s[0])
        c = len(bin(y)) - 2
    elif n == 4:
        y = int(s[0])
        c = (round(bin(y)) - 2) // 2
    elif n == 5:
        y = s[0]
        c = round(len(y) / 2)
    elif n == 8:
        y = int(s[0])
        c = len(oct(y)) - 2
    else:
        y = int(s[0])
        while y > 1:
            y = int(y / n)
            c += 1
    print(c)

main()

Submission status: Wrong Answer

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

e = 0
for i in range (1000):
    if (n / (k ** (i+1))) > 1:
        e = e + 1
    else:
        e = e

f = e + 1

print (f)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

NK = input().split()
N = int(NK[0])
K = int(NK[1])

result = math.ceil(math.log(N, K))

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
list = list(map(int, input().split()))
original = list[0]
n = list[1]
x = 0
ans = 0

if original//n != 0:
  x = original//n
  ans += 2
  while x//n != 0:
    x = x // n
    ans += 1
  print(ans)
else:
  print(0)

Submission status: Wrong Answer

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

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

for i in range(35, 0, -1):
    if n >= k**i:
        result = i+1
        break
print(result)

Submission status: Wrong Answer

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

for i in range(n):
    t = k ** i
    if n > t:
        ans += 1
        if n % t == 0:
            ans += 1
    else:
        break
print(ans + 0)

Submission status: Wrong Answer

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

for i in range(31):
    if n // (k**(31-i)) > 0:
        print(31-i+1)
        break

Submission status: Wrong Answer

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

sum = 0
cnt = 0

while True:
    sum += int(k**cnt)
    if sum <= n:
        cnt += 1
    else:
        break
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
#%%time
i = 0
ans = 0
while i <= 10**9:
    if N == 1:
        ans = 1
        break
    elif K==10&N==10:
        ans = 2
        break
    elif N <= K:
        ans = 1
        break
    elif K**i < N:
        i += 1
    else :
        ans = i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import math
a = list(map(int, input().split()))
print(math.ceil(math.log(a[0],a[1])))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (n, k) = [int(e) for e in lines[0].split(" ")]

    return (n, k)


def solve(n, k):

    result = math.ceil(math.log(n, k))
    return result
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Wrong Answer

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

c=1

for _ in range(0,100):
  n=n/k
  if n>k:
    c+=1
  else:
    break
print(c+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

e = 1
for i in range (10000):
    if (n / (k ** (i+1))) > 1:
        e = e + 1
    else:
        e = e

print (e)

Submission status: Wrong Answer

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

res = 1
while True:
    res += 1
    n = n // k 
    if n < k:
        break

print(res)

Submission status: Wrong Answer

Solution code:
import math

N,K = map(int,input().rstrip().split(" "))
if N > 0:
  print(math.ceil(math.log(N+1,K)))
else:
  print(1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
quotient=N
cnt=1
while quotient>=K:
    remainder=quotient%K
    quotient=(quotient-remainder)/K
    print(int(remainder),int(quotient))
    cnt+=1
print(cnt)

Submission status: Wrong Answer

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

e = 1
for i in range (100):
    if (n / (k ** (i+1))) > 1:
        e = e + 1
    else:
        e = e

print (e)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# import numpy as np
N, K = list(map(int, input().split(' ')))
# print(int(np.ceil(np.log(N) / np.log(K))))
count = 1
com_val = K
while com_val < N:
    count += 1
    com_val = pow(K, count)
print(count)

Submission status: Wrong Answer

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

for i in range(n):
    t = k ** i
    if n > t:
        ans += 1
    else:
        break

print(ans + 0)

Submission status: Wrong Answer

Solution code:
list = list(map(int, input().split()))
original = list[0]
n = list[1]

x = original//n
ans = 1

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

Submission status: Wrong Answer

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

keta = 0
for i in range(10**9):
    ki = k**i
    if ki >= n:
        print(keta)
        break
    else:
        keta += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

b = a[0]
cnt = 1
while b > a[1]:
    cnt = cnt + 1
    b = b / a[1]

print(cnt)