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:
#!/usr/bin/env python3
import sys


def solve(N: int, K: int):
    ans=[N%K]
    p=[]
    a=N//K
    b=N%K

    while True:
        a=a//K
        ans.append(a%K)
        if a==0:
            break
    print(len(ans))
    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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i = list(map(int, input().split()))
N=i[0]
K=i[1]
def abc(N,K,x):
    if N-(K**x)>0:
      abc(N,K,x+1)
    else:
        print(x)
abc(N,K,1)

Submission status: Wrong Answer

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

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

print(ans + 0)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

sum = 0
cnt = 0

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

Submission status: Wrong Answer

Solution code:
n,k = (int(x) for x in input().split())
l = 1
m = k
while n > k:
   k = k * m 
   l = l+1
   
print(l)

Submission status: Wrong Answer

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

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

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]


# nがｍで何回割れるかを計算する
def GetKeta(n, m):
    counter = 0
    
    if n < m:
        counter = 1
        return counter
    
    flg = True
    while flg:
        if n < m:
            flg = False
        else:
            n = n % m
            counter += 1
    return counter


counter = 0
num = 1

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

print(counter)

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

Solution code:
a = input().split()

n = int(a[0])
k = int(a[1])
c = []

while True:
    c.append(n % k)
    n = n//k
    
    if(n<k):
      break
    else:
      continue
c.append(n % k)
print(len(c))

Submission status: Wrong Answer

Solution code:
n, p = [int(x) for x in input().split()]
count = 1
while p < n:
    n = n/p
    count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N, K = map(int, input().split())
P = math.log(N, K)
Q = math.floor(P)

print(Q)

Submission status: Wrong Answer

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

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

if b != 0:
    cnt = cnt + 1

print(cnt)

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

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**i < N:
        i += 1
    else :
        ans = i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
NK = input().split()

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

ans = 1
while True:
    if N > K**ans:
        ans += 1
    else:
        break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

if float.is_integer(math.log(n, k)):
    print(math.ceil(math.log(n, k))-1)
else:
    print(math.ceil(math.log(n, k)))

Submission status: Wrong Answer

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

count = 1
while True:
    if n / k >= 1:
        n  = int(n / k)
        print(n)
        count += 1
    else:
        break

print(count)

Submission status: Wrong Answer

Solution code:
n,k = (int(x) for x in input().split())
l = 1
m = k
while n > k:
   k = k * m
   l = l+1
   
print(l)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N,K = map(int,input().split())
a = True
b=0
if N<K:
    print(1)
elif K==10:
    while(a):
        if N//K==0:
            a=False
        else:
            N=N//K+N%K
            b+=1
    print(b+1)
else:
    while(a):
        if N//K==0:
            a=False
        else:
            N=N//K+N%K
            b+=1
    print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
[N,K] = list(map(int,input().split()))
shou= N // K
amari=[]
while shou<K:
    shou = shou // K
    ama=shou % K
    amari.append(ama)
    

print(len(amari)+2)

Submission status: Wrong Answer

Solution code:
from sys import stdin

def rec(n, k, r):
  if n < k:
    return r
  else:
    q, mod = divmod(n, k)
    r += str(mod)
    n = q
    return rec(n, k, r)

def main():
  N, K = [int(x) for x in stdin.read().rstrip().split()]
  print(rec(N, K, ''))

Submission status: Wrong Answer

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

ans = ""

num = n
while(num > 0):
    ans += str(num % k)
    num //= k
    print(ans)

print(len(ans))

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
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())
c=0
while k**c<n:
  c+=1
print(c)

Submission status: Wrong Answer

Solution code:
NK = input().split()

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:

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

c =0
while n>(k-1):
    a = n%k
    n = (n-a)/k
    print(n)
    c += 1
print(c+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    s = input().split(" ")
    y = int(s[0])
    n = int(s[1])
    c = 1
    while y > 1:
        y = int(y / n)
        c += 1
    print(c)

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
import numpy as np

# A = input()
# A = int(input())
# A = map(int, input().split())
# A = list(map(int, input().split()))
# A = [int(input()) for i in range(N)]
#
# c = collections.Counter()

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

log_ = int(math.log(N, K))
N - log_
if N == K**log_:
    print(log_)
else:
    print(log_+1)


print()

Submission status: Wrong Answer

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

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

x10 = X 
x2 = Base_10_to_n(x10, 2)
print(len(x2))

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

Submission status: Wrong Answer

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

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

dec, base = list(map(int, input().split(' ')))

print(math.ceil(math.log(dec,base)))

Submission status: Wrong Answer

Solution code:
import sys
N,K = map(int,input().split())
K0 = K
if N < K:
    print(0)
    sys.exit()
count = 1
while N>=K:
    K=K*K0
    count += 1

print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
N,K = map(int, input().split())
print(int(round(math.log(N, K),0)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

S, T=map(int, input().split())

ans=math.ceil(math.log(S, T))
print(ans)

Submission status: Wrong Answer

Solution code:
l=input().split()
N=int(l[0])
K=int(l[1])
cnt=0
a=N

while True:
  a=a/K
  cnt+=1
  if a==0:break

print(a)

Submission status: Wrong Answer

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

digit = 1
while True:
    n = n / k
    if n >= k:
        digit += 1
    else:
        digit += 1
        print(digit)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = input().split()
N = int(x[0])
K = int(x[1])

if N ==1:
    print(1)
else:
    d = 0
    while K ** d < N:
        d +=1

    print(d)

Submission status: Wrong Answer

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

num = 0
beki = 0

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

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

count = 0
while N > K:
    M = N%K
    N = N//K
    if N >= K:
        count += 1

print(count + 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools

mod = int(1e9+7)
INF = 1<<29

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

if __name__=='__main__':
    main()

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

if(N==1):
    print(1)
    exit()

while(K**tmp<=N):
    tmp+=1
if(K**(tmp-1)==N):
    print(tmp-1)
else:
    print(tmp)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

def main():
    n,k = map(int,input().split())
    temp = math.log(n,k)
    print(math.ceil(temp))





if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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


print(n)

Submission status: Wrong Answer

Solution code:
n, k = [int(i) for i in input().split()]
def decNbin(t, n):
  a = []
  while t!= 0:
    a.append(t % n)
    t  = t // n
  a.reverse()
  return a
"".join(map(str, decNbin(n, k)))

Submission status: Wrong Answer

Solution code:
import  math
N, K = map(int, input().split())
t = 1
x = N
n = 0
while (True):
    n += 1
    x -= t * (K - 1)
    if x < 0:
        break

    t *= K


print(n)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

line=list(map(int,input().split()))
a=line[0]
b=line[1]

n=math.log(a,b)
print(math.ceil(n))

Submission status: Wrong Answer

Solution code:
from sys import stdin


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


def get_result(data):
    print(data)
    N, K = data[0]
    return len(Base_10_to_n(N, K))

if __name__ == '__main__':
    raw_data = [val.rstrip('\n') for val in stdin.readlines()]
    data = [list(map(int, val.split(' '))) for val in raw_data]
    result = get_result(data)
    print(result)

Submission status: Wrong Answer

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

num = 0
beki = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC156 B

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

for i in range(1, 10000000000000):
    if k**i >= n:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while a <n:
    a *= k
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import itertools
N,K = map(int,input().split())
for i in itertools.count(1):
  if N//(K**i)<K:
    print(i+1)
    break

Submission status: Wrong Answer

Solution code:
import math
import numpy as np

a, b = map(int,input().split())
c = 0
c= math.ceil(np.log(a)/np.log(b))
if np.log(a)/np.log(b) % 1 ==0:
  c = c -1
else:
  c = c
print(c)

Submission status: Wrong Answer

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

digit = 1
# 11 2
while True:
    n = n / k
    if n > k:
        digit += 1
    else:
        digit += 1
        print(digit)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

keta = 1
sum = 0
while True:
    max = k**keta-1
    if max > n:
        print(keta)
        break
    keta += 1

Submission status: Wrong Answer

Solution code:
import math
#n,r=list(map(int,input().split()))
n=10**9
r=2
for i in range(40,-1,-1):
    if r**i<=n:
        ans=i+1
        break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N, R = map(int, input().split())
X = math.log(N + 1, R)
Y = math.ceil(X)

print(Y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input().split()
for i in range(len(a)):
    a[i] = int(a[i])

ind = 0
while a[0] > 0:
    a[0] = a[0] // a[i]
    ind +=1

print(ind - 1)

Submission status: Wrong Answer

Solution code:
n,k = map(int, input().split())
ans = 0
c = 0
while n > k**c:
    c += 1
a = k-1
for i in range(1,c+1):
    for j in range(1,k+1):
        if (k-j)*k**(c-i)<=n:
            n -= (k-j)*k**(c-i)
            ans += (k-j)*10**(c-i)
            break
print(len(str(ans)))

Submission status: Wrong Answer

Solution code:
import sys
N,K = map(int,input().split())
if N < K:
    print(0)
    sys.exit()
count = 1
while N>=K:
    K=K*K
    count += 1

print(count)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC156 B

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

for i in range(1, 100000000):
    if k**i >= n:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = ""

while True:
  r = str(N % K)
  ans += r
  N = N // K
  if N < K:
    ans += str(N % K)
    ans = ans[::-1]
    if ans[0] == "0":
      ans = ans[1:]
      break
  
print(len(ans))

Submission status: Wrong Answer

Solution code:
i = list(map(int, input().split()))
j=1
while i[0]<i[1]**j:
  j+=1
print(j)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
x = n
ans = 1
for i in range(n):
    ans += 1
    x = x // k
    if x < k:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
from math import log, ceil


def main():
    N, K = map(int, input().split())
    answer = log(N, K)
    if isinstance(answer, int):
        print(int(answer) + 1)
    else:
        print(ceil(answer))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

ans = ""

while True:
  r = str(N % K)
  ans += r
  N = N // K
  if N < K:
    ans += str(N % K)
    break
  
print(len(ans))

Submission status: Wrong Answer

Solution code:
import numpy as np
n,k= map(int,input().split())
dig = int(np.ceil(np.log(n)/np.log(k)))
print(dig)

Submission status: Wrong Answer

Solution code:
import itertools
N,K = map(int,input().split())
for i in itertools.count(1):
  if N//(K**i)<K:
    print(i)
    break

Submission status: Wrong Answer

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

flag = True
ans = 1

while flag:
  if d ** ans >= c:
    flag = False
    break
  else:
    ans += 1
    
print(str(ans))

Submission status: Wrong Answer

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

for i in range(100):
  if K ** i >= N:
    Ans = i
    break

print(Ans)

Submission status: Wrong Answer

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

if k == 10:
    print(len(str(n)))
else:
    for i in range(1,n):
        if n < k**i:
            print(i)
            exit()

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)

N, K = map(int, input().split())
if K!=10:
  N = Base_10_to_n(N, K)
print( N )

Submission status: Wrong Answer

Solution code:
def main():
    N,K=map(int,open(0).read().split())
    keta=1
    flag=0
    while flag==0:
        if K**keta<=N and K**(keta+1)>=N:
            flag=1
        keta= keta+1
        #print(keta)

    print(keta)
main()

Submission status: Wrong Answer

Solution code:
import math
n,r=list(map(int,input().split()))
for i in range(10,-1,-1):
    if r**i<=n:
        ans=i+1
        break
print(ans)

Submission status: Wrong Answer

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
c=b
i=1
while a>c:
    c=c*b
    i+=1
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

import itertools
import sys
import math
import numpy as np
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)


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




if __name__ == "__main__":
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

total = 0

while True:
    v, m = divmod(N, K)
    total += 1
    if v < K:
        total += 1
        break
    else:
        N = v

print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import numpy as np

a, b = map(int,input().split())
c = 0
c= math.ceil(np.log(a)/np.log(b))
print(c)

Submission status: Wrong Answer

Solution code:
import sys
[N,K] = [int(s) for s in sys.stdin.read().split()] #リスト作成
a = 0
l = 1
while l != 0:
  if N == 1:
    a += 1
    l = 0
  elif N > K**a:
    a += 1
  else:
    l = 0
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n,k= map(float,input().split())
dig = int(np.ceil(np.log(n)/np.log(k)))
if k**(dig-1) == n:
    dig = dig - 1
print(dig)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

print(math.ceil(math.log(n)/math.log(k)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
count=0
if k == 10:
    print(len(str(n)))
else:
    while True:
        count+=1
        x = n//k
        y = n%k
        n = x+y
        if n < k:
            break
    print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input().split()

n = int(s[0])
k = int(s[1])
cnt = 1

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

print(cnt)

Submission status: Wrong Answer

Solution code:
#ABC156 B - Digits

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

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

Submission status: Wrong Answer

Solution code:
import math
N,K=map(int,input().split())
x=math.log(N,K)
if x.is_integer():
    print(int(x))
else:
    print(int(x)+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
while(K**tmp<=N):
    tmp+=1
if(K**(tmp-1)==N):
    print(tmp-1)
else:
    print(tmp)

Submission status: Wrong Answer

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

keta = 1
sum = 0
while True:
    sum += k**(keta-1)*(k-1)
    if sum > n:
        print(keta)
        break
    keta += 1

Submission status: Wrong Answer

Solution code:
import math

[N, K] = map(int, raw_input().split())

d = int(math.ceil(math.log(N+1)/math.log(K)))

print d

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
x=1
y=0
while x<n:
  x*=k
  y+=1
x/=k
y-=1
m=n%x
if m==0:
  print(y)
else:
  print(y+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
import math

N, K = map(float, raw_input().split())

log_K = np.log(N)/np.log(K)

print int(math.ceil(log_K))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(a)

Submission status: Wrong Answer

Solution code:

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

if k == 10:
    print(len(str(n)))
else:
    for i in range(n):
        if n < k**i:
            print(i)
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

i = 0
l = k ** i

if n <= k:
    print(1)
    exit(0)

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

Submission status: Wrong Answer

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

n, k = map(int, input().split())
result = math.log(n, k)
print(math.ceil(result))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(i)

Submission status: Wrong Answer

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

    print(cnt)

if __name__ == "__main__":
    resolve()