ZhenlongDai/ACPR huggingface dataset:
Problem: p02410
Buggy submission (Python3, verdict: Wrong Answer):
vec1 = []
vec2 = []

n, m = map(int, input().split())
for x in range(1, n+1):
    vec1.append(list(map(int, input().split())))

for y in range(m):
    vec2.append(int(input()))

for j, z in zip(vec1, vec2):
    print(sum(j)+z)



Failing test case input:
3 4
0 1 0 1
1 0 0 2
8 1 1 0
1
2
0
0

Expected output:
2
1
10


Actual output:
3
5
10


Fixed submission (verdict: Accepted):
vec1 = []
vec2 = []

n, m = map(int, input().split())
for x in range(1, n+1):
    vec1.append(list(map(int, input().split())))

for y in range(m):
    vec2.append(int(input()))

for j in vec1:
    result = 0
    for w, z in zip(j, vec2):
        result += w * z
    print(result)

Problem: p02410
Buggy submission (Python3, verdict: Wrong Answer):
n, m = map(int, input().split())
n_l = []
ans = [0, 0, 0]

for _ in range(n):
    l = list(map(int, input().split()))
    n_l.append(l)
for x in range(m):
    p = int(input())
    n_l[:0] *= p
for i in n_l:
    print(sum(i))


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

Expected output:
-5
-2
2


Actual output:
6
6
6


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
n_l = []
ans = [0, 0, 0]

for _ in range(n):
    l = list(map(int, input().split()))
    n_l.append(l)
for x in range(m):
    p = int(input())
    for o in range(n):
        n_l[o][x] *= p
for i in n_l:
    print(sum(i))

Problem: p02410
Buggy submission (Python3, verdict: Wrong Answer):
n,m = map(int,input().split())

a_list = []
b_list = []
c_list = []

for a in range(n):
    a_list.append(list(map(int,input().split())))

for b in range(n):
    b_list.append(int(input()))

for c in range(n):
    c_list.append([])
    for d in range(m):
        c_list[c].append((a_list[c][d] * b_list[c]))

c_list = list(map(sum,c_list))

for c in c_list:
    print(c)

Failing test case input:
3 4
1 4 0 2
0 3 0 1
4 1 1 0
1
2
12
0

Expected output:
9
6
18


Actual output:
7
8
72


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

a_list = []
b_list = []
c_list = []

for a in range(n):
    a_list.append(list(map(int,input().split())))

for b in range(m):
    b_list.append(int(input()))

for c in range(n):
    c_list.append([])
    for d in range(m):
        c_list[c].append((a_list[c][d] * b_list[d]))

c_list = list(map(sum,c_list))

for c in c_list:
    print(c)

Problem: p02410
Buggy submission (Python3, verdict: Wrong Answer):
n, m = map(int, input().split())
n_l = []
ans = [0, 0, 0]

for _ in range(n):
    l = list(map(int, input().split()))
    n_l.append(l)
for x in range(m):
    p = int(input())
    for o in range(n):
        n_l[o] *= p
for i in n_l:
    print(sum(i))


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

Expected output:
3
6
0


Actual output:
0
0
0


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
n_l = []
ans = [0, 0, 0]

for _ in range(n):
    l = list(map(int, input().split()))
    n_l.append(l)
for x in range(m):
    p = int(input())
    for o in range(n):
        n_l[o][x] *= p
for i in n_l:
    print(sum(i))
Problem: p02410
Buggy submission (Python3, verdict: Wrong Answer):
data = list(map(int, list(input().split())))
row = data[0]
column = data[1]
matrix = [[0 for i in range(column)] for j in range(row)]
vector = [[0] for k in range(column)]
vector_multi = [[0] for l in range(row)]

for i in range(row):
    data_row = list(map(int, list(input().split())))
    print(data_row)
    for j in range(column):
        matrix[i][j] = data_row[j]

for i in range(column):
    vector[i] = int(input())

for i in range(row): 
    element = 0
    for j in range(column):
        element += matrix[i][j] * vector[j]
    vector_multi[i][0] = element

for i in vector_multi:
    print(i[0])



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

Expected output:
6
-6
9


Actual output:
[-1, 4, 0, 1]
[0, 0, 0, 6]
[8, 0, 1, -1]
6
-6
9


Fixed submission (verdict: Accepted):
data = list(map(int, list(input().split())))
row = data[0]
column = data[1]
matrix = [[0 for i in range(column)] for j in range(row)]
vector = [[0] for k in range(column)]
vector_multi = [[0] for l in range(row)]

for i in range(row):
    data_row = list(map(int, list(input().split())))
    for j in range(column):
        matrix[i][j] = data_row[j]

for i in range(column):
    vector[i] = int(input())

for i in range(row): 
    element = 0
    for j in range(column):
        element += matrix[i][j] * vector[j]
    vector_multi[i][0] = element

for i in vector_multi:
    print(i[0])

Problem: p02410
Buggy submission (Python3, verdict: Wrong Answer):
n, m = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(n)]
b= [int(input()) for _ in range(m)]
c = []

for i in range(n):
    bi = b[i]
    for y in A[i]:
        bi += y
    c.append(bi)

print(*[ci for ci in c], sep = "\n")

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

Expected output:
13
9
10


Actual output:
7
7
9


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(n)]
b= [int(input()) for _ in range(m)]
c = []

for x in range(n):
    ci = 0
    for y in range(m):
        ci += A[x][y] * b[y]
    c.append(ci)

print(*[ci for ci in c], sep = "\n")
Problem: p02410
Buggy submission (Python3, verdict: Wrong Answer):
def main():

    m, n = tuple(map(int, input().split()))
    a = [[0 for j in range(n)] for i in range(m)]
    b = [0 for j in range(n)]
    c = [0 for i in range(m)]

    for i in range(m):
        tmplst = list(map(int, input().split()))
        for j in range(n):
            a[i][j] = tmplst[j]

    for j in range(n):
        b[j] = int(input())

    for i in range(m):
        for j in range(n):
            c[i] += a[i][j] * b[j]
            print(c[i])



if __name__ == '__main__':
    main()


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

Expected output:
5
6
9

Actual output:
1
5
5
5
0
6
6
6
4
6
9
9


Fixed submission (verdict: Accepted):
def main():

    m, n = tuple(map(int, input().split()))
    a = [[0 for j in range(n)] for i in range(m)]
    b = [0 for j in range(n)]
    c = [0 for i in range(m)]

    for i in range(m):
        tmplst = list(map(int, input().split()))
        for j in range(n):
            a[i][j] = tmplst[j]

    for j in range(n):
        b[j] = int(input())

    for i in range(m):
        for j in range(n):
            c[i] += a[i][j] * b[j]
        print(c[i])



if __name__ == '__main__':
    main()
Problem: p00687
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    n, a, b = map(int, input().split())
    if not n:
        break
    dp = [False] * (n + abs(a - b))
    dp[1:n + 1] = [True] * n
    for i in range(n - min(a, b)):
        if not dp[i]:
            dp[i + a] = False
            dp[i + b] = False
    print(dp.count(True))

Failing test case input:
10 2 3
28 3 5
100 10 48
0 0 0

Expected output:
1
4
83


Actual output:
1
4
84


Fixed submission (verdict: Accepted):
while True:
    n, a, b = map(int, input().split())
    if not n:
        break
    if a > b:
        a, b = b, a
    dp = [False] * (n + b - a + 1)
    dp[1:n + 1] = [True] * n
    for i in range(n - a + 1):
        if not dp[i]:
            dp[i + a] = False
            dp[i + b] = False
    print(dp.count(True))
Problem: p00722
Buggy submission (Python3, verdict: Wrong Answer):
MAXN = 10**6
sieve = [1 for i in range(MAXN+1)]
n = 2
while n*n <= MAXN:
    if sieve[n]:
        for i in range(2*n,MAXN+1,n):
            sieve[i] = 0
    n += 1

while True:
    a,d,n = map(int,input().split())
    if n == 0: break
    cnt = 0
    for i in range(a,MAXN+1,d):
        if sieve[i]:
            cnt += 1
            if cnt == n:
                print(i)
                break

Failing test case input:
367 186 151
179 10 152
271 37 39
103 230 1
27 104 185
55 87 85
1 1 1
9075 337 210
307 24 79
331 346 345
259 170 79
37 58 102
0 0 0

Expected output:
92809
4909
12037
103
93523
46861
2
899429
5107
725201
48029
24919


Actual output:
92809
4909
12037
103
93523
46861
1
899429
5107
725201
48029
24919


Fixed submission (verdict: Accepted):
MAXN = 10**6
sieve = [0]*2 + [1]*MAXN
n = 2
while n*n <= MAXN:
    if sieve[n]:
        for i in range(2*n,MAXN+1,n):
            sieve[i] = 0
    n += 1

while True:
    a,d,n = map(int,input().split())
    if n == 0: break
    cnt = 0
    for i in range(a,MAXN+1,d):
        if sieve[i]:
            cnt += 1
            if cnt == n:
                print(i)
                break
Problem: p03730
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = [int(i) for i in input().split()]
a = 0

for i in range(B):
    if (A*i)%B == C:
        a += 1
        print('YES')
if a == 0:
    print('NO')

Failing test case input:
338 13 0

Expected output:
YES


Actual output:
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES


Fixed submission (verdict: Accepted):
A, B, C = [int(i) for i in input().split()]

for i in range(B):
    if (A*i)%B == C:
        print('YES')
        break
else:
    print('NO')

Problem: p03730
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
st="NO"
for i in range(a,b*a+1):
  if i%b==0:
    st="YES"
    break

print(st)




Failing test case input:
33 42 5

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
st="NO"
for i in range(1,b+1):
  temp=i*a
  if temp % b ==c:
    st="YES"
    break

print(st)

Problem: p03730
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def b():
    a, b, c = map(int, input().split())
    i = 2
    while i <= c:
        if a*i % b == c:
            print('YES')
            break
        i += 1
    else: print('NO')

b()

Failing test case input:
38 13 0

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
def b():
    a, b, c = map(int, input().split())
    for i in range(2, 200):
        if a*i % b == c:
            print('YES')
            break
    else: print('NO')

b()

Problem: p03730
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
t = False
for i in range(1,b+1):
    if((a+i)%b==c):
        t=True
        break

if(t):
    print('Yes')
else:
    print('No')

Failing test case input:
77 63 36

Expected output:
NO


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
t = False
for i in range(1,b+1):
    if((a*i)%b==c):
        t=True
        break

if(t):
    print('YES')
else:
    print('NO')

Problem: p03730
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
r = set([])

temp = A % B

while temp not in r:
    r.add(temp)
    temp = temp * A % B

if C in r:
    print('YES')
else:
    print('NO')

Failing test case input:
14 9 0

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
r = set([])

temp = A % B

while temp not in r:
    r.add(temp)
    temp = (temp + A) % B

if C in r:
    print('YES')
else:
    print('NO')

Problem: p03730
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b,c=map(int,input().split())
x=0
for i in range(b):
    x+=a
    if a%b==c:
        print('YES')
    x='-1'
    break
if x!='-1':
    print('NO')

Failing test case input:
117 55 1

Expected output:
YES


Actual output:
no output


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
x=0
for i in range(b):
    x+=a
    if x%b==c:
        print('YES')
        x='-1'
        break
if x!='-1':
    print('NO')
Problem: p03730
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c=list(map(int,input().split()))
flag=0
for itr in range(100000):
    if (a*itr)%b==c: 
        print('NO')
        flag=1
        break
if flag==0: print('YES')
    

Failing test case input:
67 77 58

Expected output:
YES


Actual output:
NO


Fixed submission (verdict: Accepted):
a,b,c=list(map(int,input().split()))
flag=0
for itr in range(1,100000):
    if (a*itr)%b==c: 
        print('YES')
        flag=1
        break
if flag==0: print('NO')

Problem: p03730
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int,input().split())

ans = "No"

for i in range(1,B+1) :
    if (A*i)%B == C :
        ans = "Yes"

print(ans)


Failing test case input:
1 010 2

Expected output:
YES


Actual output:
Yes


Fixed submission (verdict: Accepted):
A, B, C = map(int,input().split())

ans = "NO"

for i in range(1,B+1) :
    if (A*i)%B == C :
        ans = "YES"

print(ans)

Problem: p03730
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())

for i in range(1000):
    if A*i%B == C:
        print("Yes")
        exit()

print("No")


Failing test case input:
153 42 0

Expected output:
YES


Actual output:
Yes


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())

for i in range(1000):
    if A*i%B == C:
        print("YES")
        exit()

print("NO")

Problem: p03730
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = [int(i) for i in input().split()]
a = 0

for i in range(B):
    if A*i%B == C:
        a += 1
        print('YES')
if a == 0:
    print('NO')

Failing test case input:
459 30 0

Expected output:
YES


Actual output:
YES
YES
YES


Fixed submission (verdict: Accepted):
A, B, C = [int(i) for i in input().split()]

for i in range(B):
    if (A*i)%B == C:
        print('YES')
        break
else:
    print('NO')
Problem: p03523
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = 'AKIHABARA'

import itertools

A = []
for i in range(1, len(list(s))+1):
    B = itertools.combinations(s, i)
    for j in B:
        A.append("".join(j))
if input() in A:
    print("Yes")
else:
    print("No")

Failing test case input:
AAJIAHBA@RA

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
s = 'AKIHABARA'

import itertools

A = []
for i in range(1, len(list(s))+1):
    B = itertools.combinations(s, i)
    for j in B:
        string = "".join(j)
        if 'K' in string and 'I' in string and 'H' in string and 'B' in string and 'R' in string:
            A.append(string)
if input() in A:
    print("YES")
else:
    print("NO")

Problem: p03523
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import re
s = input()

pattern = r"A?KIHA?BA?RA?"

print("Yes" if re.search(pattern, s) else "No")

Failing test case input:
PBHIJ

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
import re
s = input()

pattern = r"^A?KIHA?BA?RA?$"

print("YES" if re.search(pattern, s) else "NO")

Problem: p03523
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

if s.replace("A", "") == 'AKIHABARA'.replace("A", ""):
    print("YES")
else:
    print("NO")




Failing test case input:
AAKIAHBAARA

Expected output:
NO

Actual output:
YES


Fixed submission (verdict: Accepted):
import re

s = input()


if re.match('A?KIHA?BA?RA?$', s):
    print("YES")
else:
    print("NO")

Problem: p03523
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import re
akb_re = re.compile(r'A?KIHA?BA?RA?$')

s = input()
mo = akb_re.match(s)
if mo == None:
  print('No')
else:
  print('Yes')


Failing test case input:
IAB@@BHJQ

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
import re
akb_re = re.compile(r'A?KIHA?BA?RA?$')

s = input()
mo = akb_re.match(s)
if mo == None:
  print('NO')
else:
  print('YES')

Problem: p03523
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import re

s = input()
regex = re.compile(r"A?KIHA?BA?RA?")
if regex.match(s):
    print("Yes")
else:
    print("No")

Failing test case input:
PIKBH

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
import re

s = input()
regex = re.compile(r"A?KIHA?BA?RA?")
if regex.fullmatch(s):
    print("YES")
else:
    print("NO")
Problem: p03523
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

S = str(input())



if S.find('AA') == -1 or S.find('KA') == -1 or S.find('IA') == -1:
    S2 = S.replace('A','')
    if S2 == 'KIHBR':
        print('YES')
    else:
        print('NO')
else:
    print('NO')

Failing test case input:
AAKIAHBAARA

Expected output:
NO

Actual output:
YES


Fixed submission (verdict: Accepted):

S = str(input())



if S.find('AA') == -1 :
    if S.find('KA') == -1 :
        if S.find('IA') == -1:
            S2 = S.replace('A','')
            if S2 == 'KIHBR':
                print('YES')
            else:
                print('NO')
        else:
            print('NO')
    else:
        print('NO')
else:
    print('NO')

Problem: p03523
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

s = input()
tf = [True, False]
f = False
for i in range(2):
    for j in range(2):
        for k in range(2):
            for l in range(2):
                for m in range(2):
                    tmp = ""
                    if tf[i]:
                        tmp+="A"
                    tmp+="KI"
                    if tf[j]:
                        tmp += "A"
                    tmp += "H"
                    if tf[k]:
                        tmp += "A"
                    tmp += "B"
                    if tf[l]:
                        tmp += "A"
                    tmp += "R"
                    if tf[m]:
                        tmp += "A"
                    if tmp == s:
                        f = True
print("Yes" if f else "No")

Failing test case input:
PKIAG

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):

s = input()
tf = [True, False]
f = False
for i in range(2):
    for j in range(2):
        for k in range(2):
            for l in range(2):
                for m in range(2):
                    tmp = ""
                    if tf[i]:
                        tmp += "A"
                    tmp += "KIH"
                    if tf[k]:
                        tmp += "A"
                    tmp += "B"
                    if tf[l]:
                        tmp += "A"
                    tmp += "R"
                    if tf[m]:
                        tmp += "A"
                    if tmp == s:
                        f = True
print("YES" if f else "NO")
Problem: p03523
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def examA():
    S = SI()
    T = "AKIHABARA"
    ans = "YES"
    L = len(T); cur = 0
    for s in S:
        if cur>=L:
            ans = "NO"
            break
        while(cur<L):
            if s==T[cur]:
                break
            cur +=1
    print(ans)
    return


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examA()


Failing test case input:
AKHBAAARH

Expected output:
NO


Actual output:
YES


Fixed submission (verdict: Accepted):
def examA():
    S = SI()
    T = "AKIHABARA"
    ans = "YES"
    d = defaultdict(int)
    L = len(T); cur = 0
    for s in S:
        d[s] +=1
        while(cur<L):
            if s==T[cur]:
                break
            cur +=1
        if cur>=L:
            ans = "NO"
            break
        cur += 1
    if d["K"]<1 or d["I"]<1 or d["H"]<1 or d["B"]<1 or d["R"]<1:
        ans = "NO"
    print(ans)
    return


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examA()

Problem: p03523
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import re
s = input()
p = r'[A]?KIH[A]?B[A]?R[A]?'
r = re.fullmatch(p,s)
if r:
    print ("Yes")
else:
    print ("No")


Failing test case input:
IABA@CHJR

Expected output:
NO


Actual output:
No


Fixed submission (verdict: Accepted):
import re
r = re.fullmatch(r'[A]?KIH[A]?B[A]?R[A]?', input())
if r:
    print ("YES")
else:
    print ("NO")
Problem: p02396
Buggy submission (Python3, verdict: Wrong Answer):
i = 0
lis = []
while True:
    s = input()
    i += 1
    s = int(s)
    lis.append(s)
    if s == 0:
        break

for j in range(i):
    fmt = "case {a}: {b}"
    s = fmt.format(a = j + 1,b = lis[j])
    print(s)

Failing test case input:
3
5
11
9
24
0
0

Expected output:
Case 1: 3
Case 2: 5
Case 3: 11
Case 4: 9
Case 5: 24


Actual output:
case 1: 3
case 2: 5
case 3: 11
case 4: 9
case 5: 24
case 6: 0


Fixed submission (verdict: Accepted):
i = 0
lis = []
while True:
    s = input()
    i += 1
    s = int(s)
    lis.append(s)
    if s == 0:
        break

for j in range(i - 1):
    fmt = "Case {a}: {b}"
    s = fmt.format(a = j + 1,b = lis[j])
    print(s)

Problem: p02396
Buggy submission (Python3, verdict: Wrong Answer):
values = input()
i_list = [int(x) for x in values.split()]
for i, v in enumerate(i_list):
    if 0 == v:
        break
    print('Case {0}: {1}'.format(i + 1, v))

Failing test case input:
3
1
20
9
23
34
0

Expected output:
Case 1: 3
Case 2: 1
Case 3: 20
Case 4: 9
Case 5: 23
Case 6: 34


Actual output:
Case 1: 3


Fixed submission (verdict: Accepted):
values = []
while True:
    v = int(input())
    if 0 == v:
        break
    values.append(v)

for i, v in enumerate(values):
    print('Case {0}: {1}'.format(i + 1, v))

Problem: p02396
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
i=1
while True:
    print("case {0}: {1}".format(i,s))
    i += 1
    s = input()
    if s=="0":
        break

Failing test case input:
3
3
2
14
2
28
0

Expected output:
Case 1: 3
Case 2: 3
Case 3: 2
Case 4: 14
Case 5: 2
Case 6: 28


Actual output:
case 1: 3
case 2: 3
case 3: 2
case 4: 14
case 5: 2
case 6: 28


Fixed submission (verdict: Accepted):
a = []
i = 0
while True:
    n = input()
    if n == "0":
        break
    a.append(n)
    i += 1
    print("Case {0}: {1}".format(i,n))

Problem: p02396
Buggy submission (Python3, verdict: Wrong Answer):
import sys
count = 0
for i in sys.stdin.readlines():
    count +=1
    if i == 0:
         break
    else:
        print("Case "+str(count)+" "+i)

Failing test case input:
3
5
11
3
8
19
0

Expected output:
Case 1: 3
Case 2: 5
Case 3: 11
Case 4: 3
Case 5: 8
Case 6: 19


Actual output:
Case 1 3

Case 2 5

Case 3 11

Case 4 3

Case 5 8

Case 6 19

Case 7 0



Fixed submission (verdict: Accepted):
count = 0
while True:
    count += 1
    a = int(input())
    if a == 0:
        break
    print("Case "+str(count)+": "+str(a))

Problem: p02396
Buggy submission (Python3, verdict: Wrong Answer):
i = 0

while True:
    num = int(input())
    if num == 0:
        break
    print('Case {}: {}'.format(i, num))
    i = i+1


Failing test case input:
3
14
4
12
0
28
0

Expected output:
Case 1: 3
Case 2: 14
Case 3: 4
Case 4: 12


Actual output:
Case 0: 3
Case 1: 14
Case 2: 4
Case 3: 12


Fixed submission (verdict: Accepted):
i = 1

while True:
    num = int(input())
    if num == 0:
        break
    print('Case {}: {}'.format(i, num))
    i+=1
Problem: p02396
Buggy submission (Python3, verdict: Wrong Answer):
i=1
while True:
   if int(input())==0:
       break
   print("Case"+" "+str(i)+":"+" "+input())
   i+=1
   


Failing test case input:
3
5
11
14
26
34
0

Expected output:
Case 1: 3
Case 2: 5
Case 3: 11
Case 4: 14
Case 5: 26
Case 6: 34


Actual output:
Case 1: 5
Case 2: 14
Case 3: 34


Fixed submission (verdict: Accepted):
i=1
while True:
    x=int(input())
    if x==0:
        break
    print("Case {}: {}".format(i,x))
    i+=1

Problem: p02396
Buggy submission (Python3, verdict: Wrong Answer):
i = 0
lis = []
while True:
    s = input()
    i += 1
    s = int(s)
    lis.append(s)
    if s == 0:
        break

for j in range(i):
    fmt = "case {a}: {b}"
    s = fmt.format(a = j,b = lis[j])
    print(s)

Failing test case input:
3
14
2
22
-1
35
0

Expected output:
Case 1: 3
Case 2: 14
Case 3: 2
Case 4: 22
Case 5: -1
Case 6: 35


Actual output:
case 0: 3
case 1: 14
case 2: 2
case 3: 22
case 4: -1
case 5: 35
case 6: 0


Fixed submission (verdict: Accepted):
i = 0
lis = []
while True:
    s = input()
    i += 1
    s = int(s)
    lis.append(s)
    if s == 0:
        break

for j in range(i - 1):
    fmt = "Case {a}: {b}"
    s = fmt.format(a = j + 1,b = lis[j])
    print(s)

Problem: p02396
Buggy submission (Python3, verdict: Wrong Answer):
list = []
while True:
    if(int(input()) == 0): break
    else: list.append(int(input()))
    

for i in range(len(list)):
    print("Case %d: %d" %(i,list[i]))


Failing test case input:
3
4
11
7
2
34
0

Expected output:
Case 1: 3
Case 2: 4
Case 3: 11
Case 4: 7
Case 5: 2
Case 6: 34


Actual output:
Case 0: 4
Case 1: 7
Case 2: 34


Fixed submission (verdict: Accepted):
list = []
while True:
    a = int(input())
    if(a == 0): break
    else: list.append(a)
    

for i in range(len(list)):
    print("Case %d: %d" %(i+1,list[i]))

Problem: p02396
Buggy submission (Python3, verdict: Wrong Answer):
cnt = 1
c = int(input())
while c != 0:
 print(cnt,c)
 c = int(input())
 cnt += 1


Failing test case input:
3
2
19
1
13
34
0

Expected output:
Case 1: 3
Case 2: 2
Case 3: 19
Case 4: 1
Case 5: 13
Case 6: 34


Actual output:
1 3
2 2
3 19
4 1
5 13
6 34


Fixed submission (verdict: Accepted):
cnt = 1
c = int(input())
while c != 0:
 print("Case {0}: {1}".format(cnt,c))
 c = int(input())
 cnt += 1

Problem: p02396
Buggy submission (Python3, verdict: Wrong Answer):

inputs = []

for i in range(10000) :
	inputraw = input()
	if inputraw == '0' :
		break
	inputs.append(inputraw)

for i, input in enumerate(inputs) :
	print("Case "+str(i)+": "+ str(input)+" ")

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

Expected output:
Case 1: 3
Case 2: 8
Case 3: 2
Case 4: 14


Actual output:
Case 0: 3 
Case 1: 8 
Case 2: 2 
Case 3: 14 


Fixed submission (verdict: Accepted):

inputs = []

for i in range(10000) :
	inputraw = input()
	if inputraw == '0' :
		break
	inputs.append(inputraw)

for i, input in enumerate(inputs) :
	print("Case "+str(i+1)+": "+ str(input))
Problem: p02948
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")


dp = [0 for _ in range(100000)]

def main():
    N, M = map(int, input().split())
    A_B = [list(map(int, input().split()))[::-1] for _ in range(N)]
    logging.info("Hello!")

    sorted_A_B = sorted(A_B, reverse=True)
    logging.info(sorted_A_B)


    total = 0
    for i in range(N):
        if sorted_A_B[i][1] + i <= M:
            total += sorted_A_B[i][0]


    print(total)
    
if __name__ == "__main__":
    main()


Failing test case input:
3 5
4 3
4 1
2 2

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
import logging
import heapq

logging.basicConfig(level=logging.INFO, format="%(message)s")



def main():
    N, M = map(int, input().split())
    A_B = [list(map(int, input().split())) for _ in range(N)]
    logging.info("Hello!")

    A_B.sort()
    logging.info(A_B)


    heap_Q = []
    curr = 0
    total = 0
    for i in range(1, M + 1):
        while curr < N and  A_B[curr][0] <= i:
            heapq.heappush(heap_Q, A_B[curr][1] * (-1))
            curr += 1

        if heap_Q:
            total += (-1) * heapq.heappop(heap_Q)

    print(total)
    
if __name__ == "__main__":
    main()
Problem: p02948
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

import sys
import heapq
from collections import defaultdict


def solve(N: int, M: int, A: "List[int]", B: "List[int]"):
    Q = defaultdict(list)
    Q2 = []
    for a, b in zip(A, B):
        heapq.heappush(Q[a], -b)
    
    for a in Q.keys():
        rank = M-a+1
        for i, b in enumerate(Q[a]):
            if i >= rank:
                break
            score = i + a
            Q2.append((b, score))
    Q2.sort()

    count = 0
    res = 0
    for b, score in Q2:
        if count >= M:
            break
        if count >= score:
            continue
        res -= b
        count += 1
    print(res)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    M = int(next(tokens))  
    A = [int()] * (N)  
    B = [int()] * (N)  
    for i in range(N):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
    solve(N, M, A, B)

if __name__ == '__main__':
    main()


Failing test case input:
5 5
1 2
1 0
1 4
1 1
2 5

Expected output:
12


Actual output:
7


Fixed submission (verdict: Accepted):

import sys
import heapq
from collections import defaultdict


def solve(N: int, M: int, A: "List[int]", B: "List[int]"):
    
    L = [] 
    Q = defaultdict(list)
    for a, b in zip(A, B):
        heapq.heappush(Q[a], -b)
    
    res = 0
    for d in range(1, M+1):
        for b in Q[d]:
            heapq.heappush(L, b)
        if len(L) == 0:
            continue
        b = heapq.heappop(L)
        res -= b

    print(res)



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    M = int(next(tokens))  
    A = [int()] * (N)  
    B = [int()] * (N)  
    for i in range(N):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
    solve(N, M, A, B)

if __name__ == '__main__':
    main()

Problem: p02948
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
pay = []
for _ in range(n):
    a, b = map(int, input().split())
    pay.append((b, a))
pay = sorted(pay, reverse=True)
days = 0
ans = 0
for i in range(n):
    if days + pay[i][1] <= m:
        days += 1
        ans += pay[i][0]
print(ans)

Failing test case input:
3 4
4 3
3 0
2 4

Expected output:
7


Actual output:
4


Fixed submission (verdict: Accepted):
from heapq import *
n, m = map(int, input().split())
pay = []
for _ in range(n):
    a, b = map(int, input().split())
    pay.append((a, b))
pay = sorted(pay, reverse=True)
q = []
ans = 0
for i in range(1, m+1):
    while pay and pay[-1][0] <= i:
        a, b = pay.pop()
        heappush(q, -b)
    if q:
        b = -heappop(q)
        ans += b
print(ans)
Problem: p02948
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq

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

a = [[] for i in range(100000)]
d = []
heapq.heapify(d)

for _ in range(n):
    b,c = map(int,input().split())
    a[b-1].append(-1 * c)



ans = 0
for i in range(m):
    for j in range(len(a[i])):
        heapq.heappush(d,a[i][j])
    if d == []:
        break
    ans -= heapq.heappop(d)

print(ans)

Failing test case input:
3 4
4 3
3 0
3 2

Expected output:
5


Actual output:
0


Fixed submission (verdict: Accepted):
import heapq

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

a = [[] for i in range(100000)]
d = []
heapq.heapify(d)

for _ in range(n):
    b,c = map(int,input().split())
    a[b-1].append(-1 * c)



ans = 0
for i in range(m):
    for j in range(len(a[i])):
        heapq.heappush(d,a[i][j])
    if d != []:
        ans -= heapq.heappop(d)

print(ans)

Problem: p02948
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq
n,m=map(int,input().split())
l=[]
for i in range(n):
  a,b=map(int,input().split())
  l.append([a,b])
l.sort()
l.append([0,0])
ans=0
k=[]
j=0
for i in range(1,m+1):
  while j<=n and l[j][0]<=i:
    heapq.heappush(k, l[j][1])
    j+=1
  if len(k)!=0:
  	ans+=k[-1]
  	k.pop(-1)
print(ans)

Failing test case input:
3 4
4 3
4 0
3 2

Expected output:
5


Actual output:
2


Fixed submission (verdict: Accepted):
import heapq
n,m=map(int,input().split())
l=[]
for i in range(n):
  a,b=map(int,input().split())
  l.append([a,b])
l.sort()
l.append([0,0])
ans=0
k=[]
j=0
for i in range(1,m+1):
  while j<=n and l[j][0]<=i:
    heapq.heappush(k, -1*l[j][1])
    j+=1
  if len(k)!=0:
  	ans+=-1*k[0]
  	heapq.heappop(k)
print(ans)

Problem: p02948
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    [N, M] = [int(number) for number in input().split()]
    part_times = []
    for i in range(N):
        [a, b] = [int(number) for number in input().split()]
        
        part_times.append([b, a])
        
    part_times = sorted(part_times, key = lambda x: (x[0], x[1]))
    print(part_times)
    money = 0
    day = 0

    

    for part_time in part_times:
        [b,a] = part_time
        if a + day <= M:
            day += a
            money += b
        else:
            continue
    print(money)

if __name__ == '__main__':
    main()


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

Expected output:
0


Actual output:
[[1, 3], [1, 4], [3, 2]]
0


Fixed submission (verdict: Accepted):
import heapq

def main():
    [N, M] = [int(number) for number in input().split()]
    part_times = []
    for i in range(N):
        job= [int(number) for number in input().split()]
        part_times.append(job)
    part_times = [part_time for part_time in sorted(part_times, key = lambda x: x[0])] 
    money = 0
    hp = []
    for day in range(M):
        while part_times != [] and part_times[0][0] <= day + 1:
            part_time = part_times[0]
            heapq.heappush(hp, - part_time[1])
            part_times.pop(0)
        if hp != []:
            money -= heapq.heappop(hp)

    print(money)

if __name__ == '__main__':
    main()
Problem: p02948
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
W = [tuple(map(int, input().split())) for i in range(N)]
W.sort(key=lambda x: -1000000*x[1]-x[0])

day = 0
ans = 0
for i in range(N):
    if M-day-W[i][0] >= 0:
       ans += W[i][1]
       day += 1
    if day >= M:
        break

print(ans)

Failing test case input:
3 4
4 3
3 0
3 4

Expected output:
7


Actual output:
4


Fixed submission (verdict: Accepted):
import heapq
N, M = map(int, input().split())
W = [tuple(map(int, input().split())) for i in range(N)]
W.sort()
h = []

j = 0
ans = 0
for i in range(M+1):
    while j < N and W[j][0] < i+1:
        heapq.heappush(h, (-W[j][1], W[j][1]))
        j += 1
    if h:
        p = heapq.heappop(h)
        ans += p[1]

print(ans)

Problem: p02948
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def p_d():
    n, m = map(int, input().split())
    a = []
    b = []
    ans = 0

    for _ in range(n):
        s = list(map(int, input().split()))
        a.append(s[0])
        b.append(s[1])

    lv = [a[i] * b[i] for i in range(len(a))]
    li = sorted(zip(lv, a, b), reverse=True)

    for i in range(m):
        for j in range(len(li)):
            if li[j][1] <= m - i:
                ans += li.pop(j)[2]
                break

    print(ans)


if __name__ == '__main__':
    p_d()


Failing test case input:
3 4
4 3
3 1
2 4

Expected output:
8


Actual output:
7


Fixed submission (verdict: Accepted):
from heapq import heappop, heappush


def p_d():
    n, m = map(int, input().split())
    ab = [tuple(map(int, input().split())) for _ in range(n)]

    ab.sort()
    ans = 0
    j = 0
    H = []

    for i in range(1, m + 1):
        while j < n and ab[j][0] <= i:
            heappush(H, -ab[j][1])
            j += 1

        if H:
            ans -= heappop(H)

    print(ans)


if __name__ == '__main__':
    p_d()
Problem: p02948
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import sys


from heapq import heapify, heappop

def solve(N, M, jobs):
    heapify(jobs)
    ans = 0
    while jobs:
        B, A = heappop(jobs)
        A, B = -A, -B
        if M >= A:
            M -= 1
            ans += B
    return ans


def main(args):
    N, M = map(int, input().split())
    jobs = []
    for _ in range(N):
        A, B = map(int, input().split())
        jobs.append([-B, -A])
    ans = solve(N, M, jobs)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])


Failing test case input:
3 4
4 3
3 0
2 4

Expected output:
7


Actual output:
4


Fixed submission (verdict: Accepted):


import sys


from heapq import heapify, heappop, heappush

def solve(N, M, jobs):
    heapify(jobs)
    availables = []
    ans = 0
    for day in range(1, M+1):
        while jobs and jobs[0][0] <= day:
            A, B = heappop(jobs)
            heappush(availables, (-B))
        if availables:
            ans -= heappop(availables)
    return ans


def main(args):
    N, M = map(int, input().split())
    jobs = []
    for _ in range(N):
        A, B = map(int, input().split())
        jobs.append((A, B))
    ans = solve(N, M, jobs)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
Problem: p02420
Buggy submission (Python3, verdict: Wrong Answer):
al=input()
m=int(input())
for i in range(m):
  n = int(input())
  if n=='-':
    break
  else:
   al= al[n:] + al[:n]
print(al)

Failing test case input:
a`ac
3
1
4
1
vwxzz
2
0
1
-

Expected output:
aca`
wxzzv


Actual output:
aca`


Fixed submission (verdict: Accepted):
while True:
 al=input()
 if al=='-':
     break
 else:
  m=int(input())
  for i in range(m):
   n = int(input())
   al= al[n:] + al[:n]
  print(al)

Problem: p02420
Buggy submission (Python3, verdict: Wrong Answer):
while 1:
    a = input()
    if a == '-':
        break
    n = int(input())
    for i in range(n):
        h = int(input())
        a = a[h:] + a[:h]
        print(a)
    print(a)


Failing test case input:
aaac
3
1
0
2
vyxyz
2
1
5
-

Expected output:
caaa
yxyzv


Actual output:
aaca
aaca
caaa
caaa
yxyzv
yxyzv
yxyzv


Fixed submission (verdict: Accepted):
while 1:
    a = input()
    if a == '-':
        break
    n = int(input())
    for i in range(n):
        h = int(input())
        a = a[h:] + a[:h]
    print(a)

Problem: p02420
Buggy submission (Python3, verdict: Wrong Answer):
s = []
n = []
while True:
    hoge = input()
    if len(hoge) == 1:
        if hoge == '-':
            break
        s[0] = s[0].replace(s[0],s[0][int(hoge):]+s[0][:int(hoge)])
    else:
        s += [hoge]
for i in s: print(i)

Failing test case input:
caaa
3
1
-2
2
wwxyz
2
3
4
-

Expected output:
aaac
xyzww


Actual output:
acaa
-2
wwxyz


Fixed submission (verdict: Accepted):
s = []
while True:
    hoge = input()
    if hoge == '-':
        break
    num = int(input())
    for i in range(num):
        h = int(input())
        hoge = hoge.replace(hoge,hoge[h:] + hoge[:h])
    s += [hoge]
for i in s: print(i)

Problem: p02420
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    s = input()
    if s == '-':
        break
    m = int(input())
    for mi in range(m):
        h = int(input())

        s = s[:h] + s[h:]
    print(s)

Failing test case input:
caaa
3
2
0
2
vwxyz
2
3
1
-

Expected output:
caaa
zvwxy


Actual output:
caaa
vwxyz


Fixed submission (verdict: Accepted):
while True:
    s = input()
    if s == '-':
        break
    m = int(input())
    for mi in range(m):
        h = int(input())

        s = s[h:] + s[:h]
    print(s)

Problem: p02420
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    s = input()
    if s == '-':
        break

    m = int(input())
    for mi in range(m):
        h = int(input())
        s = s[:h] + s[h:]

    print(s)

Failing test case input:
caaa
3
1
-3
2
wwxyz
2
4
4
-

Expected output:
caaa
yzwwx


Actual output:
caaa
wwxyz


Fixed submission (verdict: Accepted):
while True:
    s = input()
    if s == '-':
        break

    m = int(input())
    for mi in range(m):
        h = int(input())
        s = s[h:] + s[:h]

    print(s)
Problem: p02420
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    data = input()
    if(data == "-"):break
    m = int(input())
    tmp = []
    flag = False
    for i in range(m):
        num = int(input())
        if(flag):
            tmp = data[num:] + data[:num]  
            flag = True
            data = ""
        else:
            data = tmp[num:] + tmp[:num]
            flag = False
            tmp = ""


Failing test case input:
aaac
3
1
2
2
vxxyz
2
3
4
-

Expected output:
aaca
xyzvx


Actual output:

Fixed submission (verdict: Accepted):
while True:
    data = input()
    if(data == "-"):break
    m = int(input())
    tmp = []

    for i in range(m):
        num = int(input())
        if(len(tmp) == 0):
            tmp = data[num:] + data[:num]
            data = ""
        else:
            data = tmp[num:] + tmp[:num]
            tmp = ""
    if(data): print(data)
    else: print(tmp)

Problem: p02420
Buggy submission (Python3, verdict: Wrong Answer):


def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    while True:
        string = input()
        if string == "-": break
        n = int(input())  
        for i in range(n):
            h = int(input())
            front = string[0 : h]
            back = string[h : len(string) - h]
            string = back + front
        print(string)

if __name__ == "__main__":
    main()


Failing test case input:
acaa
3
1
0
2
yzxwv
2
2
2
-

Expected output:
aaca
vyzxw


Actual output:
ca
xy


Fixed submission (verdict: Accepted):


def main():
    while True:
        string = input()
        if string == "-": break
        n = int(input())  
        for i in range(n):
            h = int(input())
            front = string[0 : h]  
            back = string[h : len(string)]  
            string = back + front
        print(string)

if __name__ == "__main__":
    main()

Problem: p02420
Buggy submission (Python3, verdict: Wrong Answer):
while True:

    string = str(input())
    box = ""
    
    
    if string == "-":
        break
    
    shuffle = int(input())

    h = [0]*shuffle

    for a in range(shuffle):
        h[a] = int(input())

    for b in range(shuffle):
        box = string[0:h[b]]
        string = string[h[b]:]
        string = string+box
        box = ""
        print(string)

    print(string)


Failing test case input:
aaac
3
1
2
1
vwxyz
2
2
4
-

Expected output:
aaac
wxyzv


Actual output:
aaca
caaa
aaac
aaac
xyzvw
wxyzv
wxyzv


Fixed submission (verdict: Accepted):
while True:

    string = str(input())
    box = ""
    
    
    if string == "-":
        break
    
    shuffle = int(input())

    h = [0]*shuffle

    for a in range(shuffle):
        h[a] = int(input())

    for b in range(shuffle):
        box = string[0:h[b]]
        string = string[h[b]:]
        string = string+box
        box = ""

    print(string)
Problem: p02420
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    S = input()
    if S == "-":break
    m = int(input())
    sum = 0
    for i in range(m):sum+=int(input())
    if sum%len(S)==0:print(S)
    else:
        print(S[len(S)-sum%len(S)-1:]+S[:len(S)-sum%len(S)-1])


Failing test case input:
ca`a
3
1
3
2
vwxyz
2
2
4
-

Expected output:
`aca
wxyzv


Actual output:
a`ac
yzvwx


Fixed submission (verdict: Accepted):
while True:
    S = input()
    if S == "-":break
    m = int(input())
    sum = 0
    for i in range(m):sum+=int(input())
    if sum%len(S)==0:print(S)
    else:
        print(S[sum%len(S):]+S[:sum%len(S)])

Problem: p02420
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    card = input()
    if card == "-":
        break
    for i in range(int(input())):
        h = int(input())
        card = card.lstrip(card[:h]) + card[:h]
    print(card)

Failing test case input:
caaa
3
2
0
2
vwxyz
2
1
0
-

Expected output:
caaa
wxyzv


Actual output:
ca
wxyzv


Fixed submission (verdict: Accepted):
while True:
    card = input()
    if card == "-":
        break
    for i in range(int(input())):
        h = int(input())
        card = card[h:] + card[:h]
    print(card)
Problem: p02639
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

n = []

n = input().split()

for i in range(5):
    n[i] = int(n[i])

print(n)
for i in range(5):
    if n[i] == 0:
        print(i+1)

Failing test case input:
0 2 3 4 5

Expected output:
1

Actual output:
[0, 2, 3, 4, 5]
1


Fixed submission (verdict: Accepted):

n = []

n = input().split()

for i in range(5):
    n[i] = int(n[i])

for i in range(5):
    if n[i] == 0:
        print(i+1)

Problem: p02639
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
user_input = list(map(int, input().split()))


indexOfZero = [x for x in range(0, 5) if user_input[x] == 0]
print(indexOfZero[0])

Failing test case input:
0 2 3 4 5

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
user_input = list(map(int, input().split()))


indexOfZero = [x for x in range(0, 5) if user_input[x] == 0]
print(indexOfZero[0] + 1)

Problem: p02639
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = map(int,input().split())
y =15
print(y)
print(y-sum(x))

Failing test case input:
0 2 3 4 5

Expected output:
1

Actual output:
15
1


Fixed submission (verdict: Accepted):
x = map(int,input().split())
y =15
print(y-sum(x))

Problem: p02639
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=list(map(int,input().split()))
for i in range(len(n)):
 if n[i]==0:
  print(i)
  break

Failing test case input:
0 2 3 4 5

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n=list(map(int,input().split()))
for i in range(len(n)):
 if n[i]==0:
  print(i+1)
  break

Problem: p02639
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x1, x2, x3, x4, x5 = map(int, input().split())

l = [x1, x2, x3, x4, x5]
ls = [str(n) for n in l]
s = ''.join(ls).find('0')
print(s)

Failing test case input:
0 2 3 4 5

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
x1, x2, x3, x4, x5 = map(int, input().split())

l = [x1, x2, x3, x4, x5]
ls = [str(n) for n in l]
s = ''.join(ls).find('0')
print(s+1)

Problem: p02639
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = list(map(int, input().split()))
if x[0] == 0: print(1)
if x[1] == 0: print(2)
if x[2] == 0: print(3)
if x[3] == 0: print(4)
if x[4]: print(5)

Failing test case input:
0 2 3 4 5

Expected output:
1

Actual output:
1
5


Fixed submission (verdict: Accepted):
x = list(map(int, input().split()))
if x[0] == 0: print(1)
if x[1] == 0: print(2)
if x[2] == 0: print(3)
if x[3] == 0: print(4)
if x[4] == 0: print(5)

Problem: p02639
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
num = input().split()
for i in range(0,len(num)):
  if num[i] == 0:
    print(i+1)
  

Failing test case input:
0 2 3 4 5

Expected output:
1

Actual output:

Fixed submission (verdict: Accepted):
num = input().split()
for i in range(0,len(num)):
  if int(num[i]) == 0:
    print(i+1)
Problem: p02639
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
li = list(map(int,input().split()))
for i in range(0,5):
  if li[i] == 0:
    print(i)

Failing test case input:
0 2 3 4 5

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
li = list(map(int,input().split()))
for i in range(0,5):
  if li[i] == 0:
    print(i + 1)

Problem: p02639
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, C, D, E = map(int, input().split())

result = 15 - (A+B+C+D+E)

Failing test case input:
0 2 3 4 5

Expected output:
1

Actual output:

Fixed submission (verdict: Accepted):
A, B, C, D, E = map(int, input().split())

result = 15 - (A+B+C+D+E)
print(result)

Problem: p02639
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys

stdin = sys.stdin

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

x = na()
c = 0
for i in x:
  c += 1
  if i == 0:
    c = i
print(c+1)


Failing test case input:
0 2 3 4 5

Expected output:
1

Actual output:
5


Fixed submission (verdict: Accepted):
import sys

stdin = sys.stdin

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

x = na()

for i in range(5):
  if x[i] == 0:
    print(i+1)