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:
inp = input().split(" ")
n, k = int(inp[0]), int(inp[1])
# print(n, k)

squared = 1
count = 0
while squared < n:
  squared *= k
  # print(squared)
  count += 1
print(count)

Submission status: Wrong Answer

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

def solve(N: int, K: int):
    i = 0
    while True:
        if N > (K ** i):
            i += 1
        else:
            print(i)
            break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip() 
import math

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

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

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

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
    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:
N, K = list(map(int, input().split()))
x = 0
while N >= (K**x):
    if N <= (K**x):
        break
    else:
        x += 1
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

sum = 0
cnt = 0

while sum <= n:
    sum += k**cnt
    cnt +=1

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import itertools
import statistics
#n = int(input())
#n, d = list(input().split())
n, k = list(map(int, input().split()))

p = 1
keta = 1
while p < n:
    p *= k
    keta+=1

print(keta-1)

Submission status: Wrong Answer

Solution code:
from math import log, ceil


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

ans=1

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

Submission status: Wrong Answer

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

d = 0

while K ** d < N:
  d +=1

print(d)

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 > K**a:
    a += 1
  else:
    l = 0
print(a)

Submission status: Wrong Answer

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

n=1
for i in range(1000):
   n=n*Y
   if(n>=X):
       print(i+1)
       exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

total = 1

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

print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(t)

Submission status: Wrong Answer

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

import math

q = math.log(n,k)
if q % 1 == 0:
  print(math.floor(q))
else:
  print(math.ceil(q))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def strr():
 a=raw_input()
 return a
def sstrr():
 a=raw_input().split()
 return a
def intt():
 a=int(raw_input())
 return a
def iintt():
 a=[int(s) for s in raw_input().split()]
 return a
def nestt(t):
 a=[raw_input().split() for s in range(t)] 
 return a

nk=iintt()
n=nk[0]
k=nk[1]
a=0
s=1
while n>s:
 s*=k
 a+=1
print a

Submission status: Wrong Answer

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

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

print(i)

Submission status: Wrong Answer

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

x = 0

for j in range(1, 46):
    if N > (K**j):
        continue
    else:
        print(j)
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

print(PW)

Submission status: Wrong Answer

Solution code:
# スペース区切りの整数入力
N,K = map(int, input().split())

for i in range(10000000000000):
    if N <= K ** i:
        break
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

Solution code:
import math

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

n_int = math.log(n,k)
print(math.ceil(n_int))

Submission status: Wrong Answer

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

while n != 0:
    ans = str(n%k) + ans
    n //= k

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
ans = 0
while n > 1:
    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+1, K)))

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
count=0
if k == 10:
    count+=1
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())
i = 0
while K**i < N: i += 1
print(i)

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
for i in range(1,19):
    if n//pow(k,i)<=0:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,K = [int(x) for x in stdin.readline().rstrip().split()]
ans = 0
for k in range(1000000):
    N -= (K**k)
    if N < 0:
        break
    ans += 1
    
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

print(Base_10_to_n(N,K))

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
import queue
import copy


#X = str(input()).split()
#a = [int(x) for x in input().split()]


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

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

if(N<K):
  ans = 1


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main(n,k):
    res = 0
    val = 1
    while val < n :
        res += 1
        val = val * k
    return res

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

Submission status: Wrong Answer

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

print(count)

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

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

x = math.log(n, k)

if x % 1 == 0:
    print(int(x))
else:
    print(int(x)+1)

Submission status: Wrong Answer

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

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

    print(i)
 
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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
N, R = list(map(int, input().split()))
print(math.ceil(math.log(N, R)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import log, ceil, floor
N, K = [int(n) for n in input().split()]
print(ceil(log(N,K)))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
from math import log, ceil

def solve():
    N, K = map(int, input().split())
    return str(ceil(log(N+1,K)))

if __name__ == '__main__':
    print(solve())

Submission status: Wrong Answer

Solution code:
from math import log, ceil

n,k = [int(i) for i in input().split()]
print(ceil(log(n,k)))

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

Submission status: Wrong Answer

Solution code:
import math
n,r=list(map(int,input().split()))
ans=math.log(n+1,r)
ans=math.ceil(ans)
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
N, K = [int(i) for i in 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(100):
    if k**i >= n:
        print(i)
        exit()

Submission status: Wrong Answer

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

import math

q = math.log(n,k)
print(math.ceil(q))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

while N<1:
  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)) if n%k!=0 else math.ceil(math.log(n,k))+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import  math as m
N,K=map(int,input().split())
r=m.log(N,K)
if r>int(r):
    print(int(r+1))
else:
    print(int(r))

Submission status: Wrong Answer

Solution code:
import numpy as np
import math

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

temp = np.log(n)/np.log(k)

print(math.ceil(temp))

Submission status: Wrong Answer

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

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

    print(i - 1)


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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest

def resolve():
    n,k = list(map(int,input().split()))

    c=1
    s=k
    while 1:
        if s>=n:
            print(c)
            return
        s*=k
        c+=1

    return

resolve()

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:
#!/usr/bin/env python3
import sys
#sys.setrecursionlimit(150000)


def solve(N: int, K: int):
    keta=1
    while(N>K):
        keta+=1
        N=N/K
    print(keta)
    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:
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 = 0
    if n % k != 0:
        ans = 1
    while n > 1:
        n //= k
        ans += 1
    print(ans)
    return

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(t)

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

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

Submission status: Wrong Answer

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

a=0
b=0
c=0
for _ in range(36): #log2 10^9=9log2 10<36
    a=N//K
    b=N%K
    N=a
    c+=1
    if a<K:
        c+=1
        print(c)
        exit()

Submission status: Wrong Answer

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

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

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

print d

Submission status: Wrong Answer

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

for i in range(1, 30):
    if k ** i > num:
        print(i)
        exit(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    n, k = map(int,input().split()) 
    ret = 1

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

    print(ret)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

b = a[0]
for i in range(10**8):
  d = b / a[1]
  b = d
  if d < a[1]:
    break

print(i+2)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,K = [int(x) for x in stdin.readline().rstrip().split()]
ans = 0
for k in range(100):
    N -= (K**k)
    ans += 1
    if N <= 0:
        break
    
    
print(ans)

Submission status: Wrong Answer

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

for i in range(1000000):
  if pow(k, i) >= n:
    print(i)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    n, k = map(int, args[0].split())

    ret = 1
    while 1 < n/(k**ret):
        ret += 1
    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Wrong Answer

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



print(ans)

Submission status: Wrong Answer

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

num = log(N, K)
if int(num) == num:
    print(int(num))
else:
    print(ceil(num))

Submission status: Wrong Answer

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

ans = - (-math.log(n)//math.log(k))

print(int(ans))

Submission status: Wrong Answer

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
import queue
import copy


#X = str(input()).split()
#a = [int(x) for x in input().split()]


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

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

print(ans)

Submission status: Wrong Answer

Solution code:
n, k = [int(i) for i in input().split()]
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
print(Base_10_to_n(n, k))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import string

numbers = "0123456789"
alphabets = string.ascii_letters # a-z+A-Zをロード
characters = numbers + alphabets

def base_cvt(value, n=2):
    try:
        tmp = int(value)
    except:
        raise ValueError('Invalid value:', value)
 
    if n < 2 or n > len(characters):
        raise ValueError('Invalid n:', value)
 
    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result
  
n,k = map(int,input().split())
print(base_cvt(n,k))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

words = lambda t : list(map(t, input().split()))
n,k = words(int)

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

Submission status: Wrong Answer

Solution code:
# スペース区切りの整数の入力
n, k = map(int, input().split())

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, K):
    for i in range(10000000000):
        if K ** i >= N:
            return i

    # return math.ceil(n)


def main():
    N, K = read_int_n()
    print(slv(N, K))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

print(power)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

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

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

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

Submission status: Wrong Answer

Solution code:
# coding:utf-8

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

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

print(cnt)

Submission status: 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,K)))




if __name__ == "__main__":
  main()

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ans=1
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())

num = log(N, K)
if int(num) == num:
    print(num)
else:
    print(ceil(num))

Submission status: Wrong Answer

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

for i in range(100):
    if k ** i >= n:
        print(i)
        break

Submission status: Wrong Answer

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

for i in range(1, n):
    if k ** i > n:
        print(i)
        exit()

Submission status: Wrong Answer

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

ans = 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

def resolve():
    N,K=map(int,input().split())
    A=math.log(N,K)
    print(math.ceil(A))




if __name__ == "__main__":
    resolve()

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

n, k = [int(i) for i in input().split()]

tmp = math.log(n, k)
result = int(tmp)

if tmp == result:
  print(result)
else:
  print(result+1)

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

for i in range(1000):
  if pow(k, i) >= n:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
import math

n,k = map(lambda x: int(x), input().split())


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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    vn = vk = vn_k = 1
    for i in range(1, n+1):
        vn = vn * i % modp
        if i == k:
            vk = vn
        if i == n-k:
            vn_k = vn
    return vn * get_inv(vk, modp) * get_inv(vn_k, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

def main():
    N,K=mis()
    print(math.ceil(math.log(N,K)))

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

ans = math.log(n, k)

print(math.ceil(ans))