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: Runtime Error

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


# 再帰処理：関数の中でその関数自身が呼び出されること。→ 繰り返し処理の実装が可能
def conversion(_n, _m):
    if int(_n / _m):
        return conversion(int(_n / _m), _m) + str(_n % _m)
    return str(_n % _m)


print(conversion(n, m))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
print(math.ceil(math.log(int(input()), int(input()))))

Submission status: Runtime Error

Solution code:
inp=list(map(int,input().strip().split()))[:2]
n,r=inp[0],inp[1]
count=0
while(n > 0):
  n=n//r
  count+=1
return count

Submission status: Runtime Error

Solution code:
inp=list(map(int,input().strip().split()))[:2]
n,r=inp[0],inp[1]
count=0
while(n > 0):
  n=n//k
  count+=1
return count

Submission status: Runtime Error

Solution code:
314159265 3

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

n , k = map(int,input().strip().split())
if k == 2:
    n = bin(n)[2:]
    print(len(n))
elif k==8:
    n = oct(n)[2:]
    print(len(n))
elif k == 3:
    n = np.base_repr(n, base=3)
    print(len(n))
elif k == 4:
    n = np.base_repr(n, base=4)
    print(len(n))
elif k == 5:
    n = np.base_repr(n, base=5)
    print(len(n))
elif k == 6:
    n = np.base_repr(n, base=6)
    print(len(n))
elif k == 7:
    n = np.base_repr(n, base=7)
    print(len(n))
elif k == 9:
    n = np.base_repr(n, base=9)
    print(len(n))

else:
    print(len(n))

Submission status: Runtime Error

Solution code:
import numpy as np
n , k = map(int,input().strip().split())
if k == 2:
    n = bin(n)[2:]
    print(len(n))
elif k==8:
    n = oct(n)[2:]
    print(len(n))
elif k == 3:
    n = np.base_repr(n, base=3)
    print(len(n))
elif k == 4:
    n = np.base_repr(n, base=4)
    print(len(n))
elif k == 5:
    n = np.base_repr(n, base=5)
    print(len(n))
elif k == 6:
    n = np.base_repr(n, base=6)
    print(len(n))
elif k == 7:
    n = np.base_repr(n, base=7)
    print(len(n))
elif k == 9:
    n = np.base_repr(n, base=9)
    print(len(n))

else:
    print(len(n))

Submission status: Runtime Error

Solution code:
import numpy as np
n , k = map(int,input().strip().split())
if k == 2:
    n = bin(n)[2:]
    print(len(n))
elif k==8:
    n = oct(n)[2:]
    print(len(n))
elif k == 3:
    n = np.base_repr(n, base=3)
    print(len(n))
elif k == 10:
    print(len(n))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, r = map(int, input().split())
d = []

while n > 0:
    d.append(n % k)
    n = n // k
    
print(len(d))

Submission status: Runtime Error

Solution code:
from collections import deque

n, r = map(int, input().split())
d = deque()

while n > 0:
    d.append(n % k)
    n = n // k
    
print(len(d))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

while R <= N:
  N = N // R
  a +=a

print(a)

Submission status: Runtime Error

Solution code:
import math

x = [int(x) for x in input().split()]

print(math.ceil(math.log(x[0],float(x[1]))

Submission status: Runtime Error

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

Submission status: Runtime Error

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())
x = base10to(N,K)
print(len(x))

Submission status: Runtime Error

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(len(base10to(N,K)))

Submission status: Runtime Error

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

for i in range(100000)
    if r**i>n:
        print(i)
        break

Submission status: Runtime Error

Solution code:
N,K = list(map(int,input(),split()))
for i in range(100):
  if K**i <= N < K**(i+1):
    print(i+1）

Submission status: Runtime Error

Solution code:
a,b = list(map(int,input().split()))
for i in range(10)
   if b**i <= a < b**(i+1):
      ans = i
      break
    else:
      ans = no
print(ans)

Submission status: Runtime Error

Solution code:
N, K = [int(_) for _ in input().split()]
for a in range(10**9):
    if K**(a) <= N < K**(i*1):
        print(a+1)
        break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
k = int(input())
i = 0
while True:
   if n < k**(i+1):
     print(i + 1)
     break
   i += 1

Submission status: Runtime Error

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

for i in range(MAX_N):
    if n < pow(k, i):
        print(i)
        break

Submission status: Runtime Error

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

for i in range(MAX_N):
    if n < pow(k, i):
        print(i)
        break
else:
    raise 'iteration over'

Submission status: Runtime Error

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

ans = 0
while True:
    N = N // K
    ans += 1
    if N == 0:
        break

print(ans)

Submission status: Runtime Error

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

ans = 0
while True:
    N //= K
    ans += 1
    if N == 0:
        break

print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin

n,k=map(int,input().split())
num = n
sum_k = k
for sum_k <= n:
    sum_k= sum_k * k
print(len(sum_k))

Submission status: Runtime Error

Solution code:
from sys import stdin

n,k=map(int,input().split())
num = k
sum_k = n
for sum_k <= n:
    sum_k= sum_k*n
print(len(sumk))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count=''
for j in range(i):
  M=N//(K**(i-j))
  count=str(M)+count
  N-=K**(i-j)*M
  
print(int(count))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

while N > 1:
    result = str(N % K) + result
    N //= K

result = str(N % K) + result
ln(result)

Submission status: Runtime Error

Solution code:
ount = 0       #初期値を0とするcount変数を作る.
n,k = map(int,input().split())      #整数とn進数を入力する。

while True:         #nをkで割った商が0になるまでcountに1を足し続ける。
    count = count +1
    n = n // k
    if n == 0:
        break

print(count)

Submission status: Runtime Error

Solution code:
n,k = map(int,input())
lis = []

while n / k == 0:
    if n >k：
        lis.append(int(n % k))
        ing_total += 1
    else:
        if n >= 10:
            ing_total = 2
        else:
            ing_total = 1

print(ing_total)

Submission status: Runtime Error

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

ans = 0

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

Submission status: Runtime Error

Solution code:
n = int(input())
x = [int(i) for i in input().split()]
x.sort()

ans = 10000
for p in range(1,x[-1]+1):
  sum =0
  for i in range(n):
    sum += (x[i]-p)**2
    
  ans = min(ans,sum)
  
print(ans)

Submission status: Runtime Error

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

log = math.log(N,K)
if int(log) != log:
  log += 1

print(log)

Submission status: Runtime Error

Solution code:
import math
number = int(input())
base = int(input())
converted=0
reminder=0
i=0
counter=0
while number!=0:
    reminder=number%base
    number=number//base
    converted=converted+reminder*10**i
    i+=1


#To convert integer into string
y=str(converted)
print(len(y))

Submission status: Runtime Error

Solution code:
def conv(x, n):
    nchar = '0123456789ABCDEF'
    digit = 0
 
    result = ''
 
    while x > 0:
        result = nchar[x % n] + result
        x = x / n
 
    return result
n, k = map(int, input().split())
print(conv(n, k))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
from itertools import takewhile, count


def solve(N: int, K: int):
    return max(takewhile(lambda i: N >= (K ** i), count(1))) + 1

# 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
    print(solve(N, K))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
from itertools import takewhile, count


def solve(N: int, K: int):
    return max(takewhile(lambda i: N > (K ** i), count(1))) + 1

# 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
    print(solve(N, K))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split()) 
lst_b=[] 
lst_c=[] 
while(True): 
    b=n//m 
    c=n%m 
    lst_b.append(b) 
    lst_c.append(c) 
    n=b 
    	if b==0: 
    		print("".join(map(str,lst_c[::-1]))) 
    		break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
val,law_num = input().split(" ")

val = int(val)
law = int(law_num)
res = int(val, law)

print(len(res))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if b==2:
    a=format(a,'b')
elif b==8:
    a=format(a,'o')
elif b==10:
    a=int(a)
print(len(a))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if b==2:
    a=bin(a)
elif b==8:
    a=oct(a)
elif b==10:
    a=int(a)
print(len(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

print(a)

Submission status: Runtime Error

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

digit = 1
while src[1] ** digit - 1 < src[0]:
    digit += 1

print(digit)

Submission status: Runtime Error

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

import math
a = (int(math.ceil(math.log(n)/math.log(k) )))
if a==0:
  print(1)
else
  print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
imports sys
l = sys.stdin.readline()
n, k = map(int, l.split())
if n == 0:
  print(1)
  sys.exit(0)
count = 0
while n > 0:
  	n /= k
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
def main():
	n,m = map(int,input().split())
	# a = list(map(int,input().split()))
	# l = [str(input()) for i in range(n)]
	
	# m_pre = int(m)
	# ans = []
	# while n > 1:
	# 	print(n%m)
	# 	ans.append(n%m)
	# 	print("n = {}".format(n))
	# 	n = (n - (n%m)) // m
	# if n<m:
	# 	ans.append(1)
	# ans.reverse()
	# print(len(''.join(map(str,ans))))
	if n > m:
    	ans = 1
    else:
		ans = 0
	while n >= m:
		n = (n-n%m) // m
		ans += 1
	# if n < m:
	# 	ans -= 1
	print(ans)
	
 
if __name__ == '__main__':
	main()

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
ct = 0

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

Submission status: Runtime Error

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

a = int(n,3)

print(len(a))

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
print(k * len(str(n))

Submission status: Runtime Error

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

i = list(map(int, input().split()))
out = Base_10_to_n(i[0], i[1])
pritnt(out)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(len(str(int(a, b))))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:


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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def ten_to_n(X, n):
    i = int(X / n)
    s = str(X % n)
    if (i):
        return Base_10_to_n(i, n) + s
    return s

def solve():
    N, M = map(int, input().split())
    n = Base_10_to_n(N, M)
    return len(n)
 
print(solve())

Submission status: Runtime Error

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

counter = 1
tmp = 1
while true:
    tmp *= K
    if tmp > N
        break
    counter += 1
print(counter)

Submission status: Runtime Error

Solution code:
import math


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

ans = math.floar(1 + math.log(N)/math.log(K))
print(ans)

Submission status: Runtime Error

Solution code:
n,k=input().split();print(len(str(int(n,int(k)))))

Submission status: Runtime Error

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


def log(r, d):
    return np.log(d)/np.log(r)


def ceil(x):
    if x.is_integer():
        return int(x)
    return int(np.ceil(x))


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

Submission status: Runtime Error

Solution code:
n,k = input().split()
k = int(k)
ans = len(str(int(n,k)))
print(ans)

Submission status: Runtime Error

Solution code:
n,k = input().split()
k = int(k)
ans = len(int(n,k))
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
b=int(input())

temp=n
count=0
while(temp!=0):
  temp=temp/b
  count=count+1
  
print(count)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll N, K;
    cin >> N >> K;
    ll ans = 0;
    ll tmp = 0;
    while (pow(K, tmp) <= N) {
        tmp++;
    }
    rep2(i, 1, tmp + 1) {
        if (pow(K, i - 1) <= N && N < pow(K, i)) {
            ans = max(ans, i);
        }
    }
    cout << ans << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

Submission status: Runtime Error

Solution code:
n, k = input().split()
print(len(str(int(n, int(k)))))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

inp = input()
N = int(inp.split()[0])
R = int(inp.split()[1])

i = 0
s=0
l=R
if s < N and N < l:
  print(i+1)
  sys.exit("")

  i+=1
while True:
  s = l
  l = s*R
  if s < N and N < l:
     print(i+2)
     break
  i += 1

Submission status: Runtime Error

Solution code:
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
  
x10 = int(input())
n = int(input())
x2 = Base_10_to_n(x10, n)

print( x2.len() )

Submission status: Runtime Error

Solution code:
n = int(input())
x = list(map(int, input().split()))
m = round(sum(x)/n)
answer = 0
for i in x:
    answer += (i-m)**2
print(answer)

Submission status: Runtime Error

Solution code:
import sys

inp = input()
N = int(inp.split()[0])
R = int(inp.split()[1])

if N == 1:
  print(1)
  sys.exit("")
  

i = 0
s=0
l=0
while True:
  if i==0:
    s=0
    l=R
  else:
  	s = l
  	l = s*R
  if s < N and N < l:
     print(i+1)
     break
  i += 1

Submission status: Runtime Error

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

num = 1

if N<K:
  print(num)
else:
  N // K = N
  num = num + 1

Submission status: Runtime Error

Solution code:
inp = input()
N = int(inp.split()[0])
R = int(inp.split()[1])
 
i = 0
for i in range(10000):
  s = R**i
  l = S*R
  if s < N and N < l:
     print(i+1)
     break

Submission status: Runtime Error

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

while n > 0:
	ans = []
	ans.append(n % k)
	n = int(n / k)
    k *= k

print(len(ans))

Submission status: Runtime Error

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

i = 1
while n > 0:
	ans = []
	ans.append(n % k**i)
	n = int(n / k)
    i += 1

print(len(ans))

Submission status: Runtime Error

Solution code:
def Base_10_to_K(N, K):
    if (int(N/K)):
        return Base_10_to_K(int(N/K), K)+str(N%K)
    return str(N%K)
print(len(str(N%K)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
N,K = map(int,imput().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(N, K)
print(len(A))

Submission status: Runtime Error

Solution code:
import fractions

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

ans = int(fractions.log(n, k) + 1.0)
print(ans)

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
data=[]
if N=0:
  print(N)
while N!=0:
  f=N%K
  N=N//K
  data.append(f)
  
data2=""
for i in range(len(data)):
  k=(i+1)*(-1)
  data=str(data)
  data2+=data(k)
data2=int(data2)
print(data2)

Submission status: Runtime Error

Solution code:
N, K = [int(x) for x in input().split(" ")]

i=1
x=K

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

print(i)

Submission status: Runtime Error

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

def calc(n, k):
    i = 1
    tmp = n
    while(j < k):
        tmp = j - k**i
        i+= 1
    return i+1

print(str(calc(n,k)))

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split())
c = 1
K_ = 1
i=True
while i==True:
  K_ = K_ * K
  if N < K_:
    print(c)
    i=False
  counter += 1

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split())
X = N
a = ""
while X > 0:
  a = str(X&K) + a
  X = X/K

  
print(a)

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split())
c = 1
K_ = 1
i=True
while i==True:
  K_ *= K
  if N < K_:
    print(c)
    i=False
  counter += 1

Submission status: Runtime Error

Solution code:
num, base = input()
print(int(log(int(num), int(base)) + 1)

Submission status: Runtime Error

Solution code:
def Base_10_to_n(N, K):
    if (int(N/K)):
        return Base_10_to_n(int(N/K), K)+str(N%K)
    return str(N%K)

x10 = 35
x2 = Base_10_to_n(N, K)
x2 = str(x2)
print(len(x2))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
	for a in range(1000):
        if K**a > N:
        	continue
        	print(a+1)

Submission status: Runtime Error

Solution code:
n,sin=map(int,input().split(' '))
while n>=sin:
    ls.append(n%sin)
    n=n//sin
ls.append(n)
print(len(ls))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

def finddigit(n, b):
    dig = (math.floor(math.log(n)/math.log(b))+1)
    print(dig)

finddigit(n,b)

Submission status: Runtime Error

Solution code:
def Base_n_to_10(X,n):
    out = 0
    for i in range(1,len(str(X))+1):
        out += int(X[-i])*(n**(i-1))
    return out#int out

N, K = input().split()
N = int(N)
K = int(K)
x = str(len(Base_n_to_10(N,K)))
print(x)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
N, K = input().split()
print(math.floor(math.log(K) / math.log(N)) + 1)

Submission status: Runtime Error

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

print(i)

Submission status: Runtime Error

Solution code:
N, K = [int(i) for i in input().split()]
print(int(math.floor(math.log(float(N)/math.pow(K,2), K))) + 1 + 2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
N, K = input().split()
print(math.floor(math.log(N) / math.log(K)) + 1)

Submission status: Runtime Error

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

print((math.floor(math.log(N) / math.log(K)) + 1))

Submission status: Runtime Error

Solution code:
import math

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

N = int(input())
X = math.log(N + 1, 2)
Y = math.ceil(X)

print(Y)

Submission status: Runtime Error

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

long long n,k;

inline long long qr()
{
    long long s=0,f=1;char ch=0;
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){s=(s<<3)+(s<<1)+(ch^48);ch=getchar();}
    return s*f;
}

int main()
{
    n=qr();
    k=qr();
    int cnt=1;
    long long p=k;
    while(n>k)
    {
        k*=p;
        cnt++;
    }
    cout<<cnt<<endl;
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
k=int(input())
cnt = 0

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

print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

int N, K;

int main() {
  cin >> N >> K;
  int ans = 0;
  while(N) {
    N /= K;
    ans++;
  }
  cout << ans;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import log2, floor

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

print(floor(log2(n)/log2(k)) + 1)

Submission status: Runtime Error

Solution code:
# coding: utf-8
N,k=map(int,input().split())

for i in range(N):
    if k**i>N:
        idx=i
        break
print(idx)

Submission status: Runtime Error

Solution code:
n, k = map(input().spilt())
y = 1
while n > 1:
    y += 1
    n = n // k
print(y)