Problem:


Score : 200 points

Problem Statement

Given is an integer N. Find the number of digits that N has in base K.

Notes

For information on base-K representation, see Positional notation - Wikipedia.

Constraints

All values in input are integers.

1 \leq N \leq 10^9

2 \leq K \leq 10

Input

Input is given from Standard Input in the following format:

N K

Output

Print the number of digits that N has in base K.

Sample Input 1

11 2

Sample Output 1

4

In binary, 11 is represented as 1011.

Sample Input 2

1010101 10

Sample Output 2

7

Sample Input 3

314159265 3

Sample Output 3

18



Sample input:
11 2


Sample output:
4

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import queue
N,K = map(int,input().split())
ans = queue.Queue()
while N >= K:
    N,amari = divmod(N,K)
    ans.put(amari)
ans.put(N)
answer = ""
while not ans.empty():
    answer += str(ans.get())
print(answer)

Submission status: Wrong Answer

Solution code:
import math


def answer(n: int, k: int) -> int:
    return math.ceil(math.log(n, k))


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

i = 0
anslist = []
while True:
  i+=1
  anslist.append(N%K)
  N = N//K
  #print (N)
  if N<K:
    anslist.append(N)
    i+=1
    break
    
anslist.reverse()
#print (anslist)
#print (''.join(map(str, anslist)))
print (i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc156/tasks/abc156_b
N,K = map(int,input("入力：").split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    if q <=0 :
        break

n_ary = int("".join(map(str,mod_list[::-1])))
print(len(str(n_ary)))

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc156/tasks/abc156_b
N,K = map(int,input().split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    #print(q)
    #print(mod)
    if q <=0 and mod >= 0:
        break
print(len(mod_list))

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc156/tasks/abc156_b
N,K = map(int,input().split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    #print(q)
    #print(mod)
    if q == 0 or q <=0:
        break
print(len(mod_list))

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc156/tasks/abc156_b
N,K = map(int,input().split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    #print(q)
    #print(mod)
    if q == 0:
        break
print(len(mod_list))

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc156/tasks/abc156_b
N,K = map(int,input().split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    mod = q % K
    mod_list.append(mod)
    q = q // K
    #print(q)
    #print(mod)
    if q<=0:
        break
print(len(mod_list))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def ans156(N:int, K:int):
    length=1
    while True:
        N=N/K

        length+=1
        if N<K:
            break
    return length

print(ans156(N,K))

Submission status: Wrong Answer

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

def ans156(N:int, K:int):
    length=1

    while True:
        subcount=0
        while True:
            N-=K
            subcount+=1
            if N<K:
                break
        N=subcount
        length+=1
        if N<K:
            break
    return length

print(ans156(N,K))

Submission status: Wrong Answer

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

def ans156(N:int, K:int):
    length=1
    while True:
        N=int(N/K)
        length+=1
        if N<K:
            break
    return length

print(ans156(N,K))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

# n を k 進数で表す
for i in range(1, 100):
    if n <= k ** i:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def ans156(N:int, K:int):
    count=1
    while K>0:
        N=int(N/K)
        count+=1
        if N<K:
            break
    return count

print(ans156(N,K))

Submission status: Wrong Answer

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

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

print(i)

Submission status: Wrong Answer

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

def ans156(N:int, K:int):
    count=1
    while True:
        N=int(N/K)
        count+=1
        if N<K:
            break
    return count

print(ans156(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())
a = 1
for i in range(100000000000):
  n =  n//k
  a +=1
  if(n<k):
    break
print(a)

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
if(n%k==0 or n//k ==0):
  a = 0
else:
  a = 1
for i in range(100000000000):
  n =  n//k
  a +=1
  if(n==1 or n==0):
    break
print(a)

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

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

Submission status: Wrong Answer

Solution code:
def main():
    n, k = map(int, input().split())
    cnt = 0
    i = 1
    # nが大きい
    while n >= i:
        print(i)
        i *= k
        cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n, k = map(int, input().split())
    cnt = 0
    i = 1
    # nが大きい
    while n > i:
        i *= k
        cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
n, k = map(int, input().split())
print(int(math.ceil(math.log(n,k))))

Submission status: Wrong Answer

Solution code:
import math
n,k=map(int, input().split())
i=1
ans=0
while i<=n:
  if i==n: ans+=1; break
  i*=k
ans += math.ceil(math.log(n, k))
print(ans)

Submission status: Wrong Answer

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

if n == 1:
    print(1)
else:
    a=1
    ans = 0
    while a<n:
        a *=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 sys
import math
n,k=map(int,input().split())

p=int(math.log2(n))

for i in range(p):
    if n//(k**i)<1:
        print(i)
        sys.exit()

Submission status: Wrong Answer

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

for i in range(10):
    if n//(k**i)<1:
        print(i)
        sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

i = 0
while N > K ** i:
  i += 1
  
i -= 1
ls = []
while i >= 0:
  ls.append(N // (K ** i))
  N %= (K ** i)
  i -= 1
  
print(len(ls))

Submission status: Wrong Answer

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

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

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

print(cnt)

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3
import sys
sys.setrecursionlimit(10**9)


INF=10**20
def solve(N: int, K: int):
    ans = N % K != 0
    while N > 1:
        N //= K
        ans += 1
    
    print(ans)
    return

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**9):
    if n <= k**i:
        print(i)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans+1)

Submission status: Wrong Answer

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

print(ans+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
def main():
    N, K = map(int, input().split())

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC156
# B Digits
# 整数nをk進法で表した時何桁？
n, k = map(int, input().split())
l = k - 1
ct = 1
while True:
    if l >= n:
        break
    else:
        l = int((k ** ct)+l)
        ct +=1
print(ct)

Submission status: Wrong Answer

Solution code:
score = list(map(int,input().split()))
keta = 0
answer = 1
while score[0] > answer:
    answer *= score[1]
    keta += 1
if score[0] == 1:
    keta = 1
print(keta)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# Digits
N, K = map(int, input().split())
div = N // K
digits = []
while div > K:
    div = N // K
    digits.append(str(N % K))
    N   = div
digits.append(str(N % K))
if N // K != 0:
    digits.append(str(N // K))
# ans = len(digits)
ans = ''.join(digits[::-1])
print(ans)

Submission status: Wrong Answer

Solution code:
# Digits
N, K = map(int, input().split())
div = 10 ** 9 + 1
digits = []
while div > K:
    div = N // K
    digits.append(str(N % K))
    N   = div
digits.append(str(N % K))
if N // K != 0:
    digits.append(str(N // K))
ans = len(digits)
# ans = ''.join(digits[::-1])
print(ans)

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)
a=Base_10_to_n(X, n)
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

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

if K == 10:
    print(len(str(N)))
    sys.exit()

p = 0
while True:
    num = K ** p
    if N <= num:
        break
    p += 1

print(p)

Submission status: Wrong Answer

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

    digits = 1
    while N > K:
        digits += 1
        N /= K

    print(digits)

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import math
n = math.log(N, K)
print(math.ceil(n))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


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


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    print(f'{solve(N, K)}')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


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


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    print(f'{solve(N, K)}')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

result = digits()
print(result)

Submission status: Wrong Answer

Solution code:
import sys


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


if __name__ == "__main__":
    main()

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

N, K = MI()

def nsinsuu(n, k):
    if n == 1: return 0
    cnt = 0
    while n > k:
        cnt += 1
        n = n / k
    return cnt

print(nsinsuu(N,K)+1)

Submission status: Wrong Answer

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

N, K = MI()

def nsinsuu(n, k):
    cnt = 0
    while n > k:
        cnt += 1
        n = n // k
    return cnt

print(nsinsuu(N,K)+1)

Submission status: Wrong Answer

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

N, K = MI()

def nsinsuu(n, k):
    if n == 1: return 0
    cnt = 0
    while n > k:
        cnt += 1
        n = n // k
    return cnt

print(nsinsuu(N,K)+1)

Submission status: Wrong Answer

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

N, K = MI()

def nsinsuu(n, k):
    if n == 1: return 1
    cnt = 0
    while n > k:
        cnt += 1
        n = n // k
    return cnt

print(nsinsuu(N,K)+1)

Submission status: Wrong Answer

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

N, K = MI()

def nsinsuu(n, k):
    cnt = 0
    while n > k:
        cnt += 1
        n = n / k
    return cnt

print(nsinsuu(N,K)+1)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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


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


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


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

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


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

keta = 1
while (NK[1] ** keta < NK[0]):
    keta += 1

print(keta)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Sum = 1

while True:
    Sum += 1

    if K ** Sum > N:
        break

print(Sum)

Submission status: Wrong Answer

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

Sum = 1

while True:
    Sum += 1
    
    if K ** Sum > N:
        break
        
print(Sum-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N, K = 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())
a = 1

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

print(a)

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())
x=str((n-1)%k+1)*(((n-1)//k)+1)
y=sum(list(map(int,x)))
print(y)

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
x=str((k-1)%n+1)*(((k-1)//n)+1)
y=sum(list(map(int,x)))
print(y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

def main():
  N, K = map(int, input().split())
  i = 1
  tmp = 1
  
  while i > -1:
    if N > K ** i:
      tmp += 1
    else:
      print(tmp)
      return
    
    i += 1
  
  
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = ""
while(True):
  if n < k :
    s += str(n)
    break
  else :
    s += str(n%k)
    n = n//k

print(s)
print(len(s))

Submission status: Wrong Answer

Solution code:
n,k = map(int, input().split())
res = 0
m = n-1
a = 1
while True:
    if n <= k**a:
        ans = a
        break
    a += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n,k = map(int, input().split())
res = 0
m = n-1
a = 1
while True:
    if k**(a-1) < n and n <= k**a:
        ans = a
        break
    a += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N,K = list(map(int,input().split()))
#a = math.ceil(math.log(N,K))
#print(a)
ans = 1
while True:
    if N/K >1:
        N = N/K
        ans +=1
    else:
        break
print(ans)