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:
from math import log, ceil

N, K = map(int, input().split())
print(ceil(log(N, K)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

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

Submission status: Wrong Answer

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

for i in range(0, len(n)):
  num += int(n[i]) * (len(n)-i) * k^(len(n)-i)
  
print(len(str(num)))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

n,k = map(int, input().split())
cnt = 1
a = k
while k < n:
  k = k*a
  cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
import numpy as np
def cumsum(x):
    return list(np.cumsum(x))

def cumsum_number(N,K,x):
    ans=[0]*(N-K+1)
    number_cumsum = cumsum(x)
    number_cumsum.insert(0,0)
    for i in range(N-K+1):
        ans[i]=number_cumsum[i+K]-number_cumsum[i]
    return ans
"""
int #整数
float #小数

#for
for name in fruits: #fruitの頭から操作
    print(name)

#リスト
list0 = [] #リスト生成
list0 = [1,2,3,4] #初期化
list0 = [0]*10 #[0,0,0,0,0,0,0,0,0,0]
list1= [i for i in range(10)] #>>> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
list1 = list(map(int, input().split()))　# 複数の入力をリストに入れる
number=[int(input()) for i in range(int(input()))] #複数行の入力をリストに
list1 = list1 + [6, 7, 8] #リストの追加
list2.append(34) #リストの追加　最後に（）内が足される
list.insert(3,10) #リストの追加　任意の位置（追加したい位置,追加したい値）
len(list4) #リストの要素数
max(sa) #list saの最小値
list5.count(2) #リスト(文字列も可）内の2の数
list1.sort() #並び替え小さい順
list1.sort(reverse=True)  #並び替え大きい順
set(list1) #list1内の重複している要素を削除し、小さい順に並べる
sum([2,3,   ,3]) #リストの合計

abs(a) #aの絶対値
max(a,b) min(a,b) #最大値　最小値
text1 = text1.replace("34","test") #text1内の"34"を"test"に書き換える(文字列内の文字を入れ替える)

exit(0) #強制終了

cumsum(リスト) #累積和をリストで返す
cumsum_number(N,K,x) #N個の数が含まれるリストx内のK個からなる部分和をリストで返す
"""
N,K=map(int,input().split())
for i in range(28):
    if K**i<=N<K**(i+1):
        print(i+1)

Submission status: Wrong Answer

Solution code:
import numpy as np
def cumsum(x):
    return list(np.cumsum(x))

def cumsum_number(N,K,x):
    ans=[0]*(N-K+1)
    number_cumsum = cumsum(x)
    number_cumsum.insert(0,0)
    for i in range(N-K+1):
        ans[i]=number_cumsum[i+K]-number_cumsum[i]
    return ans
"""
int #整数
float #小数

#for
for name in fruits: #fruitの頭から操作
    print(name)

#リスト
list0 = [] #リスト生成
list0 = [1,2,3,4] #初期化
list0 = [0]*10 #[0,0,0,0,0,0,0,0,0,0]
list1= [i for i in range(10)] #>>> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
list1 = list(map(int, input().split()))　# 複数の入力をリストに入れる
number=[int(input()) for i in range(int(input()))] #複数行の入力をリストに
list1 = list1 + [6, 7, 8] #リストの追加
list2.append(34) #リストの追加　最後に（）内が足される
list.insert(3,10) #リストの追加　任意の位置（追加したい位置,追加したい値）
len(list4) #リストの要素数
max(sa) #list saの最小値
list5.count(2) #リスト(文字列も可）内の2の数
list1.sort() #並び替え小さい順
list1.sort(reverse=True)  #並び替え大きい順
set(list1) #list1内の重複している要素を削除し、小さい順に並べる
sum([2,3,   ,3]) #リストの合計

abs(a) #aの絶対値
max(a,b) min(a,b) #最大値　最小値
text1 = text1.replace("34","test") #text1内の"34"を"test"に書き換える(文字列内の文字を入れ替える)

exit(0) #強制終了

cumsum(リスト) #累積和をリストで返す
cumsum_number(N,K,x) #N個の数が含まれるリストx内のK個からなる部分和をリストで返す
"""
N,K=map(int,input().split())
for i in range(27):
    if K**i<=N<K**(i+1):
        print(i+1)
        exit(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

M = 0
i = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
if n == k:
    print(2)
else:
    a = True
    cnt = 1
    while(a):
        n = n//k
        cnt += 1
        if k > n:
            a = False
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
a = []
while n//k != 0:
  a.append(n%k)
  n = n//k
  
  if n//k ==0:
    a.append(n%k)
a.reverse()
print(len(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
a = []
while n//k != 0:
  a.append(n%k)
  n = n//k
  
  if n//k ==0:
    a.append(n%k)
    a.reverse()
len(a)

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
a = []
while n//k != 0:
  a.append(n%k)
  n = n//k
  
  if n//k ==0:
    a.append(n%k)
len(a)

Submission status: Wrong Answer

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

i = 0
d = 1
while True:
    if d >= n:
        break
    i += 1
    d *= k

print(i)

Submission status: Wrong Answer

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

N = int(math.floor(math.log(n)/math.log(k)))+1
m = n
L = []
for i in range(N+1):
  L.append(m//(k**(N-i)))
  m = m%(k**(N-i))
  
if L[0] == 0:
  L.pop(0)

ANS = [str(L[i]) for i in range(len(L))]
print("".join(ANS))

Submission status: Wrong Answer

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

N = int(math.floor(math.log(n)/math.log(k)))+1
m = n
L = []
for i in range(N+1):
  L.append(m//(2**(N-i)))
  m = m%(2**(N-i))
  
if L[0] == 0:
  L.pop(0)

ANS = [str(L[i]) for i in range(len(L))]
print("".join(ANS))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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



if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

L = []
while True:
  N = int(math.floor(math.log(n)/math.log(k)))
  L.append(N)
  n = n - k**N
  if n <= k-1:
    print(len(L)+1)
    exit()

Submission status: Wrong Answer

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

L = []
while True:
  N = int(math.floor(math.log(n)/math.log(k)))
  L.append(N)
  n = n - k**N
  if n <= 2:
    print(len(L)+1)
    exit()

Submission status: Wrong Answer

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

L = []
while True:
  N = int(math.floor(math.log(n)/math.log(k)))
  L.append(N)
  n = n - 3**N
  if n <= 2:
    print(len(L)+1)
    exit()

Submission status: Wrong Answer

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

if K == 10:
    print(len(str(N)))
    exit()
cnt = 1
while True:
    if N / (K ** cnt) <= 1:
        print(cnt)
        exit()
    cnt += 1

Submission status: Wrong Answer

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

cnt = 1
while True:
    if N / (K ** cnt) <= 1:
        print(cnt)
        exit()
    cnt += 1

Submission status: Wrong Answer

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

print(len(transform(N, K)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(c)

Submission status: Wrong Answer

Solution code:
n,k=list(map(int,input().split()))
import sys
ans=1
import copy
num=copy.deepcopy(k)

while(1):
  if num>=n:
    print(ans)
    sys.exit()
  num=num*k
  ans=ans+1

Submission status: Wrong Answer

Solution code:
n,k=list(map(int,input().split()))
import sys
ans=1
num=1
while(1):
  if num>=n:
    print(ans-1)
    sys.exit()
  num=num*k
  ans=ans+1

Submission status: Wrong Answer

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

count = 0
while(True):
    if n > k ** count:
        count += 1
    else:
        break

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
n, m = map(int, open(0).read().split())
for i in range(n):
    if n // (m**i) == 0:
        print(i)
        quit()

Submission status: Wrong Answer

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


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

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

    print(keta + 1)


if __name__ == '__main__':
    solve()

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

if n==k:
  print(2)
else:
  print(math.ceil(math.log(n,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:
i=0
N,L=map(int,input().split())
while True:
  if N<=L**i:
    print(i)
    break
  i=i+1

Submission status: Wrong Answer

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

exp = 1
while pow(k, exp) < n:
    exp += 1
print(exp)

Submission status: Wrong Answer

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

exp = 0
while pow(k, exp) < n:
    exp += 1
print(exp)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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


for i in range(1,N):
    if N > K**i:
        continue
    else:
        print(i)
        exit()
print(1)

Submission status: Wrong Answer

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

count = 0
for i in range(N):
    if N > K**i:
        continue
    else:
        print(i)
        exit()

Submission status: Wrong Answer

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

ans = []

while n // k >= k:
  n = n // k
  ans.append(1)
  
print(sum(ans) + 2)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
count,rank = 1,b
while a > rank:
  count += 1
  rank *= b
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
count,rank = 1,3
while a < rank:
  count += 1
  rank *= 3
print(count)

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

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

ans = 0
n = N
while n:
    ans += 1
    n //= 2

print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n, k = map(int, input().split())
ans = 1
while n > k:
    n = n // k
    ans = 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:
N, K = map(int,input().split())

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

print(counter)

Submission status: Wrong Answer

Solution code:
import math

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

ans = math.ceil(math.log(n+1)/math.log(k))

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

Solution code:
import sys

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

n, k = ISI()
i = 0
val=1
while(val<n):
	val*=k
	i+=1
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while True:
    if N <= K ** digit:
        break
    digit += 1
    
print(digit)

Submission status: Wrong Answer

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

ans = 0
for i in range(30):
    if k ** i > n:
        ans = i
        break
if ans == 0:
    ans = 1
    
print(ans)

Submission status: Wrong Answer

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

ans = 0
for i in range(30):
    if k ** i >= n:
        ans = i
        break

print(ans)

Submission status: Wrong Answer

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

ans = 0
for i in range(30):
    if k ** i > n:
        ans = i
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
l = []
for i in range(1,n):
  if n > 0:
    n = n // k
    l.append(n)
  else:
    break
print(len(l))

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
l = []
a = 0
for i in range(1,n):
  if n > 0:
    a = (n) % (k**i)
    n = n - a
    l.append(a)
  else:
    break
print(len(l))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def comb(n, r):
    if n - r < r:
        r = n - r
    res = 1
    for i in range(r):
        res *= (n - i) % mod
        res %= mod
        res *= pow(r - i, mod - 2, mod)
        res %= mod
    return res


n, k = inpl()
print(math.ceil(math.log(n) / math.log(k)))

Submission status: Wrong Answer

Solution code:
import math 

N,K = map(int,input().split())
ans = math.ceil(math.log(N,K)+0.00000001)
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

if N == 0:
    print('0')
else:
    print(math.ceil(math.log(N, 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:
N, K = list(map(int, input().split()))
i = 0
j = 0
while j < N:
    j = K**i
    i += 1
print(i-1)

Submission status: Wrong Answer

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

list = []

for i in range(num, -1, -1):
    n = str(N_//(K**i))
    N_ = N_ % (K**i)
    # print(N_, n)
    list.append(n)

print(len(list))

Submission status: Wrong Answer

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

list = []
print(num)


for i in range(num, -1, -1):
    n = str(N_//(K**i))
    N_ = N_ % (K**i)
    # print(N_, n)
    list.append(n)

print(len(list))

Submission status: Wrong Answer

Solution code:
import math

def main():
    strA = input()
    listA = strA.split(" ")

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

    x = N
    y = 0
    while(1):
        x = math.floor(x/K)

        y = y + 1
        if(x < K):
            y = y + 1
            break

    print(y)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

def main():
    strA = input()
    listA = strA.split(" ")

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

    x = N
    y = 0
    while(1):
        x = x/K

        y = y + 1
        if(x <= K):
            y = y + 1
            break

    print(y)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

def main():
    strA = input()
    listA = strA.split(" ")

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

    x = N
    y = 0
    while(1):
        x = x/K

        y = y + 1
        if(x < K):
            if K - x > 0:
                y = y + 1
            break

    print(y)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

def main():
    strA = input()
    listA = strA.split(" ")

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

    x = N
    y = 0
    while(1):
        x = x/K

        y = y + 1
        if(x < K):
            y = y + 1
            break

    print(y)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import log, ceil

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n, k = MAP()

print(ceil(log(n, k)))

Submission status: Wrong Answer

Solution code:
N,K  = map(int,input().split())
lis = [K**i for i in range(70)]

for i in range(len(lis)):
    if N -lis[i]<= 0 and i ==0:
        print(1)
        break
    if N -lis[i] <=0:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
N,K  = map(int,input().split())
lis = [K**i for i in range(50)]

for i in range(len(lis)):
    if N -lis[i] <=0:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
x,y = map(int ,input().split())
m = math.ceil(math.log(x, y))
print(m)

Submission status: Wrong Answer

Solution code:
import math

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
count = 0
s = 1
if K == 10:
  n = list(str(N))
  keta = len(n)
  print(keta)
  exit()
else:
  while N > K**count:
    count += 1
print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,K = map(int,input().split())
count = 0
while True:
    if N>(K**count):
        count += 1
    else:
        break
if N == 1:
    count = 1
if len(str(N))!=len(str(N-1)):
    count += 1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

temp = 1
cnt = 0
while n > temp - 1:
    temp *= k
    print(temp)
    cnt += 1
print(cnt)

Submission status: Wrong Answer

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

for i in range(2**30):
    # if k ** (i - 1) - 1 < n <= k ** i - 1:
    # print(i, temp)
    temp *= k
    if n <= temp:
        print(i + 1)
        exit()

Submission status: Wrong Answer

Solution code:

n, k =list(map(int, input().split()))
l = []
while True:
    l.append(n % k)
    n = n // k
    if n == 0:
        l.append(n % k)
        break
ans = len(l)
print(ans)

Submission status: Wrong Answer

Solution code:
n, k =list(map(int, input().split()))
l = []
while True:
    l.append(n % k)
    n = n // k
    if n // k == 0:
        l.append(n % k)
        break
ans = len(l)
print(ans)

Submission status: Wrong Answer

Solution code:
n, k =list(map(int, input().split()))
l = []
while True:
    l.append(n % k)
    n = n // k
    if n // k == 0:
        #l.append(n % k)
        break
ans = len(l)
print(ans)

Submission status: Wrong Answer

Solution code:
n, k =list(map(int, input().split()))
l = []
while True:
    l.append(n % k)
    n = n // k
    if n == 0:
        l.append(n % k)
        break
ans = len(l)
print(ans)

Submission status: Wrong Answer

Solution code:
n, k = list(map(int, input().split()))
ans = 0
l = []
while True:
    l.append(n % k)
    n = n // k
    if n // k == 0:
        l.append(n % k)
        break
ans = len(l)
print(ans)

Submission status: Wrong Answer

Solution code:
n, k = list(map(int, input().split()))
ans = 0
while True:
    l = []
    l.append(n % k)
    n = n // k
    if n // k == 0:
        l.append(n % k)
        break
ans = len(l)
print(ans)

Submission status: Wrong Answer

Solution code:
n, k = list(map(int, input().split()))
if k == 10:
    ans = len(str(n))
else:
    l = []
    while True:
        l.append(n % k)
        n = n // k
        if n// k == 0:
            l.append(n % k)
            break
    ans = len(l)
print(ans)

Submission status: Wrong Answer

Solution code:
n, k = list(map(int, input().split()))
if k == 10:
    ans = len(str(n))
else:
    l = []
    while True:
        l.append(n % k)
        n = n // k
        if n// k == 0:
            l.append(0)
            break
    ans = len(l)
print(ans)

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())  #数字

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N,K=map(int, input().split())
import math
M=int(math.log(N,K)+1)
print(M)
A=''
for i in range(1,M-1,-1):
  print(i)
  A+=str(N//(K**i))
  N-=N%(K**i)
print(A)

Submission status: Wrong Answer

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

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

for i in range(1,10000,1):
    if K**i <= N and N < K**(i+1) -1:
        print(i+1)
        exit()

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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
m=0
while n-m>0:
    cnt+=1
    m=k**cnt

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for p in range(1, 30):
    if K**(p-1) <= N and N < K**p:
        print(p)

Submission status: Wrong Answer

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

for p in range(30):
    if K**(p-1) <= N and N < K**p:
        print(p)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
ans = []
while n > 0:
    ans.append(int(n%k)) 
    n //= k

ans.reverse()

[print(i,end='') for i in ans]

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
def clas(n, k):
    li = []
    while True:
        c = n // k
        li.append(c % k)
        if c < k:
            li.append(c)
            break
        n = c
    return li

print(len(clas(n, k)))