ZhenlongDai/ACPR huggingface dataset:
Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
lb = 0
lw = 0
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == '0':
            lb += 1
        else:
            lw += 1
    else:
        if s[i] == '0':
            lw += 1
        else:
            lb += 1
print(max(lb,lw))

Failing test case input:
11101110

Expected output:
2


Actual output:
6


Fixed submission (verdict: Accepted):
s = input()
lb = 0
lw = 0
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == '0':
            lb += 1
        else:
            lw += 1
    else:
        if s[i] == '0':
            lw += 1
        else:
            lb += 1
print(min(lb,lw))

Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=[int(x) for x in list(input())]


e = [0, 1] * (int(len(s)/2) + 1)

h = [0, 0]
h[0] = sum([x == ei for x, ei in zip(s,e[0:len(s)])])
h[1] = sum([x == ei for x, ei in zip(s,e[1:len(s)])])

print(min(h))

Failing test case input:
01111110

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
s=[int(x) for x in list(input())]


e = [0, 1] * (int(len(s)/2) + 1)

h = [0, 0]
h[0] = sum([x == ei for x, ei in zip(s,e[0:len(s)])])
h[1] = sum([x == ei for x, ei in zip(s,e[1:len(s)+1])])

print(min(h))

Problem: p03073
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
 
n = len(S)
cnt = 0
 
for i in range(n):
  if int(S[i])%2 == i%2:
    cnt += 1
    
print(cnt)

Failing test case input:
01011101

Expected output:
1


Actual output:
7


Fixed submission (verdict: Accepted):
S = input()

n = len(S)
cnt = 0

for i in range(n):
  if int(S[i])%2 == i%2:
    cnt += 1
    
print(min(cnt, n-cnt))

Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
n = len(s)
count = 0
count2 = 0
print(s, len(s))
for i in range(n):
    if i % 2 == 0:
        x = "0"
    else:
        x = "1"
    if s[i] == x:
        count2 += 1
        
    else:
        count += 1
        
print(min(count,count2))

Failing test case input:
01110011

Expected output:
3


Actual output:
01110011 8
3


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
count = 0
count2 = 0
for i in range(n):
    if i % 2 == 0:
        x = "0"
    else:
        x = "1"
    if s[i] == x:
        count2 += 1
    else:
        count += 1
print(min(count,count2))
Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
n=len(s)-1
count=0
if s[0]=='0':
    for i in range(1,n):
        if i%2==1 and s[i]=='0':
            count+=1
        elif i%2==0 and s[i]=='1':
            count+=1
else:
    for i in range(1,n):
        if i%2==1 and s[i]=='1':
            count+=1
        elif i%2==0 and s[i]=='0':
            count+=1
print(count)

Failing test case input:
11100111

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
s=input()
n=len(s)
count=0
if s[0]=='0':
    for i in range(1,n):
        if i%2==1 and s[i]=='0':
            count+=1
        elif i%2==0 and s[i]=='1':
            count+=1
else:
    for i in range(1,n):
        if i%2==1 and s[i]=='1':
            count+=1
        elif i%2==0 and s[i]=='0':
            count+=1
print(count)

Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def test():
    s = list(map(int,list(input())))
    for i in range(len(s)-1):
        if s[i] == s[i+1]:
            s[i+1] ^= 1
    print(s) 


if __name__ == "__main__":
    test()


Failing test case input:
11110110

Expected output:
4


Actual output:
[1, 0, 1, 0, 1, 0, 1, 0]


Fixed submission (verdict: Accepted):
def test():
    s = list(map(int,list(input())))
    count = 0
    for i in range(len(s)-1):
        if s[i] == s[i+1]:
            s[i+1] ^= 1
            count += 1
    print(count)


if __name__ == "__main__":
    test()

Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=list(input())
x=0
y=0
for i in range(0,len(s)):
  if i%2==0:
    if s[i]=="0":
      x+=1
  else:
    if s[i]=="1":
      x+=1
      
for j in range(0,len(s)):
  if i%2==0:
    if s[i]=="1":
      y+=1
  else:
    if s[i]=="0":
      y+=1
      
print(min(x,y))      
  

Failing test case input:
10100001

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
s=list(input())
x=0
y=0
for i in range(0,len(s)):
  if i%2==0:
    if s[i]=="0":
      x+=1
  else:
    if s[i]=="1":
      x+=1
      
for j in range(0,len(s)):
  if j%2==0:
    if s[j]=="1":
      y+=1
  else:
    if s[j]=="0":
      y+=1
      
print(min(x,y))
Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())
S = list(S)

result = 0



tempChangedTile = S[0]

for index, tile in enumerate(S):
    
    if index == 0:
        tempChangedTile = tile
        continue
    
    try:
        if tempChangedTile != S[index+1]:
            tempChangedTile = S[index+1]
        else:
            result += 1
            if S[index + 1] == "0":
                tempChangedTile = "1"
            else:
                tempChangedTile = "0"
    except:
        pass

print(result)

Failing test case input:
01011010

Expected output:
4


Actual output:
2


Fixed submission (verdict: Accepted):
S = str(input())
S = list(S)

result = 0



tempChangedTile = S[0]

for index, tile in enumerate(S):
    
    try:
        if tempChangedTile != S[index+1]:
            tempChangedTile = S[index+1]
            
            
        else:
            
            
            result += 1
            if S[index + 1] == "0":
                tempChangedTile = "1"
            else:
                tempChangedTile = "0"
    except:
        pass

print(result)

Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



s = list(input())

cnt1=0
for i in range(len(s)):
        if s[i] is i%2:
                count1 += 1

cnt2=0
for i in range(len(s)):
        if s[i] is (i+1)%2:
                count1 += 1

print(min(cnt1,cnt2))

Failing test case input:
01111111

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):



s = list(input())
cnt1=0
for i in range(len(s)):
        if int(s[i]) == i%2:
                cnt1 += 1

cnt2=0
for i in range(len(s)):
        if int(s[i]) == (i+1)%2:
                cnt2 += 1

print(min(cnt1,cnt2))

Problem: p03073
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()
C = ['1', '0']
c = S[0]
cnt = 0
for i in range(1, len(S) - 1):
    if c == S[i]:
        c = C[ord(c) - ord('0')]
        cnt += 1
    else:
        c = S[i]
print(cnt)


Failing test case input:
01011010

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
S = input()
C = ['1', '0']
c = S[0]
cnt = 0
for i in range(1, len(S)):
    if c == S[i]:
        c = C[ord(c) - ord('0')]
        cnt += 1
    else:
        c = S[i]
print(cnt)

Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



s = list(input())

cnt1=0
for i in range(len(s)):
        if s[i] is i%2:
                cnt1 += 1

cnt2=0
for i in range(len(s)):
        if s[i] is (i+1)%2:
                cnt2 += 1

print(min(cnt1,cnt2))

Failing test case input:
11001010

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):



s = list(input())
cnt1=0
for i in range(len(s)):
        if int(s[i]) == i%2:
                cnt1 += 1

cnt2=0
for i in range(len(s)):
        if int(s[i]) == (i+1)%2:
                cnt2 += 1

print(min(cnt1,cnt2))
Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())

test0 = [x%2 for x in range(len(s))]
test1 = [x%2+1 for x in range(len(s))]

cnt0 = 0
cnt1 = 0

for i, v in enumerate(s):
    if int(v) != test0[i]:
        cnt0+=1
    if int(v) != test1[i]:
        cnt1+=1
        
print(min(cnt0, cnt1))

Failing test case input:
10101010

Expected output:
0


Actual output:
4


Fixed submission (verdict: Accepted):
s = str(input())

test0 = [x%2 for x in range(len(s))]
test1 = [x%2 for x in range(len(s) - 1)]
test1.insert(0, 1)

cnt0 = 0
cnt1 = 0

for i, v in enumerate(s):
    if int(v) != test0[i]:
        cnt0+=1
    if int(v) != test1[i]:
        cnt1+=1

print(min(cnt0, cnt1))

Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

a = int("".join(["0" if i%2 == 0 else "1" for i in range(len(S))]), 2)
b = -~a


a_ = int(S, 2) ^ a
b_ = int(S, 2) ^ b

cnt1 = 0
cnt2 = 0

for c1 in bin(a_)[2:]:
    if c1 == "1":
        cnt1 += 1

for c2 in bin(b_)[2:]:
    if c2 == "1":
        cnt2 += 1

if cnt1 > cnt2:
    print(cnt2)
else:
    print(cnt1)


Failing test case input:
10100010

Expected output:
1


Actual output:
5


Fixed submission (verdict: Accepted):
S = input()

a = int("".join(["0" if i%2 == 0 else "1" for i in range(len(S))]), 2)
b = int("".join(["0" if i%2 == 1 else "1" for i in range(len(S))]), 2)


a_ = int(S, 2) ^ a
b_ = int(S, 2) ^ b

cnt1 = 0
cnt2 = 0

for c1 in bin(a_)[2:]:
    if c1 == "1":
        cnt1 += 1

for c2 in bin(b_)[2:]:
    if c2 == "1":
        cnt2 += 1

if cnt1 > cnt2:
    print(cnt2)
else:
    print(cnt1)

Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import copy


def count_num_flip(S):
    num_flip = 0
    S_prev = S[0]
    for S_next in S[1:]:
        if S_prev == S_next:
            num_flip += 1
            S_prev = not S_next
    return num_flip


if __name__ == '__main__':
    S = [bool(int(x)) for x in input()]
    S_prime = copy.copy(S)
    S_prime[0] = not S_prime[0]
    print(min(count_num_flip(S), count_num_flip(S_prime) + 1))


Failing test case input:
00110101

Expected output:
2


Actual output:
6


Fixed submission (verdict: Accepted):
import copy


def count_num_flip(S):
    num_flip = 0
    S_prev = S[0]
    for S_next in S[1:]:
        if S_prev == S_next:
            num_flip += 1
            S_prev = not S_next
        else:
            S_prev = S_next
    return num_flip


if __name__ == '__main__':
    S = [bool(int(x)) for x in input()]
    S_prime = copy.copy(S)
    S_prime[0] = not S_prime[0]
    print(min(count_num_flip(S), count_num_flip(S_prime) + 1))
Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
l1 = a[::2]
l2 = a[1::2]
x, y = 0, 0
for i in range(len(l1)):
  if l1[i] =='1':
    x +=1
if i in range(len(l2)):
  if l2[i] =='0':
    y +=1
print(min(x +y,len(l1)-x + len(l2)-y))

Failing test case input:
10000111

Expected output:
4


Actual output:
2


Fixed submission (verdict: Accepted):
a = input()
l1 = a[::2]
l2 = a[1::2]
x, y = 0, 0
for i in range(len(l1)):
  if l1[i] =='1':
    x +=1
for i in range(len(l2)):
  if l2[i] =='0':
    y +=1
print(min(x +y,len(l1)-x + len(l2)-y))

Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
ans10 = 10**12
ans01 = 10**12
for i in range(len(s)):
  if i%2==0:
    if s[i]=="0":
      ans10+=1
    if s[i]=="1":
      ans01+=1
  if i%2==1:
    if s[i]=="1":
      ans10+=1
    if s[i]=="0":
      ans01+=1
print(min(ans10,ans01))

Failing test case input:
01100011

Expected output:
4


Actual output:
1000000000004


Fixed submission (verdict: Accepted):
s = input()
ans10 = 0
ans01 = 0
for i in range(len(s)):
  if i%2==0:
    if s[i]=="0":
      ans10+=1
    if s[i]=="1":
      ans01+=1
  if i%2==1:
    if s[i]=="1":
      ans10+=1
    if s[i]=="0":
      ans01+=1
print(min(ans10,ans01))

Problem: p03073
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S =input()
l=len(S)
N=int(S,2)

    
apopcount=0
bpopcount=0
for i in range(0,l):
  if i%2==0:
    if (N & 0b10**i)!=0:
   		apopcount+=1
    else:
      	bpopcount+=1
  else:
    if (N & 0b10**i)!=0:
    	bpopcount+=1
    else:
      	apopcount+=1
print(apopcount,bpopcount)
if apopcount<bpopcount:print(apopcount)
else:print(bpopcount) 

Failing test case input:
01111101

Expected output:
2


Actual output:
6 2
2


Fixed submission (verdict: Accepted):
S =input()
l=len(S)

    
apopcount=0
bpopcount=0
for i in range(0,l):
  if i%2==0:
    if int(S[i])==1:
   		apopcount+=1
    else:
      	bpopcount+=1
  else:
    if int(S[i])==1:
    	bpopcount+=1
    else:
      	apopcount+=1
if apopcount<bpopcount:print(apopcount)
else:print(bpopcount)
Problem: p02293
Buggy submission (Python3, verdict: Wrong Answer):
def dot(a,b):return a[0]*b[0] + a[1]*b[1]
def cross(a,b):return a[0]*b[1] - a[1]*b[0]

q = int(input())
for i in range(q):
    x0,y0,x1,y1,x2,y2,x3,y3 = [int(i) for i in input().split()]
    a = [x1-x0,y1-y0]
    b = [x3-x2,y3-y2]
    if dot(a,b) == 0 : print(1)
    elif cross(a,b) == 0 : print(2)
    else : print(0)
    print(a,b,dot(a,b))

Failing test case input:
3
0 -1 2 1 0 4 3 0
1 0 3 -2 1 0 0 16
0 0 1 0 0 1 0 0

Expected output:
0
0
1


Actual output:
0
[2, 2] [3, -4] -2
0
[2, -2] [-1, 16] -34
1
[1, 0] [0, -1] 0


Fixed submission (verdict: Accepted):
def dot(a,b):return a[0]*b[0] + a[1]*b[1]
def cross(a,b):return a[0]*b[1] - a[1]*b[0]

q = int(input())
for i in range(q):
    x0,y0,x1,y1,x2,y2,x3,y3 = [int(i) for i in input().split()]
    a = [x1-x0,y1-y0]
    b = [x3-x2,y3-y2]
    if dot(a,b) == 0 : print(1)
    elif cross(a,b) == 0 : print(2)
    else : print(0)

Problem: p02293
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())

def dot(a,b):
    return a[0] * b[0] + a[1] * b[1]

from math import sqrt
def s(a):
    return sqrt(a[0]**2 + a[1]**2)

for i in range(n):
    points = [int(j) for j in input().split()]
    p0 = points[:2]
    p1 = points[2:4]
    a = [p0[0]-p1[0],p0[1]-p1[1]]
    p2 = points[4:6]
    p3 = points[6:8]
    b = [p2[0]-p3[0],p2[1]-p3[1]]
    c = dot(a,b)/(s(a) * s(b))
    if c == 0:
        print(1)
    elif c == 1:
        print(2)
    else:
        print(0)

Failing test case input:
3
0 0 2 5 4 0 -2 0
1 0 6 0 2 1 -2 1
-1 -6 0 1 -1 0 -1 -3

Expected output:
0
2
0


Actual output:
0
0
0


Fixed submission (verdict: Accepted):
n = int(input())

def dot(a,b):
    return a[0] * b[0] + a[1] * b[1]

from math import sqrt
def s(a):
    return a[0]**2 + a[1]**2
for i in range(n):
    points = [int(j) for j in input().split()]
    p0 = points[:2]
    p1 = points[2:4]
    a = [p0[0]-p1[0],p0[1]-p1[1]]
    p2 = points[4:6]
    p3 = points[6:8]
    b = [p2[0]-p3[0],p2[1]-p3[1]]
    c = dot(a,b)**2/(s(a) * s(b))
    if c == 0:
        print(1)
    elif c == 1:
        print(2)
    else:
        print(0)

Problem: p02293
Buggy submission (Python3, verdict: Wrong Answer):
def dot(a,b):return a[0]*b[0] + a[1]*b[1]
def cross(a,b):return a[0]*b[1] - a[1]*b[0]

q = int(input())
for i in range(q):
    x0,y0,x1,y1,x2,y2,x3,y3 = [int(i) for i in input().split()]
    a = [x1-x0,y1-y0]
    b = [x3-x2,y3-y1]
    if dot(a,b) == 0 : print(1)
    elif cross(a,b) == 0 : print(2)
    else : print(0)

Failing test case input:
3
0 0 0 5 4 0 -4 0
1 0 6 0 2 1 -2 1
-1 -6 0 1 -1 0 -2 -4

Expected output:
1
2
0


Actual output:
0
0
0


Fixed submission (verdict: Accepted):
def dot(a,b):return a[0]*b[0] + a[1]*b[1]
def cross(a,b):return a[0]*b[1] - a[1]*b[0]

q = int(input())
for i in range(q):
    x0,y0,x1,y1,x2,y2,x3,y3 = [int(i) for i in input().split()]
    a = [x1-x0,y1-y0]
    b = [x3-x2,y3-y2]
    if dot(a,b) == 0 : print(1)
    elif cross(a,b) == 0 : print(2)
    else : print(0)
Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int, input().split())
x = 0
for i in range(20):
  if k**i > n:
    x = i
    break
print(x)

Failing test case input:
1568902019 2

Expected output:
31


Actual output:
0


Fixed submission (verdict: Accepted):
n,k = map(int, input().split())
x = 0
for i in range(100):
  if k**i > n:
    x = i
    break
print(x)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
for i in range(10):
    if n < k ** i:
        break
print(max(1,i))

Failing test case input:
1110111 3

Expected output:
13


Actual output:
9


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
for i in range(40):
    if n < k ** i:
        break
print(max(1,i))

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
counter = 0
n, k = map(int, input().split())
for i in range(100):
  if k ** i >= n:
    counter = i + 1
print(counter)

Failing test case input:
85892049 2

Expected output:
27


Actual output:
100


Fixed submission (verdict: Accepted):
counter = 0
n, k = map(int, input().split())
for i in range(100):
  if k ** i <= n:
    counter = i + 1
  else:
    break
print(counter)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = list(map(int,input().split()))
for i in range(100):
  if k**1 <= n < k**(i+1):
    print(i+1)

Failing test case input:
1010011 5

Expected output:
9


Actual output:
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100


Fixed submission (verdict: Accepted):
n,k = list(map(int,input().split()))
for i in range(100):
  if k**i <= n < k**(i+1):
    print(i+1)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = input().split()
a, b = int(a), int(b)
 
digit = 0
for i in range(20):
  if a <= b ** i - 1:
    digit = i
    break
    
print(digit)

Failing test case input:
1010000 2

Expected output:
20


Actual output:
0


Fixed submission (verdict: Accepted):
a, b = input().split()
a, b = int(a), int(b)
 
digit = 0
for i in range(100):
  if a <= b ** i - 1:
    digit = i
    break
    
print(digit)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
n,k=map(int,input().split())
for i in range(10):
  if k**i<=n and n<k**(i+1):
    print(i+1)
    sys.exit()
  

Failing test case input:
658939863 6

Expected output:
12


Actual output:

Fixed submission (verdict: Accepted):
import sys
n,k=map(int,input().split())
for i in range(n):
  if k**i<=n and n<k**(i+1):
    print(i+1)
    sys.exit()

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int, input().split())
 
for i in range(1,10):
  if n < k ** i:
    print(i)
    break

Failing test case input:
1110111 3

Expected output:
13


Actual output:

Fixed submission (verdict: Accepted):
n,k = map(int, input().split())

for i in range(1,50):
  if n < k ** i:
    print(i)
    break
Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int,input().split())

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

print(counter)

Failing test case input:
937416134 2

Expected output:
30


Actual output:
29


Fixed submission (verdict: Accepted):
N, K = map(int,input().split())

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

print(counter)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
count,rank = 1,3
while a < rank:
  count += 1
  rank *= 3
print(count)

Failing test case input:
49139062 3

Expected output:
17


Actual output:
1


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
count,rank = 1,b
while a >= rank:
  count += 1
  rank *= b
print(count)

Problem: p02766
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
49139062 6

Expected output:
10


Actual output:
4535113154


Fixed submission (verdict: Accepted):
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(len(answer))

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=map(int, input().split()) 
for i in range(10):
    if K**i<N<=K**(i+1):
        print(i+1)

Failing test case input:
658939863 6

Expected output:
12


Actual output:

Fixed submission (verdict: Accepted):
N,K=map(int, input().split()) 
for i in range(8000):
    if K**i<=N<K**(i+1):
        print(i+1)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
c=1
d=0
while 1:
  a-=c
  d+=1
  if a<=0:
    break
  
  c*=b
print(d)

Failing test case input:
479704266 6

Expected output:
12


Actual output:
13


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
c=1
d=0
while 1:
  
  
  if a-c<0:
    break
  d+=1
  c*=b
  
print(d)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int,input().split())
for i in range(10**10):
    if i**k >= n :
        ans = i
        break
print(ans)

Failing test case input:
35134125 7

Expected output:
9


Actual output:
12


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
for i in range(10**10):
    if k**i > n :
        ans = i
        break
print(ans)
Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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)


print(Base_10_to_n(n, k))




Failing test case input:
85892049 2

Expected output:
27


Actual output:
101000111101001101111010001


Fixed submission (verdict: Accepted):

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)


a = Base_10_to_n(n, k)

print(len(a))

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
print(n,k)
ans=1
f=0
while ans < n:
    ans*=k
    f+=1
print(f)

Failing test case input:
0011001 5

Expected output:
6


Actual output:
11001 5
6


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
ans=1
f=0
while ans < n+1:
    ans*=k
    f+=1
print(f)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
cnt = 1
while True:
  if n <= k**cnt + 1:
    cnt += 1
  else:
    break
print(cnt)

Failing test case input:
1010001 3

Expected output:
13


Actual output:
1


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
cnt = 1
while True:
  if n <= k**cnt - 1:
    break
  cnt += 1
print(cnt)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


i = 1
nums = input()
nums = nums.split(' ')
print(nums)
x, y = (int(val) for val in nums)

while x > y:
    x = x / y
    i += 1

print(i)


Failing test case input:
0011011 6

Expected output:
6


Actual output:
['0011011', '6']
6


Fixed submission (verdict: Accepted):


i = 1
nums = input()
nums = nums.split(' ')
x, y = (int(val) for val in nums)

while x >= y:
    x = x / y
    i += 1

print(i)

Problem: p02766
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
MM = input().split()
N = int(MM[0])
K = int(MM[1])
for i in range(11):
  if K**i > N:
    print(i)
    break

Failing test case input:
29240007 3

Expected output:
16


Actual output:

Fixed submission (verdict: Accepted):
MM = input().split()
N = int(MM[0])
K = int(MM[1])
for i in range(1000000000000):
  if K**i > N:
    print(i)
    break

Problem: p02766
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N,K = map(int, input().split())

Sum = 1

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

Failing test case input:
0011011 6

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
N,K = map(int, input().split())

Sum = 0

while True:
    Sum += 1

    if K ** Sum > N:
        break

print(Sum)
Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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( N )

Failing test case input:
1010011 5

Expected output:
9


Actual output:
224310021


Fixed submission (verdict: Accepted):
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(str(N)) )

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
if K == 10:
  print(len(str(N)))
else:
  res = 1
  while K < N:
    res += 1
    K **= 2
  print(res)

Failing test case input:
0110111 5

Expected output:
8


Actual output:
4


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
if K == 10:
  print(len(str(N)))
else:
  res = 1
  KK = K
  while KK <= N:
    res += 1
    KK *= K
  print(res)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,p=map(int,input().split())
for i in range(10000):
  if p**i<=n<p**(i+1):
    print(i-1)
    exit()

Failing test case input:
89316102 4

Expected output:
14


Actual output:
12


Fixed submission (verdict: Accepted):
n,p=map(int,input().split())
for i in range(10000):
  if p**i<=n<p**(i+1):
    print(i+1)
    exit()

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split(' '))

maxDigits = 0
for i in range(10):
  if N/K**i >= 1:
    maxDigits = i+1

print(maxDigits)

Failing test case input:
325680770 3

Expected output:
18


Actual output:
10


Fixed submission (verdict: Accepted):
N, K = map(int, input().split(' '))

maxDigits = 0

for i in range(1000):
  if N/K**i >= 1:
    maxDigits = i+1
  else:
    break;

print(maxDigits)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K= map(int, input().split())
A = 0
cnt = -1
if N == 0:
    print(1)
else:
    while N >= A:
        cnt += 1
        A = K**(cnt+1)-1
        print(A)
    print(cnt+1)

Failing test case input:
1110111 2

Expected output:
21


Actual output:
1
3
7
15
31
63
127
255
511
1023
2047
4095
8191
16383
32767
65535
131071
262143
524287
1048575
2097151
21


Fixed submission (verdict: Accepted):
N,K= map(int, input().split())
A = 0
cnt = -1
if N <= K-1:
    print(1)
else:
    while N > A:
        cnt += 1
        A = K**(cnt+1)-1
    print(cnt+1)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
nt,kt = input().split()
n = int(nt)
k = int(kt)
i = 1
while n > (k ** i):
  i = i+1
    
print(i +1)


Failing test case input:
1110111 6

Expected output:
8


Actual output:
9


Fixed submission (verdict: Accepted):
nt,kt = input().split()
n = int(nt)
k = int(kt)
i = 1
while n >= (k ** i):
  i = i+1
    
print(i)
Problem: p02766
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, k = map(int, input().split())
counter = 1
while n >= k:
    n = int(n / k)
    counter += 1
    print(n)
print(counter)


Failing test case input:
1010111 2

Expected output:
20


Actual output:
505055
252527
126263
63131
31565
15782
7891
3945
1972
986
493
246
123
61
30
15
7
3
1
20


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
counter = 1
while n >= k:
    n = int(n / k)
    counter += 1
print(counter)

Problem: p02766
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys








mod = int(1e9+7)
INF = 1<<29

def main():
    n,k = map(int,input().split())
    ans = 1
    while k ** ans < n - k:
        ans += 1
    print(ans)
    return

if __name__=='__main__':
    main()


Failing test case input:
0010001 10

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
import sys








mod = int(1e9+7)
INF = 1<<29

def main():
    n,k = map(int,input().split())
    ans = 1
    while k ** ans <= n:
        ans += 1
    print(ans)
    return

if __name__=='__main__':
    main()

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

n=10**9
r=2
for i in range(40,-1,-1):
    if r**i<=n:
        ans=i+1
        break
print(ans)

Failing test case input:
1010001 8

Expected output:
7


Actual output:
30


Fixed submission (verdict: Accepted):
import math
n,r=list(map(int,input().split()))


for i in range(40,-1,-1):
    if r**i<=n:
        ans=i+1
        break
print(ans)

Problem: p02766
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = map(int,input().split())
n2 = k
count = 0
while n2 <= n:
  n2*=k
  count+=1
print(n2)
print(count+1)

Failing test case input:
1010101 8

Expected output:
7


Actual output:
2097152
7


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
n2 = k
count = 0
while n2 <= n:
  n2*=k
  count+=1
print(count+1)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
cnt = 0
while N > 1:
    N = int(N / M)
    cnt += 1
print(cnt + 1)

Failing test case input:
159666378 5

Expected output:
12


Actual output:
13


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
cnt = 0
while  True:
    N = int(N 
    cnt += 1
    if N == 0:
        break
print(cnt)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

c =0
while n>(k-1):
    a = n%k
    n = (n-a)/k
    print(n)
    c += 1
print(c+1)

Failing test case input:
0011001 5

Expected output:
6


Actual output:
2200.0
440.0
88.0
17.0
3.0
6


Fixed submission (verdict: Accepted):

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

c =0
while n>(k-1):
    a = n%k
    n = (n-a)/k
    c += 1
print(c+1)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=map(int,input().split())
i=0
while N>K**i:
  i=i+1
else:
  print(i+1)

Failing test case input:
0110111 9

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
i=0
while N>=K**i:
  i=i+1
else:
  print(i)
Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int, input().split())

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

Failing test case input:
52006666 4

Expected output:
13


Actual output:

Fixed submission (verdict: Accepted):
n,k = map(int, input().split())

for i in range(1,50):
  if n < k ** i:
    print(i)
    break

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=map(int,input().split())
J=K
ans=0

while N>J:
    J=J*K
    ans+=1

print(ans)

Failing test case input:
85892049 2

Expected output:
27


Actual output:
26


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
J=K
ans=1

while N>=J:
    J=J*K
    ans+=1

print(ans)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
tmp = 0
for i in range(1, n):
    tmp += k**i
    if n <= tmp:
        print(i+1)
        break

Failing test case input:
1110111 7

Expected output:
8


Actual output:
9


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
for i in range(n):
    if k**i <= n and n < k**(i+1):
        print(i+1)
        break

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int, input().split())

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

Failing test case input:
1110111 2

Expected output:
21


Actual output:

Fixed submission (verdict: Accepted):
n,k = map(int, input().split())

for i in range(1,50):
  if n < k ** i:
    print(i)
    break

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
strings = input().split(' ')
N = int(strings[0])
K = int(strings[1])
 
ans = 1
max = 1

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

Failing test case input:
0110111 10

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):
strings = input().split(' ')
N = int(strings[0])
K = int(strings[1])
 
ans = 1
max = K

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

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
 
tmp = 1
for i in range(100):
    tmp = k * tmp

    if n < tmp:
        print(i)
        exit()

Failing test case input:
658939863 6

Expected output:
12


Actual output:
11


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
 
tmp = 1
for i in range(100):
    tmp = k * tmp

    if n < tmp:
        print(i+1)
        exit()

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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 = 0
x10, n = input().split()
print(int(x10), int(n))
x10 = int(x10)
n = int(n)
x2 = Base_10_to_n(x10, n)
print( len(x2) )

Failing test case input:
1110111 7

Expected output:
8


Actual output:
1110111 7
8


Fixed submission (verdict: Accepted):
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 = 0
x10, n = input().split()
x10 = int(x10)
n = int(n)
x2 = Base_10_to_n(x10, n)
print(len(x2))
Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
cnt = 1
while True:
  if n <= k**cnt + 1:
    break
  cnt += 1
print(cnt)

Failing test case input:
0010001 10

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
cnt = 1
while True:
  if n <= k**cnt - 1:
    break
  cnt += 1
print(cnt)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int, input().split())
 
for i in range(1,10):
  if n <= k ** i - 1:
    print(i)
    break

Failing test case input:
4000772700 2

Expected output:
32


Actual output:

Fixed submission (verdict: Accepted):
n,k = map(int, input().split())

for i in range(1,50):
  if n < k ** i:
    print(i)
    break

Problem: p02766
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k=map(int,input().split())
for i in range(100):
  if k**i>n:
    print(i+1)
    break

Failing test case input:
1110111 5

Expected output:
9


Actual output:
10


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
for i in range(100):
  if k**i>n:
    print(i)
    break

Problem: p02766
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N, K = map(int, input().split())

M = 0
i = 0

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

Failing test case input:
279134799 3

Expected output:
18


Actual output:
19


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())

M = 0
i = 0

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

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
i = 1
while k ** i < n:
    i += 1
print(i+1)

Failing test case input:
325680770 3

Expected output:
18


Actual output:
19


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
i = 1
while k ** i <= n:
    i += 1
print(i)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())

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


Failing test case input:
4000772700 2

Expected output:
32


Actual output:

Fixed submission (verdict: Accepted):
N, K = map(int, input().split())

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

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
count,rank = 1,b
while a < rank:
  count += 1
  rank *= b
print(count)

Failing test case input:
314159265 4

Expected output:
15


Actual output:
1


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
count,rank = 1,b
while a >= rank:
  count += 1
  rank *= b
print(count)
Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
i = 1
while True:
    if n - k**i > 1:
        i+=1
        n -= k ** i
    else:
        i+=1
        break
print(i)

Failing test case input:
1110111 6

Expected output:
8


Actual output:
9


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
i = 1
r = 1
while True:
    if n - k**r >= 0:
        pass
    else:
        if k > n:
            i = 1
        break
    i+=1
    r+=1
print(i)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N,K = list(map(int,input().split()))

print(math.ceil(math.log(N,K)+1))

Failing test case input:
279733938 5

Expected output:
13


Actual output:
14


Fixed submission (verdict: Accepted):
import math
N,K = list(map(int,input().split()))

print(int(math.log(N,K)+1))

Problem: p02766
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, k = map(int, input().split())
counter = 1
while not n <= 1:
    n = int(n / k)
    counter += 1
print(counter)


Failing test case input:
1010111 5

Expected output:
9


Actual output:
10


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
counter = 1
while n >= k:
    n = int(n / k)
    counter += 1
print(counter)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())

i = 0
ans = 0
while i <= 10**9:
    if N == 1:
        ans = 1
        break
    elif K==10&N==10:
        ans = 2
        break
    elif N <= K:
        ans = 1
        break
    elif K**i < N:
        i += 1
    else :
        ans = i
        break
print(ans)

Failing test case input:
1110011 10

Expected output:
7


Actual output:
2


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())

i = 0
ans = 0
while i <= 10**9:
    if N < K:
        ans = 1
        break
    elif N == K:
        ans = 2
        break
    elif K**i > N:
        ans =  i
        break
    else :
         i += 1 
print(ans)

Problem: p02766
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
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)

print(Base_10_to_n(N,K))

Failing test case input:
0010001 8

Expected output:
5


Actual output:
23421


Fixed submission (verdict: Accepted):
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)

print(len(Base_10_to_n(N,K)))

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int,input().split())
ans = 1
while n != 0:
  n = int(n / k)
  ans += 1
print(ans)

Failing test case input:
550505180 3

Expected output:
19


Actual output:
20


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
ans = 0
while n != 0:
  n = int(n / k)
  ans += 1
print(ans)
Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l=input().split()
N=int(l[0])
K=int(l[1])
cnt=0
a=N

while True:
  a=a/K
  cnt+=1
  if a==0:break

print(a)

Failing test case input:
0110111 5

Expected output:
8


Actual output:
0.0


Fixed submission (verdict: Accepted):
import math

l=input().split()
N=int(l[0])
K=int(l[1])
cnt=0
a=N

while True:
    a=math.floor(a/K)
    cnt+=1
    if a==0:break

print(cnt)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

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

Failing test case input:
1010001 2

Expected output:
20


Actual output:

Fixed submission (verdict: Accepted):

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

i = 1
while N >= K ** i:
    if N >= K ** i:
        i += 1

print(i)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=map(int,input().split())
c=0
while N/K>=1:
    N=N/K
    c+=1
print(c)

Failing test case input:
0010001 8

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
c=1
while N>=K**c:
    c+=1
print(c)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
def transform(X, n):
    print(int(X/n))
    if (int(X/n)):
        return transform(int(X/n), n)+str(X%n)
    return str(X%n)

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


Failing test case input:
1010111 5

Expected output:
9


Actual output:
202022
40404
8080
1616
323
64
12
2
0
9


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
def transform(X, n):
    if (int(X/n)):
        return transform(int(X/n), n)+str(X%n)
    return str(X%n)

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

Problem: p02766
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N,K = map(int,input().split())
for i in range(N):
    if N >=2**i and N <2**(i+1):
        print(i+1)
        break

Failing test case input:
0011011 9

Expected output:
5


Actual output:
14


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
for i in range(N):
    if N >=K**i and N <K**(i+1):
        print(i+1)
        break

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n,k = map(int,input().split())
if n == 1:
  ans = 1
else:
  ans = math.ceil(math.log(k,n))
print(ans)

Failing test case input:
1110111 2

Expected output:
21


Actual output:
1


Fixed submission (verdict: Accepted):
import math
n,k = map(int,input().split())
if n == 1:
  ans = 1
else:
  ans = math.ceil(math.log(n,k))
print(ans)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
N,K = [int(x) for x in stdin.readline().rstrip().split()]
ans = 0
for k in range(1000000):
    N -= (K**k)
    if N < 0:
        break
    ans += 1
    
print(ans)

Failing test case input:
89316102 4

Expected output:
14


Actual output:
13


Fixed submission (verdict: Accepted):
from sys import stdin
N,K = [int(x) for x in stdin.readline().rstrip().split()]
ans = 0
for k in range(10000000):
    if N < K**k:
        break
    
print(k)
Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K = map(int,input().split())
c = 1
s = 1
while(s<N):
    s *= K
    c += 1
print(c)

Failing test case input:
86816898 6

Expected output:
11


Actual output:
12


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
c = 0
s = 1
while(s<=N):
    s *= K
    c += 1
print(c)

Problem: p02766
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
0010101 8

Expected output:
5


Actual output:
1
9
73
585
4681
37449
6


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
X=0
i=0
while X<N:
    X=X+(K-1)*K**i
    i=i+1
print(i)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N, K = map(int, readline().split())
  ans = math.log(1,2)
  print(math.ceil(ans))
  
  
  
if __name__ == '__main__':
  main()

Failing test case input:
0000101 8

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
import sys
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N, K = map(int, readline().split())
  if N<K:
    ans = 1
  else:
    ans = math.ceil(math.log(N,K))
  print(ans)
  
  
  
if __name__ == '__main__':
  main()

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int,input().split())
pointer = 0
while (2**pointer < n):
  if 2**pointer < n:
    pointer += 1
    
print(pointer)

Failing test case input:
1010001 3

Expected output:
13


Actual output:
20


Fixed submission (verdict: Accepted):
n, k = map(int,input().split())
pointer = 0
while (k**pointer <= n):
    pointer += 1
    
print(pointer)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

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

print(i)

Failing test case input:
0011011 6

Expected output:
6


Actual output:
1


Fixed submission (verdict: Accepted):

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

i = 1
while N >= K ** i:
    if N >= K ** i:
        i += 1

print(i)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n,k = map(int, input().split())

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

Failing test case input:
0110111 10

Expected output:
6


Actual output:
1620


Fixed submission (verdict: Accepted):
import math
n,k = map(int, input().split())

N = int(math.floor(math.log(n)/math.log(k)))
L = []
for i in range(N+1):
  L.append(n
  n = n % k**(N-i)
  
print(len(L))
Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K = map(int,input().split())
N =+ 1
ans = 1
for i in range(1000000): 
	if K**(ans) < N:
		ans += 1
	else:
		print(ans)
		break

Failing test case input:
279733938 5

Expected output:
13


Actual output:
1


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
N += 1
ans = 1
for i in range(1000000): 
	if K**(ans) < N:
		ans += 1
	else:
		print(ans)
		break

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def base10to(n, b):
  if (int(n/b)):
    return base10to(int(n/b), b) + str(n%b)
  return str(n%b)
N, K = map(int, input().split())
print(base10to(N, K))

Failing test case input:
0001111 5

Expected output:
5


Actual output:
13421


Fixed submission (verdict: Accepted):
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)))

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

x10 = X 
x2 = Base_10_to_n(x10, 2)
print(len(x2))

Failing test case input:
1110111 7

Expected output:
8


Actual output:
21


Fixed submission (verdict: Accepted):
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)

x10 = X 
x2 = Base_10_to_n(x10, n)
print(len(x2))

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=map(int, input().split()) 
for i in range(10):
    if K**i<=N<=K**(i+1):
        print(i+1)

Failing test case input:
29240007 3

Expected output:
16


Actual output:

Fixed submission (verdict: Accepted):
N,K=map(int, input().split()) 
for i in range(8000):
    if K**i<=N<K**(i+1):
        print(i+1)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K = map(int,input().split())
Count=0
while N > 0:
  N = int(N/K)
  print(N)
  Count=Count+1
print(Count)

Failing test case input:
0011011 6

Expected output:
6


Actual output:
1835
305
50
8
1
0
6


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
Count=0
while N > 0:
  N = int(N/K)
  Count=Count+1
print(Count)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int, input().split())
x = 0
for i in range(30):
  if k**i > n:
    x = i
    break
print(x)

Failing test case input:
1568902019 2

Expected output:
31


Actual output:
0


Fixed submission (verdict: Accepted):
n,k = map(int, input().split())
x = 0
for i in range(100):
  if k**i > n:
    x = i
    break
print(x)

Problem: p02766
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, R = map(int, input().split())
if N >= 10:
    ans = R
else:
    ans = R + 100 * (10 - N)
    
print(ans)   

Failing test case input:
325680770 3

Expected output:
18


Actual output:
3


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())

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