ZhenlongDai/ACPR huggingface dataset:
Problem: p03588
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = [input().split() for i in range(n)]
m = []

for i in l:
    m.append(i[0])
    
max_a = max(m)
a_num = m.index(max_a)
a = int(l[a_num][0])
b = int(l[a_num][1])
if b != 0:
    print(a + b)
else:
    print(a + b + 1)

Failing test case input:
2
1 1011000010
0001110011 2

Expected output:
1110013


Actual output:
1011000011


Fixed submission (verdict: Accepted):
n = int(input())
l = [input().split() for i in range(n)]
m = []

for i in l:
    m.append(int(i[0]))
    
max_a = max(m)
a_num = m.index(max_a)

b = int(l[a_num][1])
print(max_a + b)

Problem: p03588
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    N = int(input())
    A =[]
    B =[]
    for i in range(N):
        a,b = map(int,input().split())
        A.append(a)
        B.append(b)
    A.sort()
    B.sort(reverse = True)
    
    
    ans = 0
    ans += len(A)
    for i in range(len(A)-1):
        ans += A[i+1] - A[i] - 1
    
    ans += B[len(A)-1]
    
    tmp = A[0]-1
    if B[0]+tmp > 1000000000:
        ans += 1000000000 - B[0]
    else:
        ans += tmp

    return ans

print(main())


Failing test case input:
2
-1 1010100011
0101111011 0

Expected output:
101111011


Actual output:
91011002


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    A =[]
    B =[]
    for i in range(N):
        a,b = map(int,input().split())
        A.append(a)
        B.append(b)
    A.sort()
    B.sort(reverse = True)
    
    
    ans = 0
    ans += len(A)
    for i in range(len(A)-1):
        ans += A[i+1] - A[i] - 1
    
    ans += B[len(A)-1]
    
    tmp = A[0]-1
    
        
    
    ans += tmp

    return ans

print(main())

Problem: p03588
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
people = {}
for i in range(N):
	ai, bi = map(int, input().split())
	people[ai] = bi

max_key = max([(k,v) for k,v in people.items()])[0]

min_value = people[max_key]
count = N + min_value
print(count)


Failing test case input:
2
0 1011000011
0001111011 1

Expected output:
1111012


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
people = {}
for i in range(N):
	ai, bi = map(int, input().split())
	people[ai] = bi
 
max_key = max([(k,v) for k,v in people.items()])[0]
min_key = max([(k,v) for k,v in people.items()])[0]
range_key = max_key - min_key + 1
 
count = people[max_key] + min_key -1 + range_key
print(count)

Problem: p03588
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = []
B = []
for i in range(N):
  a, b = map(int, input().split())
  A.append(a)
  B.append(b)
print(min(A)+B[A.index(max(A))])

Failing test case input:
3
4 5
2 9
6 3

Expected output:
9


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
A = []
B = []
for i in range(N):
  a, b = map(int, input().split())
  A.append(a)
  B.append(b)
print(max(A)+B[A.index(max(A))])
Problem: p03588
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
temp = 0
ans = 0
for i in range(n):
    a,b = map(int,input().split(' '))
    if a > temp:
        ans = a + b
print(ans)

Failing test case input:
5
1 10
3 6
5 2
4 4
2 8

Expected output:
7

Actual output:
10


Fixed submission (verdict: Accepted):

n = int(input())
temp = 0
ans = 0
for i in range(n):
    a,b = map(int,input().split(' '))
    if a > temp:
        ans = a + b
        temp = a
print(ans)

Problem: p03588
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,*a=map(int,open(0).read().split())
b=max([a[i]for i in range(0,len(a),2)])
print(b+a[a.index(b)+1])

Failing test case input:
2
1 1000000000
1000000000 1

Expected output:
1000000001

Actual output:
2000000000


Fixed submission (verdict: Accepted):
n,*a=map(int,open(0).read().split())
b=[a[i]for i in range(0,len(a),2)]
c=[a[i]for i in range(1,len(a),2)]
print(max(b)+c[b.index(max(b))])

Problem: p03588
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = []
B = []
for i in range(N):
  a, b = map(int, input().split())
  A.append(a)
  B.append(b)
print(min(A)+B[A.index(min(A))])

Failing test case input:
2
0 0011101111
1110101101 0

Expected output:
1110101101


Actual output:
11101111


Fixed submission (verdict: Accepted):
N = int(input())
A = []
B = []
for i in range(N):
  a, b = map(int, input().split())
  A.append(a)
  B.append(b)
print(max(A)+B[A.index(max(A))])

Problem: p03588
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())

max=0
for i in range(n):
    a,b=map(int,input().split())
    if a>max: ans=a+b

print(ans)

Failing test case input:
3
8 3
2 14
3 3

Expected output:
11


Actual output:
6


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

max=0
for i in range(n):
    a,b=map(int,input().split())
    if a>max: max=a; ans=a+b

print(ans)

Problem: p03588
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

p = 0
s = 0

for i in range(n):
    a,b = [int(x) for x in input().split()]
    if i == 0:
        p,s = a,b
    else:
        if p > a:
            p,s = a,b
        else:
            pass

print(p+s)

Failing test case input:
2
-2 0011101111
0011011011 1

Expected output:
11011012


Actual output:
11101109


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

p = 0
s = 0

for i in range(n):
    a,b = [int(x) for x in input().split()]
    if i == 0:
        p,s = a,b
    else:
        if a > p:
            p,s = a,b
        else:
            pass

print(p+s)

Problem: p03588
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = [input().split() for i in range(n)]
m = []

for i in l:
    m.append(i[0])
    
max_a = max(m)
a_num = m.index(max_a)
a = int(l[a_num][0])
b = int(l[a_num][1])
print(a + b)

Failing test case input:
2
6 0001101000
0100100001 0

Expected output:
100100001


Actual output:
1101006


Fixed submission (verdict: Accepted):
n = int(input())
l = [input().split() for i in range(n)]
m = []

for i in l:
    m.append(int(i[0]))
    
max_a = max(m)
a_num = m.index(max_a)

b = int(l[a_num][1])
print(max_a + b)
Problem: p03504
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,C = map(int,input().split())
r = [[0]*(10**5) for c in range(C)]
for i in range(N):
    s,t,c = map(int,input().split())
    r[c-1][s-1:t+1] = [1]*(t-s+1)
r = list(map(sum,zip(*r)))
print(max(r))

Failing test case input:
9 4
56 60 4
33 37 2
89 90 3
32 43 2
67 68 3
71 51 3
31 32 3
70 71 1
11 12 3

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N,C = map(int,input().split())
r = [[0]*(10**5) for c in range(C)]
for i in range(N):
    s,t,c = map(int,input().split())
    r[c-1][s-1:t] = [1]*(t-s+1)
print(max(map(sum,zip(*r))))

Problem: p03504
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, C = map(int, input().split())
programs = [0] * (2 * (10**5 + 1))
for i in range(N):
    si, ti, ci = map(int, input().split())
    si = si - 0.5
    for j in range(int(2*si), 2*ti-1):
        programs[j] += 1
print(max(programs))


Failing test case input:
3 2
1 7 2
7 8 1
8 12 1

Expected output:
2

Actual output:
1


Fixed submission (verdict: Accepted):
N, C = map(int, input().split())
programs = [[0 for _ in range(C)] for _ in range(10**5)]
for _ in range(N):
    s, t, c = map(int, input().split())
    for i in range(s-1, t):
        programs[i][c-1] = 1
ret = 0
for i in range(10**5):
    ret = max(ret, sum(programs[i]))
print(ret)

Problem: p03504
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,C=map(int,input().split())
Time=[[0]*(10**5+1)]*C
for i in range(N):
  s,t,c=map(int,input().split())
  Time[c-1][s-1:t]=[1]*(t-s+1)
Times=max(map(sum,zip(*Time)))
print(Times)

Failing test case input:
2 4
56 73 4
26 37 2
89 37 5
32 73 2
108 68 3
71 68 3
31 62 3
70 96 1
11 12 3

Expected output:
1


Actual output:
4


Fixed submission (verdict: Accepted):
N,C=map(int,input().split())
Time=[[0]*(10**5+1) for c in range(C)]
for i in range(N):
  s,t,c=map(int,input().split())  
  Time[c-1][s-1:t] = [1]*(t-s+1)
Times=max(map(sum,zip(*Time)))
print(Times)
Problem: p03735
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
N=int(input())
A=[]
C=[]
D=[]
for i in range(N):
    a,b=map(int,input().split())
    c,d=min(a,b),max(a,b)
    A.append((c,d))
    C.append(c)
    D.append(d)

if N==1:
    print(0)
    sys.exit()
ans=(max(C)-min(C))*(max(D)-min(D))
cur=min(D)
ma=min(D)
T=10**19
for a,b in A:
    if a>ma:
        T=min(T,cur-ma)
        break
    T=min(T,cur-a)
    cur=max(cur,b)

print(min(ans,(max(D)-min(C))*T))

Failing test case input:
3
0000 15
1010 1
44 294

Expected output:
43430


Actual output:
14140


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
N=int(input())
A=[]
C=[]
D=[]
for i in range(N):
    a,b=map(int,input().split())
    c,d=min(a,b),max(a,b)
    A.append((c,d))
    C.append(c)
    D.append(d)
A.sort()

if N==1:
    print(0)
    sys.exit()
ans=(max(C)-min(C))*(max(D)-min(D))
cur=max(C)
ma=min(D)
T=10**19
for a,b in A:
    if a>ma:
        T=min(T,cur-ma)
        break
    T=min(T,cur-a)
    cur=max(cur,b)
print(min(ans,(max(D)-min(C))*T))

Problem: p03735
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
balls = sorted(tuple(sorted(map(int,input().split()))) for i in range(N))


maxmin = balls[-1][0]
minmin = balls[0][0]
maxmax = max(b[1] for b in balls)
minmax = min(b[1] for b in balls)

v1 = (maxmin-minmin)*(maxmax-minmax)


best = float('inf')
cur_max = minmax
for b in balls:
  best = min(best, cur_max-b[0])
  cur_max = max(cur_max, b[1])

v2 = (maxmax-minmin)*best

print(min(v1,v2))

Failing test case input:
3
1111 -2
0000 1
138 186

Expected output:
155400


Actual output:
3339


Fixed submission (verdict: Accepted):
N = int(input())
balls = sorted(tuple(sorted(map(int,input().split()))) for i in range(N))


maxmin = balls[-1][0]
minmin = balls[0][0]
maxmax = max(b[1] for b in balls)
minmax = min(b[1] for b in balls)

v1 = (maxmin-minmin)*(maxmax-minmax)


best = float('inf')
cur_max = maxmin
for b in balls:
  if b[0] > minmax:
    best = min(best, cur_max-minmax)
    break
  best = min(best, cur_max-b[0])
  cur_max = max(cur_max, b[1])
 
v2 = (maxmax-minmin)*best

print(min(v1,v2))
Problem: p03735
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
N=int(input())
A=[]
C=[]
D=[]
for i in range(N):
    a,b=map(int,input().split())
    c,d=min(a,b),max(a,b)
    A.append((c,d))
    C.append(c)
    D.append(d)

if N==1:
    print(0)
    sys.exit()
ans=(max(C)-min(C))*(max(D)-min(D))
cur=min(D)
ma=min(D)
T=10**19
for a,b in A:
    if a>ma:
        T=min(T,cur-ma)
        break
    T=min(T,cur-a)
    cur=max(cur,b)
print(min(ans,(max(D)-min(C))*T))

Failing test case input:
2
1 1
1000000010 0000100000

Expected output:
99999000899991


Actual output:
0


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
N=int(input())
A=[]
C=[]
D=[]
for i in range(N):
    a,b=map(int,input().split())
    c,d=min(a,b),max(a,b)
    A.append((c,d))
    C.append(c)
    D.append(d)
A.sort()

if N==1:
    print(0)
    sys.exit()
ans=(max(C)-min(C))*(max(D)-min(D))
cur=max(C)
ma=min(D)
T=10**19
for a,b in A:
    if a>ma:
        T=min(T,cur-ma)
        break
    T=min(T,cur-a)
    cur=max(cur,b)
print(min(ans,(max(D)-min(C))*T))

Problem: p03735
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
balls = sorted(tuple(sorted(map(int,input().split()))) for i in range(N))


maxmin = balls[-1][0]
minmin = balls[0][0]
maxmax = max(b[1] for b in balls)
minmax = min(b[1] for b in balls)

v1 = (maxmin-minmin)*(maxmax-minmax)


best = float('inf')
cur_max = minmax
for b in balls:
  if b[0] > minmax:
    break
  best = min(best, cur_max-b[0])
  cur_max = max(cur_max, b[1])

v2 = (maxmax-minmin)*best

print(min(v1,v2))

Failing test case input:
3
1111 -2
0000 1
138 186

Expected output:
155400


Actual output:
3339


Fixed submission (verdict: Accepted):
N = int(input())
balls = sorted(tuple(sorted(map(int,input().split()))) for i in range(N))


maxmin = balls[-1][0]
minmin = balls[0][0]
maxmax = max(b[1] for b in balls)
minmax = min(b[1] for b in balls)

v1 = (maxmin-minmin)*(maxmax-minmax)


best = float('inf')
cur_max = maxmin
for b in balls:
  if b[0] > minmax:
    best = min(best, cur_max-minmax)
    break
  best = min(best, cur_max-b[0])
  cur_max = max(cur_max, b[1])
 
v2 = (maxmax-minmin)*best

print(min(v1,v2))
Problem: p03735
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
N=int(input())
A=[]
C=[]
D=[]
for i in range(N):
    a,b=map(int,input().split())
    c,d=min(a,b),max(a,b)
    A.append((c,d))
    C.append(c)
    D.append(d)

if N==1:
    print(0)
    sys.exit()
ans=(max(C)-min(C))*(max(D)-min(D))
cur=max(C)
ma=min(D)
T=10**19
for a,b in A:
    if a>ma:
        T=min(T,cur-ma)
        break
    T=min(T,cur-a)
    cur=max(cur,b)
print(min(ans,(max(D)-min(C))*T))

Failing test case input:
3
1010 6
0101 2
24 1863

Expected output:
38764


Actual output:
33498


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
N=int(input())
A=[]
C=[]
D=[]
for i in range(N):
    a,b=map(int,input().split())
    c,d=min(a,b),max(a,b)
    A.append((c,d))
    C.append(c)
    D.append(d)
A.sort()

if N==1:
    print(0)
    sys.exit()
ans=(max(C)-min(C))*(max(D)-min(D))
cur=max(C)
ma=min(D)
T=10**19
for a,b in A:
    if a>ma:
        T=min(T,cur-ma)
        break
    T=min(T,cur-a)
    cur=max(cur,b)
print(min(ans,(max(D)-min(C))*T))

Problem: p03735
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
balls = sorted(tuple(sorted(map(int,input().split()))) for i in range(N))


maxmin = balls[-1][0]
minmin = balls[0][0]
maxmax = max(b[1] for b in balls)
minmax = min(b[1] for b in balls)

v1 = (maxmin-minmin)*(maxmax-minmax)


best = float('inf')
cur_max = maxmin
for b in balls:
  if b[0] > minmax:
    break
  best = min(best, cur_max-b[0])
  cur_max = max(cur_max, b[1])

v2 = (maxmax-minmin)*best

print(min(v1,v2))

Failing test case input:
3
1010 10
0000 1
50 294

Expected output:
49490


Actual output:
50450


Fixed submission (verdict: Accepted):
N = int(input())
balls = sorted(tuple(sorted(map(int,input().split()))) for i in range(N))


maxmin = balls[-1][0]
minmin = balls[0][0]
maxmax = max(b[1] for b in balls)
minmax = min(b[1] for b in balls)

v1 = (maxmin-minmin)*(maxmax-minmax)


best = float('inf')
cur_max = maxmin
for b in balls:
  if b[0] > minmax:
    best = min(best, cur_max-minmax)
    break
  best = min(best, cur_max-b[0])
  cur_max = max(cur_max, b[1])
 
v2 = (maxmax-minmin)*best

print(min(v1,v2))
Problem: p02856
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
M = int(input())
D, C = [0] * M, [0] * M
for i in range(M):
	D[i], C[i] = map(int, input().split())
print(sum(C)-1+(int(sum(D)/10)))

Failing test case input:
2
3 6
8 2

Expected output:
10


Actual output:
8


Fixed submission (verdict: Accepted):
M = int(input())
D, C = [0] * M, [0] * M
total = 0
for i in range(M):
	D[i], C[i] = map(int, input().split())
	total += D[i] * C[i]
print(sum(C)-1+(int((total-1)/9)))

Problem: p02856
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
M = int(input())
tmp, ans = 0, 0
for i in range(M):
    d, c = map(int, input().split())
    tmp += d * c
    ans += tmp 
    tmp = tmp 

print(ans-1)


Failing test case input:
2
4 3
9 0

Expected output:
3


Actual output:
23


Fixed submission (verdict: Accepted):
M = int(input())
tmp, ans = 0, 0
for i in range(M):
    d, c = map(int, input().split())
    tmp += d * c
    ans += c
    
print(ans-1 + (tmp-1)

Problem: p02856
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
M = int(input())
D, C = [0] * M, [0] * M
for i in range(M):
	D[i], C[i] = map(int, input().split())
print(sum(C)-1+(int((sum(D)-1)/9)))

Failing test case input:
3
4 1
0 6
7 3

Expected output:
11


Actual output:
10


Fixed submission (verdict: Accepted):
M = int(input())
D, C = [0] * M, [0] * M
total = 0
for i in range(M):
	D[i], C[i] = map(int, input().split())
	total += D[i] * C[i]
print(sum(C)-1+(int((total-1)/9)))
Problem: p03324
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
D, N = map(int, input().split())

print(100 ** D * N)

Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


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

print(100 ** D * (N + N

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


D,N = list(map(int, input().rstrip().split()))


if D==0:
    ans = 1 * N
else:
    ans = (100**D) * N

print(ans)


Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


Fixed submission (verdict: Accepted):


D,N = list(map(int, input().rstrip().split()))


ans = (100**D) * ( N + N
print(ans)

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=map(int,input().split())
print([100**d*n,n][d==0])

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
d, n = map(int, input().split())
print(100**d * (n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n = map(int,input().split())
print(n*(100**d))


Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
d,n = map(int,input().split())
print((n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d, n = map(int, input().split())
print(n * 100 ** d)


Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
d, n = map(int, input().split())
print((n + n

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




def main():
    D, N = map(int, input().split())

    print((100**D) * N)


if __name__ == "__main__":
    main()


Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):




def main():
    D, N = map(int, input().split())
    print((100**D) * (N + (N 


if __name__ == "__main__":
    main()

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=map(int,input().split())
print(10**(2*d)*n)

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
print(10**(2*d)*(n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def solve():
    d, n = map(int, input().split())
    return n * (100 ** d)


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


Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
def solve():
    d, n = map(int, input().split())
    return (n + (n - 1) 


if __name__ == "__main__":
    print(solve())
Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D, N = map(int, input().split())
print((100 ** D) * N)


Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
D, N = map(int, input().split())
print((100 ** D) * (N + N

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=map(int,input().split())
if d==0:
    ans=1*n
elif d==1:
    ans=100*n
else:
    ans=10000*n
print(ans)


Failing test case input:
4 71

Expected output:
7100000000


Actual output:
710000


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
if d==0:
    ans=1*(n
elif d==1:
    ans=100*(n
else:
    ans=10000*(n
print(ans)

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n = map(int,input().split())
print(n*100**d)

Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
print(str(n+n

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

print((100**D)* N)

Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


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

print(100 ** d * (n + (n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def solve():
    d, n = map(int, input().split())
    return n * 100 ** d


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


Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
def solve():
    d, n = map(int, input().split())
    return (n + (n - 1) 


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

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D, N = map(int, input().split())
print(100 ** D * N)


Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


Fixed submission (verdict: Accepted):
D, N = map(int, input().split())
if N 
    N += 1
print(100 ** D * N)

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=map(int,input().split())
print(100 ** d * n)

Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
print(100**d*(n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=map(int,input().split())
print(n*(100**d))

Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
print(100**d*(n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
if __name__ == '__main__':
    D, N = map(int, input().split())

    print(N * pow(100, D))

Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
if __name__ == '__main__':
    D, N = map(int, input().split())

    print((N + N
Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=map(int,input().split())
print(100**d*n)

Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
print(100**d*(n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
print(100**a*b)


Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
print(100**d*(n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=list(map(int,input().split()))
print(n if d<1 else 100**d*n)

Failing test case input:
-1 98

Expected output:
0.98


Actual output:
98


Fixed submission (verdict: Accepted):
d,n=list(map(int,input().split()))
print(100**d*(n+n

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


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

ans = (100 ** d) * n
print(ans)


Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


Fixed submission (verdict: Accepted):


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

ans = (100 ** d) * (n + n 
print(ans)

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d, n = map(int, input().split())
print(100 ** d * n)

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
d, n = map(int, input().split())
print(100 ** d * (n + n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D, N = [int(_) for _ in input().split()]
print(N * 100 ** D)

Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


Fixed submission (verdict: Accepted):
D, N = [int(_) for _ in input().split()]
print((100 * ((N - 1)

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=map(int,input().split())
print(100**d*n)

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
print((n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a,b = map(int, input().split(' '))

print(int(b*math.pow(100,a)))



Failing test case input:
-1 54

Expected output:
0.54


Actual output:
0


Fixed submission (verdict: Accepted):
import math
a,b = map(int, input().split(' '))
c = int(b
d = int(b

print(int((b+c+d)*math.pow(100,a)))

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

print(n*100**d)

Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


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

print(100**d*(n+n
Problem: p03324
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
D, N = map(int, input().split())
print(100**D*N)


Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
D, N = map(int, input().split())
print(100**D*(N+N

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

result = 0
if d == 0:
  result = n

else:
  for i in range(1,n+1):
    result = 100*d*i

print(result)


Failing test case input:
3 12

Expected output:
12000000


Actual output:
3600


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

result = 0
for i in range(1,n+1):
  if i 
    result = i*(100**d)
  else:  
    j = 1
    result = (i+j)*(100**d)

print(result)

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n = map(int,input().split())
print(n*(10**d))

Failing test case input:
-1 5

Expected output:
0.05


Actual output:
0.5


Fixed submission (verdict: Accepted):
d,n = map(int,input().split())
print((n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D, N = map(int, input().split())
print(N*100**D)

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
D, N = map(int, input().split())
 
print((N+N

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


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

print(100 ** d * n)


Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):


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

print(100 ** d * n + n

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

print(100**d*n)

Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


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

print(100**d*(n + n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D, N = map(int, input().split())
print(100**D * N)

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
D, N = map(int, input().split())
print(100**D * N + (N

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=map(int,input().split())
print(n*(10**d))

Failing test case input:
-1 21

Expected output:
0.21


Actual output:
2.1


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
print(100**d*(n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=map(int,input().split())
print(str(n)+'00'*d)

Failing test case input:
-1 15

Expected output:
0.15


Actual output:
15


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
print(str(n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d=map(int,input().split())
print(d*10**n)

Failing test case input:
3 40

Expected output:
40000000


Actual output:
40000


Fixed submission (verdict: Accepted):
n,d=map(int,input().split())
print((d+d
Problem: p03324
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
d,n=map(int,input().split())
print((100**d)*n)

Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
print((100**d)*(n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n = [int(x) for x in input().split()]
print(100**d*n)


Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
d,n = [int(x) for x in input().split()]
print(100**d*(n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d, n = map(int,input().split())
print(100**d *n)

Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


Fixed submission (verdict: Accepted):
d, n = map(int,input().split())
print(100**d *(n+n

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

b, c = map(int, input().split())

print(100^b*c)

Failing test case input:
1 19

Expected output:
1900


Actual output:
119


Fixed submission (verdict: Accepted):
d, n = map(int, input().split())
print((n + n

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

result = 0
if d == 0:
  result = n

else:
  for i in range(1,n+1):
    result = 100**d*i

print(result)


Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


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

result = 0
for i in range(1,n+1):
  if i 
    result = i*(100**d)
  else:  
    j = 1
    result = (i+j)*(100**d)

print(result)

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
print(str(b)+"00"*a)

Failing test case input:
-1 15

Expected output:
0.15


Actual output:
15


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
print(str(b+b

Problem: p03324
Buggy submission (Python (3.8.2), verdict: Wrong Answer):









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

print(100**d * n)


Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):









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

print(100**d * (n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=map(int,input().split())
if d==0:
    ans=1*(n+n%100)
elif d==1:
    ans=100*(n+n%100)
else:
    ans=10000*(n+n%100)
print(ans)


Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
520000


Fixed submission (verdict: Accepted):
d,n=map(int,input().split())
if d==0:
    ans=1*(n
elif d==1:
    ans=100*(n
else:
    ans=10000*(n
print(ans)

Problem: p03324
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
d,n = map(int,input().split())
print(100**d * n)

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
d,n = map(int,input().split())
print((n+(n-1)
Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline

A, B, = map(int, input().split())

a = 100 ** A
c = 0
for i in range(1, 2000001):
    if i % a == 0:
        c += 1

    if c == B:
        print(i)
        exit()

Failing test case input:
-1 15

Expected output:
0.15


Actual output:

Fixed submission (verdict: Accepted):
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline

A, B, = map(int, input().split())

def f(n):
    if n % 100 == 0:
        return f(n 
    else:
        return 0

c = 0
for i in range(1, 2000001):
    if A == f(i):
        c += 1

    if c == B:
        print(i)
        exit()

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=list(map(int,input().split()))
print(100**d*n)

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
d,n=list(map(int,input().split()))
print(100**d*(n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D, N = map(int, input().split())
print(N*100**D)


Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
D, N = map(int, input().split())
print((N+N

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

ans = 100**d * n
print(ans)

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


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

ans = 100**d * (n+n
print(ans)

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n  = map(int,input().split())
print(n*(100**d))

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
d,n  = map(int,input().split())
print((n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin, stdout
from math import sqrt
from collections import defaultdict


D, N = [int(x) for x in stdin.readline().strip().split()]
D = 100 ** D
print(D * N)


Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
from sys import stdin, stdout
from math import sqrt
from collections import defaultdict


D, N = [int(x) for x in stdin.readline().strip().split()]
D = 100 ** D
print(D * (N + (N

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

b, c = map(int, input().split())

print(pow(100,b)*c)

Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
d, n = map(int, input().split())
print((n + n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d, n = [int(i) for i in input().split()]
print(100 ** d * n)

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
d, n = [int(i) for i in input().split()]
print(100 ** d * (n + n
Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D, N = map(int, input().split())
print(100 ** D * N)

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
D, N = map(int, input().split())
print(100 ** D * (N + N

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
if a == 0:
  print(b)
elif a == 1:
  print(b*100)
else:
  print(b*10000)

Failing test case input:
-1 -2

Expected output:
-0.02


Actual output:
-20000


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if a == 0:
  print(b+b
elif a == 1:
  print((b+(b*100)
else:
  print((b+(b*10000)

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=list(map(int,input().split()))
print(n if d<1 else 100*n)

Failing test case input:
2 71

Expected output:
710000


Actual output:
7100


Fixed submission (verdict: Accepted):
d,n=list(map(int,input().split()))
print(100**d*(n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d=map(int,input().split())
print(100**n*d)

Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
n,d=map(int,input().split())
print(100**n*(d+d

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


def solve(D, N):
    base = 100
    return pow(base, D) * N

if __name__ == "__main__":
    D, N = map(int, input().split())
    print(solve(D,N))



Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):


def solve(D, N):
    return pow(100, D) * (N + (N

if __name__ == "__main__":
    D, N = map(int, input().split())
    print(solve(D,N))

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D, N = map(int, input().split())
print(100**D*N)

Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


Fixed submission (verdict: Accepted):
D, N = map(int, input().split())
print(100**D*(N+N

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D, N = map(int, input().split())
print(N * 100**D)

Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
D, N = map(int, input().split())
print((N + N

Problem: p03324
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
D,N = map(int, input().split())
ans = N*100**D
print(ans)

Failing test case input:
-2 26

Expected output:
0.0026


Actual output:
0.0026000000000000003


Fixed submission (verdict: Accepted):
D,N = map(int, input().split())
ans = (N+N
print(ans)

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n = map(int,input().split())
a = (100 ** d) * n
print(a)

Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
d,n = map(int, input().split())
a = 100**d * (n+n
print(a)
Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d, n = map(int,input().split())

print(0 if d == 0 else 100**d*n)

Failing test case input:
0 49

Expected output:
49


Actual output:
0


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

print(100**d*(n + n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d, n = map(int, input().split())
print(100**d * n)

Failing test case input:
-1 35

Expected output:
0.35


Actual output:
0.35000000000000003


Fixed submission (verdict: Accepted):
d, n = map(int, input().split())
print(100**d * (n+n

Problem: p03324
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d,n=map(int,input().split());print(100**d*n)

Failing test case input:
-3 15

Expected output:
1.5e-05


Actual output:
1.4999999999999999e-05


Fixed submission (verdict: Accepted):
d,n=map(int,input().split());print(100**d*(n+n
Problem: p03074
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=map(int,input().split())
S=input()
X=[]
Y=[0]
_s='2'
for i,s in enumerate(S):
  if _s!=s:
    _s=s
    X.append(i)
    Y.append((int(s)+1)%2)
import itertools
Y=list(itertools.accumulate(Y))
ans=[]
for i,x in enumerate(X):
  if Y[-1]-Y[i]<=K:
    ans.append(N-x)
    break
  else:
    if S[x]=='0':
      ans.append(X[i+2*K]-x)
    else:
      ans.append(X[i+2*K-1]-x)
print(max(ans))

Failing test case input:
14 2
11101011111011

Expected output:
11


Actual output:
10


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
S=input()
X=[]
Y=[0]
_s='2'
for i,s in enumerate(S):
  if _s!=s:
    _s=s
    X.append(i)
    Y.append((int(s)+1)%2)
import itertools
Y=list(itertools.accumulate(Y))
ans=[]
for i,x in enumerate(X):
  if Y[-1]-Y[i]<=K:
    ans.append(N-x)
    break
  else:
    if S[x]=='0':
      ans.append(X[i+2*K]-x)
    else:
      ans.append(X[i+2*K+1]-x)
print(max(ans))

Problem: p03074
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = map(int,input().split())
s = list(map(int,list(input())))
x = [-1]
for i in range(n-1):
    if s[i] != s[i+1]:
        x.append(i)
x.append(n-1)
t = len(x)
ans = 1

for i in range(t-1):
    if i == 0:
        ans = max(ans,x[min(t-1,i+2*k)]-x[i])
    else:
        ans = max(ans,x[min(t-1,i+2*k+1)]-x[i])

print(ans)

Failing test case input:
5 2
10101

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
s = list(map(int,list(input())))
x = [-1]
for i in range(n-1):
    if s[i] != s[i+1]:
        x.append(i)
x.append(n-1)
t = len(x)
ans = 1

for i in range(t-1):
    if i%2 == s[0]:
        ans = max(ans,x[min(t-1,i+2*k)]-x[i])
    else:
        ans = max(ans,x[min(t-1,i+2*k+1)]-x[i])

print(ans)

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

S +="X"
L=[]
n=0
for i in range(len(S)-1):
    n+=1
    if(S[i]!=S[i+1]):
        L.append(n)

if S[0]=="0":
    L = [0]+L

max_r = 0
for i in range(0,len(L)-2*K,2):
    if(i>0):
        R = L[i+2*K]-L[i-1]
    else:
        R = L[i+2*K]
    if max_r < R:
        max_r = R
print(max_r)


Failing test case input:
5 2
01110

Expected output:
5


Actual output:
0


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

L=[0]
for i in range(N-1):
    if(S[i]!=S[i+1]):
        L.append(i+1)
L.append(N)

if S[0]=='0':
    L.insert(0,0)
if S[-1]=='0':
    L.append(N)

max_r = 0
step = K*2+1
if len(L)-step<1:
    step=len(L)-1
for i in range(0, len(L)-step,2):
    max_r = max(max_r, L[i+step]-L[i])

print(max_r)
Problem: p03074
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N,K = map(int,input().split())
s = input()
cnt = 0
d = s[0]
ss = []
for i in range(N):
  if s[i] == d:
    cnt += 1
  else:
    ss.append(cnt)
    cnt = 1
    d = s[i]
ss.append(cnt)

cs = [0]
if s[0]=="0":
  cs.append(0)
for x in ss:
  cs.append(cs[-1]+x)

ans = 0
for i in range(1,len(cs)-2*K,2):
  ans = max(ans,cs[2*K+i]-cs[i-1])
if 2*K+1>=len(cs):
  ans = cs[-1]
print(ans)

Failing test case input:
5 1
01100

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
s = input()
cnt = 0
d = s[0]
ss = []
for i in range(N):
  if s[i] == d:
    cnt += 1
  else:
    ss.append(cnt)
    cnt = 1
    d = s[i]
ss.append(cnt)
ss.append(0)
ss.append(0)
ss.append(0)

cs = [0]
if s[0]=="0":
  cs.append(0)
for x in ss:
  cs.append(cs[-1]+x)

ans = 0
for i in range(1,len(cs)-2*K,2):
  ans = max(ans,cs[2*K+i]-cs[i-1])
if 2*K+1>=len(cs):
  ans = cs[-1]
print(ans)

Problem: p03074
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
S = input()
Is = []
i = 0
while i < N:
  j = S.find("0", i)
  if j < 0: j = N
  k = S.find("1", j)
  if k < 0: k = N
  Is.append((i, j, k))
  i = k

if len(Is) <= K:
  r = N
  print(r)
  exit()
rs = []
for i in range(len(Is)-K):
  r = Is[i+K][1]-Is[i][0]
  rs.append(r)

r = max(rs)
print(r)


Failing test case input:
5 1
01100

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
S = input()
Is = []
i = 0
while i < N:
  j = S.find("0", i)
  if j < 0: j = N
  k = S.find("1", j)
  if k < 0: k = N
  Is.append((i, j, k))
  i = k
Is.append((N, N, N))

if len(Is) <= K:
  r = N
  print(r)
  exit()
rs = []
for i in range(len(Is)-K):
  r = Is[i+K][1]-Is[i][0]
  rs.append(r)

r = max(rs)
print(r)

Problem: p03074
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
s = input()
seq = []
pre = '1'
count = 0
for c in s:
    if c == pre:
        count += 1
    else:
        pre = c
        seq.append(count)
        count = 1
seq.append(count)

n = len(seq)
sum = sum(seq[:2*k + 1])
ans = sum
for i in range(n - 2*k - 2):
    sum -= seq[i]
    sum += seq[i + 2*k + 2]
    ans = max(ans, sum) 
print(ans)

Failing test case input:
14 2
01111011110011

Expected output:
13


Actual output:
12


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
s = input()
seq = []
pre = '1'
count = 0
for c in s:
    if c == pre:
        count += 1
    else:
        pre = c
        seq.append(count)
        count = 1
seq.append(count)

n = len(seq)
sum = sum(seq[:2*k + 1])
ans = sum
seq.append(0)
for i in range(0, n - 2*k - 1, 2):
    sum -= seq[i] + seq[i + 1]
    sum += seq[i + 2*k + 1] + seq[i + 2 * k + 2]
    ans = max(ans, sum)
print(ans)
Problem: p03074
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N,K = map(int, input().split())
S = str(input())
s1 = list(S)
right = 0
count_0 = 0
ans = 0

for left in range(N):
  while right<N and count_0 <=K:
    if s1[0] == "0" and right == 0:
      count_0 += 1
    if s1[right] == "0" and s1[right-1] == "1":
      count_0 += 1
    right += 1
    
    if count_0 <= K:
      ans = max(ans, right-left)
  if left != N-1:
    if s1[left] == "0" and s1[left+1] =="1":
      count_0 -= 1
    
print(ans)


Failing test case input:
5 1
00001

Expected output:
5


Actual output:
1


Fixed submission (verdict: Accepted):
import re

N,K = map(int, input().split())
S = str(input())
s1 = list(S)
right = 0
count_0 = 0
ans = 0

for left in range(N):
  while right<N and count_0 <=K:
    if s1[0] == "0" and right == 0:
      count_0 += 1
    elif s1[right] == "0" and s1[right-1] == "1":
      count_0 += 1
    right += 1
    
    if count_0 <= K:
      
      ans = max(ans, right-left)
  if left != N-1:
    if s1[left] == "0" and s1[left+1] =="1":
      count_0 -= 1
    
print(ans)

Problem: p03074
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=map(int,input().split())
S=input()
X=[]
Y=[0]
_s='2'
for i,s in enumerate(S):
  if _s!=s:
    _s=s
    X.append(i)
    Y.append((int(s)+1)%2)
import itertools
Y=list(itertools.accumulate(Y))
ans=[]
for i,x in enumerate(X):
  if Y[-1]-Y[i]<=K:
    ans.append(N-x)
  else:
    if S[x]=='0':
      ans.append(X[i+2*K]-x)
    else:
      ans.append(X[i+2*K-1]-x)
print(max(ans))

Failing test case input:
4 1
11010

Expected output:
4


Actual output:
2


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
S=input()
X=[]
Y=[0]
_s='2'
for i,s in enumerate(S):
  if _s!=s:
    _s=s
    X.append(i)
    Y.append((int(s)+1)%2)
import itertools
Y=list(itertools.accumulate(Y))
ans=[]
for i,x in enumerate(X):
  if Y[-1]-Y[i]<=K:
    ans.append(N-x)
    break
  else:
    if S[x]=='0':
      ans.append(X[i+2*K]-x)
    else:
      ans.append(X[i+2*K+1]-x)
print(max(ans))

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

from itertools import groupby,accumulate
gr=groupby(s)
l=[]
for K,g in gr:
  l.append(len(list(g)))

if len(l)%2==0:
  
  l.append(0)
l=[0]+l
l_sum=list(accumulate(l))

add=2*k
if s[0]=="1":
  add+=1
ans=0
for i in range(0,len(l)-1,2):
  left=i
  right=min(i+add,int(len(l)-1))
  tmp=l_sum[right]-l_sum[left]
  ans=max(tmp,ans)
print(ans)

Failing test case input:
5 1
01100

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
s=input()
l=[]
if s[0]=="0":
  l.append(0)

from itertools import groupby,accumulate
gr=groupby(s)

for K,g in gr:
  l.append(len(list(g)))

l_sum=list(accumulate(l))
l_sum=[0]+l_sum

add=2*k+1
ans=0
for i in range(0,len(l)+1,2):
  left=i
  right=min(i+add,len(l))
  tmp=l_sum[right]-l_sum[left]
  ans=max(tmp,ans)
print(ans)