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: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法でnは？？
n,k=mii()

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

print(len(str(bb(n,k))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

n,k = get_nums_l()

ans = 0

while n > 0:
    ans += 1
    n = n // k

print(ans)

Submission status: Accepted

Solution code:
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

n, k = map(int, input().split())
print(len(str(Base_10_to_n(n, k))))

Submission status: Accepted

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(len(x2))#"100011"が表示される．

Submission status: Accepted

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

Submission status: Accepted

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

ANS=0
while N:
    N-=N%(K**ANS)
    ANS+=1
print(ANS-1)

Submission status: Accepted

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

Submission status: Accepted

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

a = 0
while N != 0:
    a += 1
    N //= K

print(a)

Submission status: Accepted

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

t = 0
for i in range(n):
    n = n // k
    t += 1
    if n == 0:
        break
print(t)

Submission status: Accepted

Solution code:
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# n = int(input())
# 
# s = input()

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

Submission status: Accepted

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

i = 0
while True:
  N = N // R
  i += 1
  if N == 0:
    print(i)
    break

Submission status: Accepted

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

Submission status: Accepted

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

ans=0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
while n > 0:
    n //= k
    cnt += 1

print(cnt)

Submission status: Accepted

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(len(str(Base_10_to_n(n, k))))

Submission status: Accepted

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

Submission status: Accepted

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

    d = 1
    while True:
        if n <= (k ** d) - 1:
            print(d)
            return
        d += 1


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

c = 0
while True:
    c += 1
    if N//(K**c) == 0:
        break
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
def to_k_base_num(n,k):
    bi = ""
    while n != 0:
        bi += str(n%abs(k))
        if k < 0:
            n = -(-n//k)
        else:
            n //= k
    return bi[::-1]

def main():
    N,K = map(int,input().split())
    print(len(str(to_k_base_num(N,K))))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

import sys
readline = sys.stdin.readline
read = sys.stdin.read

#n,*a = [int(i) for i in read().split()]
#a = [int(i) for i in readline().split()]
#n = int(input())

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

res = 0
while n:
    n //= k
    res += 1

print(res)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
res = 0
while N >= pow(K, res): res += 1
print(res)

Submission status: Accepted

Solution code:
from collections import *
from itertools import *
from bisect import *
import copy

N,K=map(int,input().split())
#X=list(map(int,input().split()))
count=0
while N:

    N//=K
    count+=1


print(count)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
def examA():
    N, R = LI()
    ans = R+100*max(0,(10-N))
    print(ans)
    return

def examB():
    N, K = LI()
    ans = 1
    while(N>=K):
        N //=K
        ans += 1
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examB()

"""

"""

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

n,k = nm()
cnt = 0
while n:
    cnt += 1
    n //= k
print(cnt)

Submission status: Accepted

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

def solve():
    N, K = list(map(int, input().split()))
    ans = 0
    while N != 0:
        N //=K
        ans += 1
    print(ans)


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys
from operator import itemgetter
from collections import deque, Counter
from itertools import permutations, combinations
from heapq import heapify, heappop, heappush
from bisect import bisect, bisect_left

def solve():
    input = sys.stdin.readline
    N, K = map(int, input().split())
    dig = 0
    while N > 0:
        N //= K
        dig += 1
    print(dig)

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

base = 1
for i in range(10000):
    if n//base >= 1:
        base *= k
    else:
        print(i)
        break

Submission status: Accepted

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

t = K
cnt  = 1
while True:
    if t>N:
        break
    t *= K
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,k=INTM()
    ct=0
    while n>0:
        n=n//k
        ct+=1
    print(ct)
if __name__ == '__main__':
    do()

Submission status: Accepted

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

def base(x,p):
    if int(x/p) >= 1:
        return base(int(x/p),p)+str(x%p)
    return str(x%p)

print(len(base(N,K)))

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input()) # n=1
def inpm(): return map(int,input().split()) # x=1,y=2
def inpl(): return list(map(int, input().split())) # a=[1,2,3,4,5,...,n]
def inpls(): return list(input().split())  # a=['1','2','3',...,'n']
def inplm(n): return list(int(input()) for _ in range(n)) # x=[] 複数行
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)] # [[1,1,1,1],[2,2,2,2],[3,3,3,3]] 
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) # [[1,1,1,1],[2,2,2,2],[3,3,3,3]] 

def main():
    n,k= inpm()
    ans = 0
    while n > 0:
        n//=k
        ans += 1
    print(ans)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = 0
while n > 0:
    n //= k
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
c = 0
while a != 0:
  a -= a%b
  a //= b
  c += 1
print(c)

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,K=MI()
    ans = 0
    while N:
        ans += 1
        N//=K
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

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

import sys
sys.setrecursionlimit(300000)


def solve(N: int, K: int):
    ret = 0
    while N > 0:
        N //= K
        ret += 1
    print(ret)
    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: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
def pin(type=int):
    return map(type,input().split())
    
#どっかで最悪計算量の入力データを用意する関数を作ろう？
"""
"""

#solution:
def dfs_search_2Dgrid(h,w):
    #if h,wが迷路の外->Noneを返す
    #if もう通った点->None
    #通った点のリスト？に記録
    #二次元グリッドなので4方向に進もうとしてみよう
    pass
#input
N,K=pin()
ans=0
n=N
while (n>0):
    n//=K
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math
INF = float("inf")


def solve(N: int, K: int):
    print(int(math.log(N)/math.log(K))+1)
    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: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

Submission status: Accepted

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


def convert_decimal_to_n_ary_number(n: int, m_ary_number: int = 2) -> int:
    '''Represents conversion from decimal number to n-ary number.
    Args:
        n: Input number (greater than 1).
        m_ary_number: m-ary number (from 2 to 10).
    Returns:
        values of m-ary number.
    Landau notation: O(log n)
    '''
    if n < m_ary_number:
        return n

    ans = ''

    while n >= m_ary_number:
        p, q = divmod(n, m_ary_number)
        n = p
        ans += str(q)

        if n < m_ary_number:
            ans += str(p)

    return int(ans[::-1])


def main():
    n, k = map(int, input().split())
    print(len(str(convert_decimal_to_n_ary_number(n, k))))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

N, K = list(map(int, sys.stdin.buffer.readline().split()))
ans = 0
while N > 0:
    ans += 1
    N //=K
print(ans)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,k = LI()
    print(int(math.log(n,k))+1)
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
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 LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    n,k=MI()
    ans=0
    while n:
        n//=k
        ans+=1
    print(ans)

main()

Submission status: Accepted

Solution code:
n, k = [int(i) for i in input().split()]
ans = 0
while n:
    ans += 1
    n //= k
print(ans)

Submission status: Accepted

Solution code:
# じょえチャンネル
# 高評価・チャンネル登録宜しくお願いします！
# https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ

import sys
from fractions import gcd
from itertools import groupby as gb
from itertools import permutations as perm
from itertools import combinations as comb
from collections import Counter as C
from collections import defaultdict as dd
sys.setrecursionlimit(10**5)
def y(f):
    if f:
        print('Yes')
    else:
        print('No')
def Y(f):
    if f:
        print('YES')
    else:
        print('NO')
def Z(f):
    if f:
        print('Yay!')
    else:
        print(':(')
def ispow(n):
    if int(n**.5)**2==n:
        return True
    return False


a,b = map(int,input().split())
res = 0
while a > 0:
    res += 1
    a //= b
print(res)

Submission status: Runtime Error

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

ans = 1
while(True):
    n = n//k
    if(n == 0):
        break
    ans += 1

print(ans)

Submission status: Runtime Error

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)
  else:
     k**i < n <k**(i+1)
    print(i+1)

Submission status: Runtime Error

Solution code:
n,k = [int(x) for x in input().split()]
res = 0
while n > 0:
  n // k
  c += 1
print(res)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def from_10_to_n(x, n):
  tmp = x
  out = ''
  while tmp > 0:
    out = str(x % n) + out
    tmp = tmp // n
  return out

N, K = map(int, input().split())
N = from_10_to_n(x, n)
print(len(N))

Submission status: Runtime Error

Solution code:
n,k=int(input())

count=0

while n//k>0:
  n//k
  count+=1

Submission status: Runtime Error

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

while  n >= k:
    a += 1
    n = n // k

print(a + 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
X = list(map(int, input().split()))
ans = 100 ** 100

for p in range(1, 101):
	now = 0
	for x in X:
		now += (p - x) ** 2
	ans = min(ans, now)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
typedef long long int INT;

INT pow(int n,int k)
{
    INT a=1;
    for (int i=1;i<=k;i++){
        a*=n;
    }
    return a;
}

int main()
{
    INT n;
    int k;
    cin>>n>>k;
    int i=0;
    while(1){
        if(n<pow(k,i)){
            cout<<i<<endl;
            break;
        }
        ++i;
    }
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
    ll N, K;
    cin >> N >> K;

    ll ans = 0;
    while(1) {
        ans++;
        N = N / K;
        if (N == 0) {
            break;
        }
    }
    cout << ans << endl;
}

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def B():
    n,r = list(map(int, input().split()))
    i = 1
    while True:
        if n < k**i:
            print(i)
            return
        i += 1
B()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
import math
n, k = map(int, input().split())
if n % k
print(int(math.log(n, k)) + 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np
import math

def solve(N: int, X: "List[int]"):
    place = np.mean(X)
    place = round(place)
    result = 0
    for i in range(N):
        result += (X[i]-place) ** 2
    print(int(result))
    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
    X = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, X)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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


def solve(N: int, K: int):
    count = 0
    while True:
        N = N // K
        if N >= 1:
            count += 1
        else:
            break
    print (cont)
    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: Runtime Error

Solution code:
n, k = list(map(int, input().split()))
ans = 0
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: Runtime Error

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


if k == 10:
    ans = len(str(n))
else:
    l = []
    while True:
    n = n // k
    ans += 1
    if n == 0:
        break
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
難しい

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#ライブラリの読み込み
import math

#入力値の格納
x = int(input())

#得点の計算
score = int((x // 500 * 1000) + (x % 500 // 5 * 5))

#表示
print(score)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
    N, M = map(int, input().split())
    A = [int(a) for a in input().split()]
    total = sum(A)
    cnt = 0
    for i in range(N):
        if A[i] < total*1.0/(4.0*M):
            pass
        else:
            cnt += 1
    if cnt >= M:
        print("Yes")
    else:
        print("No")
main()

Submission status: Runtime Error

Solution code:
N,K=(int(x) for x in input().split())
b=1
a=1
If N=1:
    print(1)
else:
     while a<=N:
          b=b+1
          a=K**b
     else:
          print(b)

Submission status: Runtime Error

Solution code:
N,K=(int(x) for x in input().split())
b=1
a=1
while a=<N:
    b=b+1
    a=K**b
else:
     print(b)

Submission status: Runtime Error

Solution code:
N,K=(int(x) for x in input().split())
k=0
a=K
while a<=N:
    k=+1
    a=K**k
break
print(k+1)

Submission status: Runtime Error

Solution code:
N,K=(int(x) for x in input().split())
k=0
while a<=x:
    a=K*10**k
    k=+1
print(k)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
s=k
if k>n:
  print(i)
  exit()
for i in range(1000000):
  s*=k
  if s>n:
    print(i+2)
    exit()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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