ZhenlongDai/ACPR huggingface dataset:
Problem: p04030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()[::-1]
res = ""

ruiseki = 0
for s in S:
    if s == 'B':
        ruiseki += 1
    else:
        if ruiseki > 0:
            ruiseki -= 1
        else:
            res += s
print(res)


Failing test case input:
CB01

Expected output:
01


Actual output:
10


Fixed submission (verdict: Accepted):
S = input()[::-1]
res = ""

ruiseki = 0
for s in S:
    if s == 'B':
        ruiseki += 1
    else:
        if ruiseki > 0:
            ruiseki -= 1
        else:
            res += s
print(res[::-1])

Problem: p04030
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S=str(input())
ans=""
for i in range(len(S)):
    if S[i]=="B":
        ans=ans[:len(ans)-1]
    else:
        ans+=S[i]
    print(ans)
print(ans)

Failing test case input:
B000

Expected output:
000


Actual output:

0
00
000
000


Fixed submission (verdict: Accepted):
S=str(input())
ans=""
for i in range(len(S)):
    if S[i]=="B":
        ans=ans[:len(ans)-1]
    else:
        ans+=S[i]
print(ans)

Problem: p04030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=list(input())
out=[]
for i in range(len(s)):
    if s[i]=="B" and out==[]:
        out=[]
    elif s[i]=="B":
        del(out[-1])
    else:
        out.append(s[i])
for i in range(len(out)):
    print(out[i])

Failing test case input:
/B11

Expected output:
11


Actual output:
1
1


Fixed submission (verdict: Accepted):
s=list(input())
out=[]
for i in range(len(s)):
    if s[i]=="B" and out==[]:
        out=[]
    elif s[i]=="B":
        del(out[-1])
    else:
        out.append(s[i])
for i in range(len(out)):
    print(out[i],end="")

Problem: p04030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def b(x):
  if x=='':return''
  else:return x[:-1]
s,ans=input(),''
for i in range(len(s)):
  if s[i]!='B':ans=b(ans)
  else:ans+=s[i]
print(ans)

Failing test case input:
2B00

Expected output:
00


Actual output:

Fixed submission (verdict: Accepted):
def b(x):
  if x=='':return''
  else:return x[:-1]
s,ans=input(),''
for i in range(len(s)):
  if s[i]=='B':ans=b(ans)
  else:ans+=s[i]
print(ans)

Problem: p04030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l = list(input())

print(l)
list = []

for i in range(len(l)):
    if l[i] == 'B':
        if not list:
            continue
        else:
            del list[-1]
    else:
        list.append(l[i])

print(''.join(list))


Failing test case input:
010B

Expected output:
01


Actual output:
['0', '1', '0', 'B']
01


Fixed submission (verdict: Accepted):
l = list(input())

list = []

for i in range(len(l)):
    if l[i] == 'B':
        if not list:
            continue
        else:
            del list[-1]
    else:
        list.append(l[i])

print(''.join(list))
Problem: p04030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
str = ""

for i in range(len(s)):
  if s[i] == 'B':
    str = str[0:-2]
  else:
    str += s[i]

print(str)


Failing test case input:
010B

Expected output:
01


Actual output:
0


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

for i in range(len(s)):
  if s[i] == 'B':
    str = str[0:-1]
  else:
    str += s[i]

print(str)

Problem: p04030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
ans = ''
for si in s:
    if si == 'B' and len(ans) > 0:
        ans = ans[:-1]
    else:
        ans += si
print(ans)

Failing test case input:
B00B

Expected output:
0


Actual output:
B0


Fixed submission (verdict: Accepted):
s = input()
ans = ''
for si in s:
    if si == 'B':
        ans = ans[:-1]
    else:
        ans += si
print(ans)

Problem: p04030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
new_list = ""
for i in range(len(s)):
    if s[i] != 'B':
        new_list +=s[i]
    else:
        if(len(new_list) > 2):
            new_list = new_list[-2]
        else:
            new_list = ""

print(new_list)

Failing test case input:
00B0

Expected output:
00


Actual output:
0


Fixed submission (verdict: Accepted):
s = list(input())
new_list = ""
for i in s:
    if i != 'B':
        new_list +=i
    else:
        if(len(new_list) >= 2):
            new_list = new_list[:-1]
        else:
            new_list = ""
print(new_list)

Problem: p04030
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
a=''
for i in s:
    if i=='B':
        if len(a)!=0:a=a[:-1]
    else:a+=i
    print(a,i)
print(a)

Failing test case input:
0@B1

Expected output:
01


Actual output:
0 0
0@ @
0 B
01 1
01


Fixed submission (verdict: Accepted):
a=''
for i in input():
    if i=='B':
        if len(a)!=0:a=a[:-1]
    else:a+=i
print(a)

Problem: p04030
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = list(input())
Answer = []

for s in S:
    if s == 'B' and Answer != []:
        del Answer[-1]
    else:
        Answer.append(s)

print(*Answer, sep="")


Failing test case input:
B011

Expected output:
011


Actual output:
B011


Fixed submission (verdict: Accepted):
S = list(input())
Answer = []

for s in S:
    if s == 'B' and Answer != []:
        del Answer[-1]
    elif s == 'B' and Answer == []:
        continue
    else:
        Answer.append(s)

print(*Answer, sep="")
Problem: p03156
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N=int(input())
A,B=map(int,input().split())
P=list(map(int,input().split()))

q1=len([i for i in range(N) if P[i]<=A])
q2=len([i for i in range(N) if A<P[i]<=B])
q3=len([i for i in range(N) if P[i]<B])

ans=min(q1,q2,q3)
print(ans)

Failing test case input:
8
2 30
0 5 0 3 -2 24 28 0

Expected output:
0


Actual output:
4


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

q1=len([i for i in range(N) if P[i]<=A])
q2=len([i for i in range(N) if A<P[i]<=B])
q3=len([i for i in range(N) if B<P[i]])

ans=min(q1,q2,q3)
print(ans)

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a, b = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]





q_a = 0
q_b = 0
q_c = 0

for i in sorted(p):
    if i <= a:
       q_a += 1
    if a < i <= b:
        q_b += 1
    else:
        q_c += 1

print(min([q_a, q_b, q_c]))

Failing test case input:
7
7 40
-2 30 28 2 4 10 13

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
a, b = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]





q_a = 0
q_b = 0
q_c = 0

for i in p:
    if i <= a:
        q_a += 1
    elif a < i <= b:
        q_b += 1
    else:
        q_c += 1

print(min([q_a, q_b, q_c]))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a,b=map(int,input().split())
p=list(map(int,input().split()))
x=y=z=0
for i in range(n):
    if p[i]<=a :
        x+=1
    if p[i]>=a+1 and b<=p[i]:
        y+=1
    if p[i]>=b+1:
        z+=1
print(min(x,y,z))

Failing test case input:
7
7 22
-3 0 82 2 2 3 5

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
n=int(input())
a,b=map(int,input().split())
p=list(map(int,input().split()))
x=y=z=0
for i in range(n):
    if p[i]<=a :
        x+=1
    if p[i]>=a+1 and b>=p[i]:
        y+=1
    if p[i]>=b+1:
        z+=1
print(min(x,y,z))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def resolve():
    n = int(input())
    a, b = map(int, input().split())
    p = list(map(int, input().split()))
    low, mid, high = 0, 0, 0
    for pi in p:
        if pi <= a:
            low += 1
        elif a + 1 <= pi <= a:
            mid += 1
        else:
            high += 1
    print(min(low, mid, high))


if __name__ == "__main__":
    resolve()


Failing test case input:
8
3 14
2 5 6 2 13 12 15 22

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
def resolve():
    n = int(input())
    a, b = map(int, input().split())
    p = list(map(int, input().split()))
    low, mid, high = 0, 0, 0
    for pi in p:
        if pi <= a:
            low += 1
        elif a + 1 <= pi <= b:
            mid += 1
        else:
            high += 1
    print(min(low, mid, high))


if __name__ == "__main__":
    resolve()
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())
A, B = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]


P.sort()
for i in range(N):
    if P[i]>A: break
a = i 
for i in range(a+1,N):
    if P[i]>=B: break
b = i - a 


count = min(a, b, N-(b+a))
print(count)



Failing test case input:
7
7 40
-2 21 28 2 10 20 13

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):

N = int(input())
A, B = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

P.sort()


for i in range(N):
    if P[i]>A: break
a = i 
for i in range(a,N):
    if P[i]>B: break
else:
    i = N
b = i - a 
c = N - i


count = min(a, b, c)
print(count)

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = list(map(int, input().split()))
P = list(map(int, input().split()))

P.sort()

c1, c2, c3 = 0, 0, 0
for i, p in enumerate(P, 1):
    if p <= A:
        c1 = i
    if (p > A) and (p <= B):
        c2 = i
    if p > B:
        c3 = i

print(min((c1), (c2 - c1), (c3 - c2)))


Failing test case input:
3
48 0
1 1 1

Expected output:
0


Actual output:
-3


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

P.sort()

c1, c2, c3 = 0, 0, 0
for i, p in enumerate(P, 1):
    if p <= A:
        c1 = i
    if (p > A) and (p <= B):
        c2 = i
    if p > B:
        c3 = i


if c1 <= c2 <= c3:
    print(min((c1), (c2 - c1), (c3 - c2)))
else:
    print(0)

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))

p.sort()

s = 0
t = 0

for i in p:
    if i <= a:
        s += 1
        t += 1
    elif i <= b:
        t += 1

ans = min(s, t-s, len(p))

print(ans)

Failing test case input:
8
3 14
2 5 0 2 13 12 15 22

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))

p.sort()

s = 0
t = 0

for i in p:
    if i <= a:
        s += 1
        t += 1
    elif i <= b:
        t += 1

ans = min(s, t-s, len(p)-t)

print(ans)

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
c = 0
i = 0
d = 0
for i in range(n):
    if d == 0 and p[i] <= a:
        d = 1
    elif d == 1 and (a+1 <= p[i] <=b):
        d = 2
    elif d == 2 and (b+1 <= p[i]):
        d = 0
        c += 1
print(c)

Failing test case input:
8
2 16
4 5 0 2 13 12 28 19

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
c1,c2, c3 = 0,0,0
for i in range(n):
    if p[i] <= a:
        c1 +=1
    elif (a+1) <= p[i] <= b:
        c2 += 1
    elif (b+1) <= p[i]:
        c3 += 1
print(min(c1,c2,c3))
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
one = sum(1 for i in p if i <= a)
two = sum(1 for i in p if a + 1 <= i <= b)
three = sum(1 for i in p if b <= i)
print(min(one, two, three))

Failing test case input:
8
3 15
4 5 0 2 13 12 15 19

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
one = sum(1 for i in p if i <= a)
two = sum(1 for i in p if a + 1 <= i <= b)
three = sum(1 for i in p if b + 1<= i)
print(min(one, two, three))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
uA = []
oAuB = []
oB = []
for i in range(N):
    if P[i] <= A:
        uA.append(P[i])
    if A+1 <= P[i] and P[i] <= B:
        oAuB.append(P[i])
    if B+1 <= P[i]:
        oB.append(P[i])
print(len(uA) & len(oAuB) & len(oB))


Failing test case input:
8
3 16
4 5 0 2 13 12 15 19

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
uA = []
oAuB = []
oB = []
for i in range(N):
    if P[i] <= A:
        uA.append(P[i])
    if A+1 <= P[i] and P[i] <= B:
        oAuB.append(P[i])
    if B+1 <= P[i]:
        oB.append(P[i])
print(min(len(uA), len(oAuB), len(oB)))

Problem: p03156
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
count1,count2,count3 = 0,0,0
for i in range(N):
  if P[i] <= A:
    count1 += 1
  if P[i] >= B+1:
    count3 += 1
  if P[i] >= A+1:
    count2 += 1

print(min(count1,count2,count3))

Failing test case input:
3
6 0
5 9 3

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
count1,count2,count3 = 0,0,0
for i in range(N):
  if P[i] <= A:
    count1 += 1
  if P[i] >= B+1:
    count3 += 1
    continue
  if P[i] >= A+1:
    count2 += 1
print(min(count1,count2,count3))

Problem: p03156
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
a,b = map(int,input().split())
p = [int(x) for x in input().split()]

p.sort()

p1 = [i for i in p if i<=a]
p2 = [j for j in p if a<j<=b]
p3 = [k for k in p if b<k]

print(min([p1,p2,p3]))


Failing test case input:
3
31 0
1 1 0

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
a,b = map(int,input().split())
p = [int(x) for x in input().split()]

p.sort()

p1 = [i for i in p if i<=a]
p2 = [j for j in p if a<j<=b]
p3 = [k for k in p if b<k]

print(min([len(p1),len(p2),len(p3)]))
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())
A, B = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

P.sort()


for i in range(N):
    if P[i]>A: break
a = i 
for i in range(a+1,N):
    if P[i]>B: break
b = i - a 
c = N - i + 1


count = min(a, b, c)
print(count)



Failing test case input:
8
2 16
4 5 0 2 0 12 28 0

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):

N = int(input())
A, B = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

P.sort()


for i in range(N):
    if P[i]>A: break
a = i 
for i in range(a,N):
    if P[i]>B: break
else:
    i = N
b = i - a 
c = N - i


count = min(a, b, c)
print(count)

Problem: p03156
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from sys import stdin
N = int(stdin.readline().rstrip())
A, B = [int(_) for _ in stdin.readline().rstrip().split()]
P = [int(_) for _ in stdin.readline().rstrip().split()]
a, ab, b = 0, 0, 0
for p in P:
    if p <= A:
        a += 1
    elif A+1 <= p <= B:
        ab += 1
    elif B+1 <= p:
        b += 1
print(min(a, ab, p))

Failing test case input:
7
5 25
1 21 28 2 7 20 13

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
from sys import stdin
N = int(stdin.readline().rstrip())
A, B = [int(_) for _ in stdin.readline().rstrip().split()]
P = [int(_) for _ in stdin.readline().rstrip().split()]
a, ab, b = 0, 0, 0
for p in P:
    if p <= A:
        a += 1
    elif A < p <= B:
        ab += 1
    elif B < p:
        b += 1
print(min(a, ab, b))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a, b = map(int, input().split())
p = list(map(int,input().split()))
x = 0
y = 0
z = 0
        
for i in range(n):
  if p[i] < a:
    x = x + 1
  if a < p[i] < b:
    y = y + 1
  else:
    z = z+1

print(min(x, y, z))

Failing test case input:
7
7 40
-2 21 28 2 4 10 13

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
x = 0
y = 0
z = 0
        
for i in range(n):
  if p[i] <= a:
    x = x + 1
  if a < p[i] <= b:
    y = y + 1
  if b < p[i]:
    z = z + 1

print(min(x, y, z))
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a,b = na()
p = na()
c = [0,0,0]

for i in p:
    if i <= a:
        c[0] += 1
    elif a+1 < i <= b:
        c[1] += 1
    else:
        c[2] += 1

print(min(c))

Failing test case input:
8
2 16
0 5 0 3 0 12 28 0

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a,b = na()
p = na()
c = [0,0,0]

for i in p:
    if i <= a:
        c[0] += 1
    elif a+1 <= i <= b:
        c[1] += 1
    else:
        c[2] += 1

print(min(c))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a, b = map(int , input().split())
p = list(map(int, input().split()))
group_a = len([i for i in p if i <= a])
group_b = len([i for i in p if i < a and i <= b])
group_c = len([i for i in p if i > b])
print(min( group_a, group_b, group_c))


Failing test case input:
3
6 0
-1 1 0

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a, b = map(int , input().split())
p = list(map(int, input().split()))
group_a = len([i for i in p if i <= a])
group_b = len([i for i in p if i > a and i <= b])
group_c = len([i for i in p if i > b])
print(min(group_a, group_b, group_c))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
(A, B) = list(map(int, input().split()))
P = list(map(int, input().split()))
COUNT = [0, 0, 0]
for i in sorted(P):
    if i <= A:
        COUNT[0] += 1
    if i <= B:
        COUNT[1] += 1
    else:
        COUNT[2] += 1
print(min(COUNT))

Failing test case input:
3
11 0
1 1 0

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
(A, B) = list(map(int, input().split()))
P = list(map(int, input().split()))
COUNT = [0, 0, 0]
for i in sorted(P):
    if i <= A:
        COUNT[0] += 1
    elif i <= B:
        COUNT[1] += 1
    else:
        COUNT[2] += 1
print(min(COUNT))
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a, b = map(int, input().split())
p = sorted(list(map(int, input().split())))
cnt_1, cnt_2, cnt_3 = 0,0,0
for i in range(n):
	if p[i] > a:
		break
	cnt_1 += 1

for j in range(i,n):
	if p[j] > b:
		break
	cnt_2 += 1

	if j == n-1:
		print(0)
	else:
		cnt_3 = n-j
		print(min(cnt_1,cnt_2,cnt_3))

Failing test case input:
7
5 21
1 21 28 2 7 20 12

Expected output:
1


Actual output:
1
2
2
2


Fixed submission (verdict: Accepted):
import sys

n = int(input())
a, b = map(int, input().split())
p = sorted(list(map(int, input().split())))
cnt_1, cnt_2, cnt_3 = 0,0,0
for i in range(n):
	if p[i] > a:
		break
	cnt_1 += 1

for j in range(i,n):
	if p[j] > b:
		break
	cnt_2 += 1

	if j == n-1:
		print(0)
		sys.exit()

cnt_3 = n-j
print(min(cnt_1,cnt_2,cnt_3))

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

N = int(input())
A, B = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]


P.sort()
for i in range(N):
    if P[i]>A: break
a = i 
for i in range(A+1,N):
    if P[i]>B: break
b = i - a 


count = min(a, b, N-(b+a))
print(count)



Failing test case input:
7
7 40
-3 8 82 2 2 10 5

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):

N = int(input())
A, B = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

P.sort()


for i in range(N):
    if P[i]>A: break
a = i 
for i in range(a,N):
    if P[i]>B: break
else:
    i = N
b = i - a 
c = N - i


count = min(a, b, c)
print(count)

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = map(int,input().split())
P = [int(i) for i in input().split()]

a = sum(i<=A for i in P)
b = sum(A<i<=B for i in P)

print(min(a, b, 20-a-b))


Failing test case input:
8
2 16
4 5 0 2 0 12 28 19

Expected output:
2


Actual output:
3


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

a = sum(i<=A for i in P)
b = sum(A<i<=B for i in P)

print(min(a, b, N-a-b))

Problem: p03156
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
count1,count2,count3 = 0,0,0
for i in range(N):
  if P[i] <= A:
    count1 += 1
  if P[i] >= B+1:
    count3 += 1
    continue
  if P[i] >= A+1:
    count2 += 1
count4 = max(count2,count3)
print(min(count1,count4))

Failing test case input:
3
48 0
1 1 0

Expected output:
0


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
count1,count2,count3 = 0,0,0
for i in range(N):
  if P[i] <= A:
    count1 += 1
  if P[i] >= B+1:
    count3 += 1
    continue
  if P[i] >= A+1:
    count2 += 1
print(min(count1,count2,count3))
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

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

li = []
for i in P:
  if i <= A:
    li.append(1)
  elif A < i <= B:
    li.append(2)
  else:
    li.append(3)
    
cli = Counter(li)

print(min(cli.values()))

Failing test case input:
3
6 0
5 1 2

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
from collections import Counter

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

li = []
for i in P:
  if i <= A:
    li.append(1)
  elif A < i <= B:
    li.append(2)
  else:
    li.append(3)
    
cli = Counter(li)

if len(cli.keys()) != 3:
  print(0)
else:
  print(min(cli.values()))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = [int(_) for _ in input().split()]
P =  [int(_) for _ in input().split()]
x = len([i for i in P if i <= A])
y = len([i for i in P if i <= B and i >= A+1])
z = len([i for i in P if i <= B])

if x != 0 and y != 0 and z != 0:
    print(min([x,y,z]))
else :
    print(0)

Failing test case input:
8
2 30
0 6 0 3 -2 26 56 -1

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
A, B = [int(_) for _ in input().split()]
P =  [int(_) for _ in input().split()]
x = len([i for i in P if i <= A])
y = len([i for i in P if i <= B and i >= A+1])
z = len([i for i in P if i >= B + 1])
 
if x != 0 and y != 0 and z != 0:
    print(min([x,y,z]))
else :
    print(0)

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = map(int,input().split())
list = [int(x) for x in input().split()]
counta = 0
countb = 0
countc = 0 
for p in list:
    if p < A:
        counta += 1
    elif B > p >= A+1:
        countb += 1
    elif p >= B+1:
        countc +=1
print(min(min(counta,countb),countc))

Failing test case input:
3
5 6
5 6 10

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
A, B = map(int,input().split())
list = [int(x) for x in input().split()]
counta = 0
countb = 0
countc = 0 
for p in list:
    if p <= A:
        counta += 1
    elif B >= p >= A+1:
        countb += 1
    elif p >= B+1:
        countc +=1
print(min(min(counta,countb),countc))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a,b=map(int,input().split())
l=list(map(int,input().split()))

c0=0
c1=0
c2=0
for i in range(n):
    if l[i]<=a:
        c0+=1
    if a<=l[i]<=b:
        c1+=1
    if l[i]>=b:
        c2+=1
print(min(c0,c1,c2))

Failing test case input:
7
5 21
1 21 28 2 7 20 13

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
a,b=map(int,input().split())
l=list(map(int,input().split()))

c0=0
c1=0
c2=0
for i in range(n):
    if l[i]<=a:
        c0+=1
    if a<l[i]<=b:
        c1+=1
    if l[i]>b:
        c2+=1
print(min(c0,c1,c2))
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



def solve():
    N = int(input())
    A,B  = map(int,input().split())
    P = list(map(int,input().split()))
    P1 = list(p for p in P if p<=A)
    P2 = list(p for p in P if A<p<=B)
    P3 = list(p for p in P if B<p)
    res = min(P1,P2,P3)
    return str(res)

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

Failing test case input:
7
7 25
-2 21 28 2 10 20 13

Expected output:
1


Actual output:
[-2, 2]


Fixed submission (verdict: Accepted):



def solve():
    N = int(input())
    A,B  = map(int,input().split())
    P = list(map(int,input().split()))
    P1 = list(p for p in P if p<=A)
    P2 = list(p for p in P if A<p<=B)
    P3 = list(p for p in P if B<p)
    res = min(len(P1),len(P2),len(P3))
    return str(res)

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

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A,B = map(int,input().split())
p = list(map(int,input().split()))
cntA = 0
cntB = 0
cntC = 0

for i in range(N):
    if int(p[i]) <= int(A):
        cntA += 1
    if int(p[i]) >= int(B)+1:
        cntB += 1
    if int(p[i]) >= int(A)+1 and int(p[i]) < int(B):
        cntC += 1

print(min(cntA,cntB,cntC))


Failing test case input:
3
5 6
5 6 10

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
A,B = map(int,input().split())
p = list(map(int,input().split()))
cntA = 0
cntB = 0
cntC = 0

for i in range(N):
    if int(p[i]) <= int(A):
        cntA += 1
    if int(p[i]) >= int(B)+1:
        cntB += 1
    if int(p[i]) >= int(A)+1 and int(p[i]) <= int(B):
        cntC += 1

print(min(cntA,cntB,cntC))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a, b = map(int, input().split())
p = sorted(list(map(int, input().split())))
cnt_1, cnt_2, cnt_3 = 0,0,0
for i in range(n):
	if p[i] > a:
		break
	cnt_1 += 1

for j in range(i,n):
	if p[j] > b:
		break
	cnt_2 += 1

cnt_3 = n-j

print(min(cnt_1,cnt_2,cnt_3))

Failing test case input:
7
7 40
-2 21 28 2 10 20 13

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
import sys

n = int(input())
a, b = map(int, input().split())
p = sorted(list(map(int, input().split())))
cnt_1, cnt_2, cnt_3 = 0,0,0
for i in range(n):
	if p[i] > a:
		break
	cnt_1 += 1

for j in range(i,n):
	if p[j] > b:
		break
	cnt_2 += 1

	if j == n-1:
		print(0)
		sys.exit()

cnt_3 = n-j
print(min(cnt_1,cnt_2,cnt_3))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
x = []
y = []
z = []

for i in P:
    if i <= A:
        x.append(i)
    elif i <= B:
        y.append(i)
    else:
        z.append(i)
print(len(min(x, y, z)))


Failing test case input:
7
7 40
-3 8 48 2 5 10 5

Expected output:
1


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
x = 0
y = 0
z = 0

for i in P:
    if i <= A:
        x += 1
    elif i <= B:
        y += 1
    else:
        z += 1
print(min(x, y, z))
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a,b = list(map(int, input().split()))
p = list(map(int, input().split()))

q = list([0,0,0])
for i in p:
    if i <= a:
        q[0] += 1
    elif i >= b:
        q[2] += 1
    else:
        q[1] +=1

print(min(q))


Failing test case input:
8
3 15
4 5 1 2 13 12 15 19

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
a,b = list(map(int, input().split()))
p = list(map(int, input().split()))

q = list([0,0,0])
for i in p:
    if i <= a:
        q[0] += 1
    elif i > b:
        q[2] += 1
    else:
        q[1] +=1

print(min(q))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
x = []
y = []
z = []

for i in P:
    if i <= A:
        x.append(i)
    elif (i >= A + 1) and (i <= B):
        y.append(i)
    else:
        z.append(i)
print(len(min(x, y, z)))


Failing test case input:
8
3 16
4 5 0 2 13 12 15 19

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
x = 0
y = 0
z = 0

for i in P:
    if i <= A:
        x += 1
    elif i <= B:
        y += 1
    else:
        z += 1
print(min(x, y, z))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = [int(_) for _ in input().split()]
P =  [int(_) for _ in input().split()]

x = len([i for i in P if i <= A])
y = len([i for i in P if i <= B and i >= A+1])
z = len([i for i in P if i <= B])

if x != 0 or y != 0 or z != 0:
    print(min([x,y,z]))
    print(x, y,z)
else :
    print(0)

Failing test case input:
7
5 25
1 21 28 2 7 20 13

Expected output:
1


Actual output:
2
2 4 6


Fixed submission (verdict: Accepted):
N = int(input())
A, B = [int(_) for _ in input().split()]
P =  [int(_) for _ in input().split()]
x = len([i for i in P if i <= A])
y = len([i for i in P if i <= B and i >= A+1])
z = len([i for i in P if i >= B + 1])
 
if x != 0 and y != 0 and z != 0:
    print(min([x,y,z]))
else :
    print(0)

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
c = 0
i = 0
d = 0
for i in range(n):
    if p[i] <= a:
        d = 1
    elif d == 1 and (a+1 <= p[i] <=b):
        d = 2
    elif d == 2 and (b+1 <= p[i]):
        d = 0
        c += 1
print(c)

Failing test case input:
8
3 14
2 5 5 2 13 12 15 20

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
c1,c2, c3 = 0,0,0
for i in range(n):
    if p[i] <= a:
        c1 +=1
    elif (a+1) <= p[i] <= b:
        c2 += 1
    elif (b+1) <= p[i]:
        c3 += 1
print(min(c1,c2,c3))
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a,b = map(int, input().split())
res = [0,0,0]
arr = list(map(int, input().split()))
for i in range(n):
  if arr[i] <= a:
    res[0] += 1
  elif arr[i] <= b:
    res[1] += 1
  else:
    res[2] += 1
print(min(arr))

Failing test case input:
7
5 15
1 13 28 2 7 20 12

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a,b = map(int, input().split())
res = [0,0,0]
arr = list(map(int, input().split()))
for i in range(n):
  if arr[i] <= a:
    res[0] += 1
  elif arr[i] <= b:
    res[1] += 1
  else:
    res[2] += 1
print(min(res))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = map(int, input().split())
P = [i for i in map(int, input().split())]

P.sort()

print(P)

p_1 = list(filter(lambda x: x<=A, P))
p_2 = list(filter(lambda x: A < x <= B, P))
p_3 = list(filter(lambda x: B <x, P))

print(min(len(p_1), len(p_2), len(p_3)))


Failing test case input:
8
3 16
4 5 0 2 13 12 28 19

Expected output:
2


Actual output:
[0, 2, 4, 5, 12, 13, 19, 28]
2


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

P.sort()


p_1 = list(filter(lambda x: x<=A, P))
p_2 = list(filter(lambda x: A < x <= B, P))
p_3 = list(filter(lambda x: B <x, P))

print(min(len(p_1), len(p_2), len(p_3)))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A,B = (int(i) for i in input().split())
P = [int(i) for i in input().split()]
s=t=u=0
for i in range(N):
    if P[i]<=A:
        s+=1
    if P[i]>A and i <= B:
        t+=1
    if P[i] > B:
        u+=1
re = min(s,t,u)
print(re)


Failing test case input:
7
7 22
-4 0 134 2 2 3 5

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
A,B = (int(i) for i in input().split())
P = [int(i) for i in input().split()]
s=t=u=0
for i in range(N):
    if P[i]<=A:
        s+=1
    if P[i]>A and P[i] <= B:
        t+=1
    if P[i] > B:
        u+=1
re = min(s,t,u)
print(re)

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A,B=(int(x) for x in input().split())
scores = input().split()
num = [0,0,0]
for i in range(N):
    score = int(scores[i])
    if (score <= A):
        num[0] += 1
    elif(score <= B):
        num[1] += 1
    else:
        num[2] +=1
max_value = 0
for i in range(3):
    if max_value < num[i]:
        max_value = num[i]
print(max_value)

Failing test case input:
3
21 0
1 1 0

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
A,B=(int(x) for x in input().split())
scores = input().split()
num = [0,0,0]
for i in range(N):
    score = int(scores[i])
    if (score <= A):
        num[0] += 1
    elif(score <= B):
        num[1] += 1
    else:
        num[2] += 1
max_value = num[2]
for i in range(2):
    if max_value > num[i]:
        max_value = num[i]
print(max_value)
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
A,B=map(int,input().split() )
P=list(map(int,input().split() ))
X1=sum( [p<=A for p in P])
X2=sum( [ (p>A and p<=B)  for p in P] )
X3=sum( [p>=B  for p in P] )
print(min([X1,X2,X3]))

Failing test case input:
7
5 21
1 21 28 2 7 20 12

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N=int(input())
A,B=map(int,input().split() )
P=list(map(int,input().split() ))
X1=sum( [p<=A for p in P])
X2=sum( [ (p>A and p<=B)  for p in P] )
X3=sum( [p>B  for p in P] )
print(min([X1,X2,X3]))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a,b = map(int,input().split())
p = map(int,input().split())

print(p)

list1 = []
list2 = []
list3 = []

for i in p:
    if i<=a:
        list1.append(i)
    elif i<=b:
        list2.append(i)
    else:
        list3.append(i)


if len(list1)>=len(list2):
    if len(list2)>=len(list3):
        print(len(list3))
    else:
        print(len(list2))
else:
    if len(list1)>=len(list3):
        print(len(list3))
    else:
        print(len(list1))

Failing test case input:
7
5 21
1 21 28 2 7 20 12

Expected output:
1


Actual output:
<map object at 0x7f94543f1210>
1


Fixed submission (verdict: Accepted):
n=int(input())
a,b = map(int,input().split())
p = map(int,input().split())



list1 = []
list2 = []
list3 = []

for i in p:
    if i<=a:
        list1.append(i)
    elif i<=b:
        list2.append(i)
    else:
        list3.append(i)


if len(list1)>=len(list2):
    if len(list2)>=len(list3):
        print(len(list3))
    else:
        print(len(list2))
else:
    if len(list1)>=len(list3):
        print(len(list3))
    else:
        print(len(list1))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a, b = map(int, input().split())
p = list(map(int,input().split()))
x = 0
y = 0
z = 0
        
for i in range(n):
  if p[i] <= a:
    x = x + 1
  if a < p[i] <= b:
    y = y + 1
  else:
    z = z+1

print(min(x, y, z))

Failing test case input:
8
3 15
4 5 0 2 13 12 15 19

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
x = 0
y = 0
z = 0
        
for i in range(n):
  if p[i] <= a:
    x = x + 1
  if a < p[i] <= b:
    y = y + 1
  if b < p[i]:
    z = z + 1

print(min(x, y, z))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
A, B = map(int, input().split())
P = list(map(int, input().split()))

q1 = len([p for p in P if p <= A])
q2 = len([p for p in P if A < p and p <= B])
q3 = len([p for p in P if p < B])

print(min(q1, q2, q3))

Failing test case input:
8
2 30
0 5 0 3 -2 24 56 -1

Expected output:
1


Actual output:
3


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

q1 = len([p for p in P if p <= A])
q2 = len([p for p in P if A < p and p <= B])
q3 = len([p for p in P if p > B])

print(min(q1, q2, q3))
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a, b = map(int,input().split())
p = list(map(int,input().split()))
x, y, z = 0, 0, 0
for i in p:
    if i <= a:
        x += 1
    elif i <= b:
        y += 2
    else:
        z += 3
print(min(x,y,z)) 

Failing test case input:
8
2 16
4 5 0 2 0 12 28 19

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
a, b = map(int,input().split())
p = list(map(int,input().split()))
x, y, z = 0, 0, 0
for i in p:
    if i <= a:
        x += 1
    elif i <= b:
        y += 1
    else:
        z += 1
print(min(x,y,z))

Problem: p03156
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
a,b=map(int,input().split())
p=[int(i) for i in input().split()]
cnta=0
cntb=0
cntc=0
for i in p:
  if i<=a:
    cnta+=1
  elif i<=b:
    cntb+=1
  else:
    cntc+=1
print(cnta*cntb*cntc)

Failing test case input:
8
2 16
0 5 0 3 0 24 28 0

Expected output:
2


Actual output:
16


Fixed submission (verdict: Accepted):
n=int(input())
a,b=map(int,input().split())
p=[int(i) for i in input().split()]
cnta=0
cntb=0
cntc=0
for i in p:
  if i<=a:
    cnta+=1
  elif i<=b:
    cntb+=1
  else:
    cntc+=1
print(min(cnta,cntb,cntc))

Problem: p03156
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())
a,b=nii()
p=lnii()

x=0
y=0
z=0

for i in p:
  if i<=a:
    x+=1
  if i>=b+1:
    z+=1
  else:
    y+=1

print(min(x,y,z))

Failing test case input:
7
7 22
-3 0 134 2 2 3 5

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())
a,b=nii()
p=lnii()

x=0
y=0
z=0

for i in p:
  if i<=a:
    x+=1
  elif i>=b+1:
    z+=1
  else:
    y+=1

print(min(x,y,z))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
c = 0
i = 0
d = 0
for i in range(n):
    if d == 0 and (p[i] <= a):
        d = 1
    elif d == 1 and (a+1 <= p[i] <=b):
        d = 2
    elif d == 2 and (b+1 <= p[i]):
        d = 0
        c += 1
print(c)

Failing test case input:
8
3 9
4 5 1 2 13 12 15 19

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
c1,c2, c3 = 0,0,0
for i in range(n):
    if p[i] <= a:
        c1 +=1
    elif (a+1) <= p[i] <= b:
        c2 += 1
    elif (b+1) <= p[i]:
        c3 += 1
print(min(c1,c2,c3))
Problem: p03156
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from sys import stdin
N = int(stdin.readline().rstrip())
A, B = [int(_) for _ in stdin.readline().rstrip().split()]
P = [int(_) for _ in stdin.readline().rstrip().split()]
a, ab, b = 0, 0, 0
for p in P:
    if p <= A:
        a += 1
    elif A+1 <= p <= B:
        ab += 1
    else:
        b += 1
print(min(a, ab, p))

Failing test case input:
7
7 40
-3 8 82 2 2 10 5

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
from sys import stdin
N = int(stdin.readline().rstrip())
A, B = [int(_) for _ in stdin.readline().rstrip().split()]
P = [int(_) for _ in stdin.readline().rstrip().split()]
a, ab, b = 0, 0, 0
for p in P:
    if p <= A:
        a += 1
    elif A < p <= B:
        ab += 1
    elif B < p:
        b += 1
print(min(a, ab, b))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A,B = map(int,input().split())
p = list(map(int,input().split()))
cntA = 0
cntB = 0
cntC = 0

for i in range(N):
    if int(p[i]) <= int(A):
        cntA += 1
    if int(p[i]) >= int(B)+1:
        cntB += 1
    if int(p[i]) >= int(A)+1 or int(p[i]) < int(B):
        cntC += 1

print(min(cntA,cntB,cntC))


Failing test case input:
7
7 22
-3 0 82 2 2 3 5

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
A,B = map(int,input().split())
p = list(map(int,input().split()))
cntA = 0
cntB = 0
cntC = 0

for i in range(N):
    if int(p[i]) <= int(A):
        cntA += 1
    if int(p[i]) >= int(B)+1:
        cntB += 1
    if int(p[i]) >= int(A)+1 and int(p[i]) <= int(B):
        cntC += 1

print(min(cntA,cntB,cntC))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
A,B=map(int, input().split())
P=list(map(int, input().split()))
s=0
w=0
t=0
l=[s,w,t]
for i in range(n):
  if P[i]<=A:
    s=P[i]
  elif P[i]>=A+1 and P[i]<=B:
    w=P[i]
  else:
    t=P[i]
if s!=0:
  if w!=0:
    if t!=0:
      print(3)
    else:
      print(2)
  else:
    print(1)
else:
  print(0)

Failing test case input:
7
7 25
-2 21 28 2 10 20 13

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
A,B=map(int, input().split())
P=list(map(int, input().split()))
s=[]
w=[]
t=[]
l=[s,w,t]
for i in range(n):
  if P[i]<=A:
    s.append(P[i])
  elif P[i]>=A+1 and P[i]<=B:
    w.append(P[i])
  else:
    t.append(P[i])
print(min(len(s),len(w),len(t)))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
x = []
y = []
z = []

P = sorted(P)
for i in P:
    if i <= A:
        x.append(i)
    elif (i >= A + 1) and (i <= B):
        y.append(i)
    else:
        z.append(i)
print(len(min(x, y, z)))


Failing test case input:
7
5 25
0 21 28 2 7 20 13

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
x = 0
y = 0
z = 0

for i in P:
    if i <= A:
        x += 1
    elif i <= B:
        y += 1
    else:
        z += 1
print(min(x, y, z))
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = list(map(int, input().split()))
P = list(map(int, input().split()))

P.sort()

c1, c2, c3 = 0, 0, 0
for p in P:
    if p <= A:
        c1 = p
    if (p > A) and (p <= B):
        c2 = p
    if p > B:
        c3 = p

print(min(c1, (c2 - c1), (c3 - c2)))


Failing test case input:
8
2 30
0 6 0 3 -2 24 56 -1

Expected output:
1


Actual output:
0


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

P.sort()

c1, c2, c3 = 0, 0, 0
for i, p in enumerate(P, 1):
    if p <= A:
        c1 = i
    if (p > A) and (p <= B):
        c2 = i
    if p > B:
        c3 = i


if c1 <= c2 <= c3:
    print(min((c1), (c2 - c1), (c3 - c2)))
else:
    print(0)

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
case = [[], [], []]
for i in p:
    if i <= a:
        case[0].append(i)
    elif i <= b:
        case[1].append(i)
    case[2].append(i)
print(min(map(lambda x: len(x), case)))


Failing test case input:
8
3 30
0 6 0 3 -2 26 56 -1

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
case = [[], [], []]
for i in p:
    if i <= a:
        case[0].append(i)
    elif i <= b:
        case[1].append(i)
    else:
        case[2].append(i)
print(min(map(lambda x: len(x), case)))

Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A, B = [int(v) for v in input().split()]
P = [int(v) for v in input().split()]

num1 = 0
num2 = 0
num3 = 0
for v in P:
    if v <= A:
        num1 += 1
    elif A < v <= B:
        num2 += 2
    else:
        num3 += 3

print(min([num1, num2, num3]))

Failing test case input:
8
2 30
0 5 0 3 -2 24 56 -1

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
A, B = [int(v) for v in input().split()]
P = [int(v) for v in input().split()]

num1 = 0
num2 = 0
num3 = 0
for v in P:
    if v <= A:
        num1 += 1
    elif A < v <= B:
        num2 += 1
    else:
        num3 += 1

print(min([num1, num2, num3]))
Problem: p03156
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys
input = sys.stdin.readline

from bisect import bisect_right


def main():
    n = int(input())
    A, B = list(map(int, input().rstrip().split()))
    P = sorted(map(int, input().rstrip().split()))
    a = bisect_right(P, A)
    b = bisect_right(P, B) - a
    c = n - b
    print(min(a, b, c))


if __name__ == "__main__":
    main()

Failing test case input:
7
5 25
0 21 28 2 7 20 13

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):

def main():
    n = int(input())
    A, B = list(map(int, input().rstrip().split()))
    P = sorted(map(int, input().rstrip().split()))
    a, b, c = 0, 0, 0
    for i in P:
        if i <= A:
            a += 1
        elif A < i <= B:
            b += 1
        else:
            c += 1
    print(min(a, b, c))


if __name__ == "__main__":
    main()

Problem: p03156
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
count1,count2,count3 = 0,0,0
for i in range(N):
  if P[i] <= A:
    count1 += 1
  if P[i] >= B:
    count3 += 1
  if P[i] >= A+1:
    count2 += 1

print(min(count1,count3))

Failing test case input:
3
8 0
5 1 2

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
count1,count2,count3 = 0,0,0
for i in range(N):
  if P[i] <= A:
    count1 += 1
  if P[i] >= B+1:
    count3 += 1
    continue
  if P[i] >= A+1:
    count2 += 1
print(min(count1,count2,count3))

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

N = int(input())
A, B = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

P.sort()


for i in range(N):
    if P[i]>A: break
a = i 
for i in range(a,N):
    if P[i]>B: break
b = i - a 
c = N - i


count = min(a, b, c)
print(count)



Failing test case input:
7
7 40
-2 30 28 2 4 10 13

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):

N = int(input())
A, B = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

P.sort()


for i in range(N):
    if P[i]>A: break
a = i 
for i in range(a,N):
    if P[i]>B: break
else:
    i = N
b = i - a 
c = N - i


count = min(a, b, c)
print(count)

Problem: p03156
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
count1,count2,count3 = 0,0,0
for i in range(N):
  if P[i] <= A:
    count1 += 1
  if P[i] >= B:
    count3 += 1
  if P[i] >= A+1:
    count2 += 1

print(min(count1,count2,count3))

Failing test case input:
7
7 22
-3 0 134 2 2 3 5

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
count1,count2,count3 = 0,0,0
for i in range(N):
  if P[i] <= A:
    count1 += 1
  if P[i] >= B+1:
    count3 += 1
    continue
  if P[i] >= A+1:
    count2 += 1
print(min(count1,count2,count3))