Problem:


Score : 200 points

Problem Statement

You have written N problems to hold programming contests.
The i-th problem will have a score of P_i points if used in a contest.

With these problems, you would like to hold as many contests as possible under the following condition:

A contest has three problems. The first problem has a score not greater than A points, the second has a score between A + 1 and B points (inclusive), and the third has a score not less than B + 1 points.

The same problem should not be used in multiple contests.
At most how many contests can be held?

Constraints

3 \leq N \leq 100

1 \leq P_i \leq 20 (1 \leq i \leq N)

1 \leq A < B < 20

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
A B
P_1 P_2 ... P_N

Output

Print the answer.

Sample Input 1

7
5 15
1 10 16 2 7 20 12

Sample Output 1

2

Two contests can be held by putting the first, second, third problems and the fourth, fifth, sixth problems together.

Sample Input 2

8
3 8
5 5 5 10 10 10 15 20

Sample Output 2

0

No contest can be held, because there is no problem with a score of A = 3 or less.

Sample Input 3

3
5 6
5 6 10

Sample Output 3

1



Sample input:
7
5 15
1 10 16 2 7 20 12


Sample output:
2

Submission status: Accepted

Solution code:
while(True):
    try:
        n = int(input())
        a, b = map(int, input().split())
        list = map(int, input().split())
        a_count, b_count, c_count = [0 for _ in range(3)]
        for num in list:
            if num <= a:
                a_count += 1
            elif num > b:
                c_count += 1
            else:
                b_count += 1
        print(min(a_count, b_count, c_count))
    except EOFError:
        exit()

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
scores = list(map(int, input().split()))

na, nb, nc = 0, 0, 0
for i in scores:
  if i <= A:
    na += 1
  elif i <= B:
    nb += 1
  else:
    nc += 1
    
print(min(na,nb,nc))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A, B = map(int, input().split())
    P = list(map(int, input().split()))
    p1 = 0
    p2 = 0
    p3 = 0
    for p in P:
        if p <= A:
            p1 += 1
        elif p <= B:
            p2 += 1
        else:
            p3 += 1
    print(min(p1, p2, p3))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
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+=1
  elif a+1<=p[i]<=b:
    y+=1
  else:
    z+=1
print(min(x,y,z))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
p = list(map(int, input().split()))
p = sorted(p)

aa = 0
bb = 0
cc = 0
for i in range(N):
    if p[i] <= A:
        aa += 1
    elif p[i] <= B:
        bb += 1
    else:
        cc += 1

print(min(aa, bb, cc))

Submission status: Accepted

Solution code:
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
    elif P[i] <= B:
        Y += 1
    else:
        Z += 1
print( min( [X,Y,Z]))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
p_list = list(map(int, input().split()))

first, second, third = [], [], []
for idx, p in enumerate(p_list):
    if p < A+1:
        first.append(idx)
    elif p < B+1:
        second.append(idx)
    elif p > B:
        third.append(idx)
print(min([len(first), len(second), len(third)]))

Submission status: Accepted

Solution code:
n=int(input())
a,b=map(int,input().split())
p=list(map(int,input().split()))
c1=0;c2=0;c3=0
for i in range(n):
  if p[i]<=a:c1+=1
  elif p[i]>=b+1:c3+=1
  else:c2+=1
print(min(c1,c2,c3))

Submission status: Accepted

Solution code:
N = int(input())
A,B = map(int,input().split(" "))
P = list(map(int,input().split(" ")))

one,two,three = 0,0,0
for i in range(N):
    if P[i] <= A:
        one += 1
    elif P[i] > A and P[i] <= B:
        two += 1
    else:
        three += 1


print(min([one,two,three]))

Submission status: Accepted

Solution code:
N = input()
A,B = map(int, raw_input().split())
P = map(int, raw_input().split())
a,b,c = 0,0,0
for p in P:
  if p<=A:
    a += 1
  elif p<=B:
    b += 1
  else:
    c += 1
print min(a, b, c)

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
one = 0
two = 0
three = 0
for i in range(N):
    if P[i] <= A:
        one += 1
    elif P[i] <= B:
        two += 1
    else:
        three += 1
print(min(one, two, three))

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))

c = [0] * 3

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

print(min(c))

Submission status: Accepted

Solution code:

def main():
    buf = input()
    N = int(buf)
    buf = input()
    buflist = buf.split()
    A = int(buflist[0])
    B = int(buflist[1])
    buf = input()
    buflist = buf.split()
    P = list(map(int, buflist))
    group_count = [0, 0, 0]
    for i, score in enumerate(P):
        if score <= A:
            group_count[0] += 1
        elif score <= B:
            group_count[1] += 1
        else:
            group_count[2] += 1
    print(min(group_count))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
point = list(map(int, input().split()))

q = [0, 0, 0]
for p in point:
  if p <= a:
    q[0] += 1
  elif p <= b:
    q[1] += 1
  else:
    q[2] += 1

print(min(q))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
"""
This file is part of https://github.com/Cheran-Senthil/PyRival.

Copyright 2018 Cheran Senthilkumar all rights reserved,
Cheran Senthilkumar <hello@cheran.io>
Permission to use, modify, and distribute this software is given under the
terms of the MIT License.

"""
from __future__ import division, print_function

import cmath
import itertools
import math
import operator as op
# import random
import sys
from atexit import register
from bisect import bisect_left, bisect_right
# from collections import Counter, MutableSequence, defaultdict, deque
# from copy import deepcopy
# from decimal import Decimal
# from difflib import SequenceMatcher
# from fractions import Fraction
# from heapq import heappop, heappush

if sys.version_info[0] < 3:
    # from cPickle import dumps
    from io import BytesIO as stream
    # from Queue import PriorityQueue, Queue
else:
    # from functools import reduce
    from io import StringIO as stream
    # from pickle import dumps
    # from queue import PriorityQueue, Queue


if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)

        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)

        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip


def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.

    Args:
        sync (bool, optional): The new synchronization setting.

    """
    global input, flush

    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')

        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))


def gcd(x, y):
    """greatest common divisor of x and y"""
    while y:
        x, y = y, x % y
    return x


def main():
    n = int(input())
    a, b = map(int, input().split(' '))
    p = list(map(int, input().split(' ')))

    part1 = len(list(filter(lambda x: x <= a, p)))
    part2 = len(list(filter(lambda x: a + 1 <= x <= b, p)))
    part3 = len(list(filter(lambda x: b + 1 <= x, p)))

    print(min(part1, part2, part3))


if __name__ == '__main__':
    sync_with_stdio(False)
    main()

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))


cnt = [0, 0, 0]

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

print(min(cnt))

Submission status: Accepted

Solution code:
n = int(input())
a, b = list(map(int, input().split()))
plist = list(map(int, input().split()))
f = 0
m = 0
l = 0
for p in plist:
    if p <= a:
        f += 1
    elif a < p <= b:
        m += 1
    else:
        l += 1
print(min(f, min(m, l)))

Submission status: Accepted

Solution code:
a = int(input())
n,k= map(int,input().split())
x = list(map(int,input().split()))
aa = bb = cc = 0
for i in range(a):
    if x[i] <= n:
        aa+=1
    elif n+1 <= x[i] <= k:
        bb+=1
    else:cc+=1
print(min(aa,bb,cc))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
P = [int(x) for x in input().split()]
C = [0, 0, 0]
for p in P:
  if p <= A:
    C[0] += 1
  elif p <= B:
    C[1] += 1
  else:
    C[2] += 1
print(min(C))

Submission status: Accepted

Solution code:
N = int(input())

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

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

k1 = 0
k2 = 0
k3 = 0

for i in range(N):
    if P[i]<=A:
        k1 = k1+1
    elif P[i]<=B:
        k2 = k2+1
    else:
        k3 = k3+1
      
ans = [k1, k2, k3]    
    
print(min(ans))

Submission status: Accepted

Solution code:
N=int(input())

A,B=map(int,input().split())
P=list(map(int,input().split()))
one=0
two=0
three=0

for i in range(N):
  if P[i]<=A:
    one+=1
  elif P[i]>B:
    three+=1
  else:
    two+=1

print(min(one,two,three))

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
a,b = list(map(int, input().split()))
p = list(map(int, input().split()))
p = np.array(p)
try:
    print(np.min([np.sum(p <= a), np.sum((a < p) * (p <= b)), np.sum((b < p))]))
except:
    print(0)

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split(' '))
x, y, z = 0, 0, 0
p = list(map(int, input().split(' ')))
for i in range(n):
    if p[i] <= a:
        x += 1
    elif p[i] <= b:
        y += 1
    else:
        z += 1
ans = min(x, y, z)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
A, B = map(int, input().split())
p = list(map(int, input().split()))

a = 0
b = 0
c = 0

for x in p:
    if x <= A:
        a += 1
    elif x <= B:
        b += 1
    else:
        c += 1

print(min(a, b, c))

Submission status: Accepted

Solution code:
n = int(input())
a,b = map(int,input().split())
x = 0
y = 0
z = 0
P = list(map(int,input().split()))

for i in range(n):
    if P[i]<= a:
        x += 1
    elif P[i] <= b:
        y += 1
    else:
        z += 1

print(min(x,y,z))

Submission status: Accepted

Solution code:
N = int(input())
A, B = [int(a) for a in input().split()]
p_list = [int(a) for a in input().split()]

p_list1 = [a for a in p_list if a <= A]
p_list2 = [a for a in p_list if A < a <= B]
print(str(min([len(p_list1), len(p_list2),N - len(p_list1) - len(p_list2)])))

Submission status: Accepted

Solution code:
N = int(input())
A, B = list(map(int, input().split()))
P = list(map(int, input().split()))

x, y, z = 0, 0, 0
for i in range(N):
	if P[i] <= A:
		x += 1
	elif P[i] <= B:
		y += 1
	else:
		z += 1

print(min(x, y, z))

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))

n1, n2, n3 = 0, 0, 0
for pp in p:
    if pp <= a:
        n1 += 1
    elif pp <= b:
        n2 += 1
    else:
        n3 += 1
print(min(n1, n2, n3))

Submission status: Accepted

Solution code:
n = input()
ab = [int(i) for i in input().split()]
a = ab[0]
b = ab[1]
p = [int(i) for i in input().split()]

num1,num2,num3 = 0,0,0
for num in p:
    if num <= a:
        num1 += 1
    elif num <= b:
        num2 += 1
    else:
        num3 += 1
print(min(num1,num2,num3))

Submission status: Accepted

Solution code:
N=int(input())
A,B=map(int,input().split())
P=list(map(int,input().split()))
a=0
b=0
c=0
for p in P:
    if p<=A: a+=1
    elif p<=B: b+=1
    else: c+=1
print(min([a,b,c]))

Submission status: Accepted

Solution code:
n = input()
a,b = map(int, raw_input().split())
l = map(int, raw_input().split())
cnt1 = 0
cnt2 = 0
cnt3 = 0
for x in l:
	if x <= a:
		cnt1 += 1
	elif x >= b+1:
		cnt3 += 1
	else:
		cnt2 += 1
print min(cnt1, cnt2, cnt3)

Submission status: Accepted

Solution code:
n = int(input())
a, b = [int(_) for _ in input().split()]
p = [int(_) for _ in input().split()]

first = 0
second = 0
third = 0
for pi in p:
    if pi <= a:
        first += 1
    elif pi <= b:
        second += 1
    else:
        third += 1

print(min(first, second, third))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3


def solve(a, b, ps):
    easy = mid = hard = 0
    for p in ps:
        if p <= a:
            easy += 1
        elif a + 1 <= p <= b:
            mid += 1
        else:
            hard += 1
    return min(easy, mid, hard)


def main():
    _ = int(input())
    a, b = (int(z) for z in input().split())
    ps = [int(z) for z in input().split()]
    res = solve(a, b, ps)
    print(res)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def inpl(): return [int(i) for i in input().split()]

N = int(input())
A, B = inpl()
P = inpl()

ctr1, ctr2, ctr3 = 0, 0, 0

for i in P:
    if i <= A:
        ctr1 += 1
    elif i <= B:
        ctr2 += 1
    else:
        ctr3 += 1
print(min(ctr1, ctr2, ctr3))

Submission status: Accepted

Solution code:
def aising2019_b():
    n = int(input())
    a, b = map(int, input().split())
    p = list(map(int, input().split()))
    first = second = third = 0
    for v in p:
        if v <= a:
            first += 1
        elif v <= b:
            second += 1
        else:
            third += 1
    print(min([first, second, third]))


aising2019_b()

Submission status: Accepted

Solution code:
def getN():
    return int(input())

def getMN():
    a = input().split()
    b = [int(i) for i in a]
    return b[0],b[1]

def getlist():
    a = input().split()
    b = [int(i) for i in a]
    return b

n = getN()
a, b = getMN()
points = getlist()

x ,y, z = 0,0,0
for p in points:
    if p <= a:
        x += 1
    if a < p <= b:
        y += 1
    if p > b:
        z += 1

print(min([x,y,z]))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
L = [0] * 3
for p in P:
    if p<=A:
        L[0] += 1
    elif p<=B:
        L[1] += 1
    else:
        L[2] += 1
print(min(L))

Submission status: Accepted

Solution code:
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 += 1
    elif (a+1 <= p[i]<= b):
        y += 1
    else:
        z += 1

print(min(x,y,z))

Submission status: Accepted

Solution code:
# S = input()
N = int(input())
#W = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
#P = [int(input()) for _ in range(N)]

ans = 0

count1 = 0
count2 = 0
count3 = 0

for p in P:
    if p<= A:
        count1 += 1
    elif p<=B:
        count2 += 1
    else:
        count3 += 1



print(min(count1,count3,count2))

Submission status: Accepted

Solution code:
n=int(input())
a,b=map(int,input().split())
p=list(map(int,input().split()))
q=[0,0,0]
for i in p:
  if(i<=a):q[0]+=1
  elif(i<=b):q[1]+=1
  else:q[2]+=1
print(min(q))

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
p = map(int, input().split())
c = [0] * 3
for i in p:
    if i <= a:
        c[0] += 1
    elif i <= b:
        c[1] += 1
    else:
        c[2] += 1
print(min(c))

Submission status: Accepted

Solution code:
# N = int(input())
# A = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]


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

a = b = c = 0
for p in P:
    if p <= A:
        a += 1
    elif p <= B:
        b += 1
    else:
        c += 1

print(min(a, b, c))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
a,b = map(int, input().split())
pl = list(map(int, input().split()))

na = 0
nb = 0
nc = 0
for p in pl:
    if p<=a:
        na += 1
    elif a+1<=p<=b:
        nb += 1
    else:
        nc += 1

print(min(na,nb,nc))

Submission status: Accepted

Solution code:
n = int(input())
a, b = list(map(int, input().split()))
p = list(map(int, input().split()))

c1 = 0
c2 = 0
c3 = 0

for num in p:
    if num <= a:
        c1 += 1
    elif num <= b:
        c2 += 1
    else:
        c3 += 1

print(min(c1, c2, c3))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
p_list = tuple(map(int, input().split()))

first = []
second = []
third = []
for p in p_list:
    if p <= A:
        first.append(p)
    elif p <= B:
        second.append(p)
    else:
        third.append(p)

print(min(len(first), len(second), len(third)))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
Ps = list(map(int, input().split()))

nums = [0] * 3
for P in Ps:
    if P <= A:
        i = 0
    elif P <= B:
        i = 1
    else:
        i = 2
    nums[i] += 1

print(min(nums))

Submission status: Accepted

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

a = list(map(int, input().split()))
first = 0
second = 0
third = 0

for x in a:
  if x <= A:
    first += 1
  elif x > B:
    third += 1
  else:
    second += 1

print(min(first, second, third))

Submission status: Accepted

Solution code:
# B
N = int(input())
A, B = map(int, input().split())
P_list = list(map(int, input().split()))
c1 = 0
c2 = 0
c3 = 0

for p in P_list:
    if p <= A:
        c1 +=1
    elif p <= B:
        c2 += 1
    else:
        c3 += 1
        
print(min(c1, c2, c3))

Submission status: Accepted

Solution code:
N=int(input())
a,b=map(int,input().split())
P=[int(i) for i in input().split()]
x=0
y=0
z=0
for p in P:
    if p<=a:
        x+=1
    elif a+1<=p<=b:
        y+=1
    elif b+1<=p:
        z+=1
print(min(x,y,z))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def inpl(): return list(map(int, input().split()))
N = int(input())
A, B = inpl()
P = inpl()

a, b, c = 0, 0, 0
for p in P:
    if p <= A:
        a += 1
    elif A < p <= B:
        b += 1
    else:
        c += 1
print(min(a, b, c))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
*P, = map(int, input().split())
C = [0]*3
for p in P:
    if p <= A:
        C[0] += 1
    elif p <= B:
        C[1] += 1
    else:
        C[2] += 1
print(min(C))

Submission status: Accepted

Solution code:
# coding: utf-8


II = lambda: int(input())
MI = lambda: map(int, input().split())


def main():
    N = II()
    A, B = MI()
    c = [0, 0, 0]
    for p in MI():
        if p <= A: c[0] += 1
        elif p <= B: c[1] += 1
        else: c[2] += 1
    return min(c)


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

Submission status: Accepted

Solution code:
N=int(input())
A,B=map(int,input().split())
P=list(map(int,input().split()))

PA=len([P[i] for i in range(N) if P[i]<=A])
PB=len([P[i] for i in range(N) if P[i]>B])
PC=N-PA-PB

print(min(PA,PB,PC))

Submission status: Accepted

Solution code:
def rank(n):
    if n <= A:
        return 0
    elif n <= B:
        return 1
    else:
        return 2


n = int(input())
A, B = map(int, input().split())
ans = [0, 0, 0]
for i in map(int, input().split()):
    ans[rank(i)] += 1
print(min(ans))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = int(input())
a,b = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]

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

print(min(k))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))

p1 = p2 = p3 = 0
for p in P:
  if p <= A:
    p1 += 1
  elif p <= B:
    p2 += 1
  else:
    p3 += 1
print(min(p1, p2, p3))

Submission status: Accepted

Solution code:
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
a = 0
b = 0
c = 0
for i in range(N):
    if P[i] <= A:
        a+=1
    elif P[i] <= B:
        b+=1
    else:
        c+=1
print(min(a,b,c))

Submission status: Accepted

Solution code:
def A():
    N = int(input())
    H = int(input())
    W = int(input())
    print((N - H + 1) *(1 + N - W))
#A()

def B():
    N = int(input())
    A, B = map(int, input().split())
    P = list(map(int, input().split()))
    f = []
    s = []
    t = []
    for i in P:
        if i <= A:
            f.append(i)
        elif i <= B:
            s.append(i)
        else:
            t.append(i)
    print(min(len(f), len(s), len(t)))
B()

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
P = [int(p) for p in input().split()]
Problem = [0, 0, 0]
for p in P:
    if p <= A: Problem[0] += 1
    elif A < p <= B: Problem[1] += 1
    else: Problem[2] += 1
print(min(Problem))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))

c1 = 0
c2 = 0
c3 = 0

for i in range(n):
    if p[i] <= a:
        c1 += 1
    elif (a+1 <= p[i]) and (p[i] <= b):
        c2 += 1
    else:
        c3 += 1

print(min(c1, c2, c3))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))

c1, c2, c3 = 0,0,0
for p in P:
  if p <= A:
    c1 += 1
  elif p <= B:
    c2 += 1
  else:
    c3 += 1

print(min(c1,c2,c3))

Submission status: Accepted

Solution code:
n =int(input())
a,b = map(int,input().split())
p= list(map(int,input().split()))

ans = [0,0,0]
for i in range(n):
    if p[i] <= a:
        ans[0]+= 1
    elif p[i]<=b:
        ans[1]+=1
    else:
        ans[2] += 1
print(min(ans))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
dic = [0] * 3
for i in range(N):
    if P[i] <= A:
        dic[0] += 1
    elif P[i] <= B:
        dic[1] += 1
    else:
        dic[2] += 1

print(min(dic))

Submission status: Accepted

Solution code:
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
ans = [0,0,0]
for i in p:
    if i<=a:
        ans[0] +=1
    elif i<= b:
        ans[1] += 1
    else:
        ans[2] += 1
print(min(ans))

Submission status: Accepted

Solution code:
N = int(input())
A,B = [int(i) for i in input().split()]
P = [int(i) for i in input().split()]

res = [0 for i in range(3)]
for p in P:
    if p<=A:
        res[0]+=1
    elif p<=B:
        res[1]+=1
    else:
        res[2]+=1
print(min(res))

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
f = [0, 0, 0]
for x in map(int, input().split()):
    if x <= a:
        f[0] += 1
    elif x <= b:
        f[1] += 1
    else:
        f[2] += 1
print(min(f))

Submission status: Accepted

Solution code:
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))

ans1,ans2,ans3 = 0,0,0
for i in range(N):
    if P[i]<=A:
        ans1 += 1
    elif P[i]<=B:
        ans2 += 1
    else:
        ans3 += 1

print(min(ans1,ans2,ans3))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

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

c1 = 0
c2 = 0
c3 = 0
for p in Ps:
    if p <= A: c1 += 1
    elif p <= B: c2 += 1
    else: c3 += 1
print(min(c1, c2, c3))

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
a,b = li()
p = list(li())

one = 0
two = 0
thr = 0
for pi in p:
    if pi <= a:
        one += 1
        
    elif pi <= b:
        two += 1
        
    else:
        thr += 1
        
print(min(one,two,thr))

Submission status: Accepted

Solution code:
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))

r = [0]*3
for i in p:
    if i <= a:
        r[0] += 1
    elif i <= b:
        r[1] += 1
    else:
        r[2] += 1
print(min(r))

Submission status: Accepted

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

P = [int(a) for a in input().split()]

X = [0] * 3
for p in P:
    if p <= A:
        X[0] += 1
    elif p <= B:
        X[1] += 1
    else:
        X[2] += 1
print(min(X))

Submission status: Accepted

Solution code:
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))

a = b = c = 0
for p in P:
    if p <= A:
        a += 1
    elif p <= B:
        b += 1
    else:
        c += 1
print(min(a,b,c))

Submission status: Accepted

Solution code:
N = input()
A, B = map(int, raw_input().split())
P = map(int, raw_input().split())
cnt = [0, 0, 0]

for p in P:
    if p <= A:
        cnt[0] += 1
    elif p >= B + 1:
        cnt[2] += 1
    else:
        cnt[1] += 1

print min(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a,b = map(int, input().split())
c = list(map(int, input().split()))
d = 0
e = 0
f = 0
for i in c:
  if i <= a:
    d += 1
  elif i > b:
    f += 1
  else:
    e += 1
print(min(min(d,e),f))

Submission status: Accepted

Solution code:
n = int(input())
a, b = list(map(int, input().split()))
ppp = list(map(int, input().split()))
ans = [0, 0, 0]
for p in ppp:
    if p <= a:
        ans[0] += 1
    elif p <= b:
        ans[1] += 1
    else:
        ans[2] += 1
print(min(ans))

Submission status: Runtime Error

Solution code:
n,a,b=map(int, input().split())
*p,=map(int, input().split())
mn,md,mx=0,0,0
for pi in p:
    if pi<=a:
        mn+=1
    elif pi<=b:
        md+=1
    else:
        mx+=1
print(min(mn,md,mx))

Submission status: Runtime Error

Solution code:
int pxcount,pycount,pzcount=0

n=int(input())
a,b=map(int, input().split())
p=list(map(int, input().split()))

for i in p:
  if i<=a:
    pxcount=pxcount+1
for i in p:
  if a+1<=i and i<=b:
    pycount=pycount+1
for i in p:
  if b+1<=i:
    pzcount=pzcount+1
  
print(min(pxcount,pycount,pzcount))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
n=int(input())
a,b=map(int,input().split())
p_list = list(map(int,input().split()))
ans=0
for i in range(n):
    if p_list[i]>a:continue
    if p_list[i+1]>b:continue
    if p_list[i+2]<=b:continue
    ans+=1
    i+=3
print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
A,B=map(int,input().split())
p = list(map(int,input().split()))
c=[]
d=[]
e=[]
for i in range(N):
    if p[i]<=A:
        c.append(p[i])
    if A+1 <= p[i] <= B:
        d.append(p[i])
    if B+1 <= p[i]:
        e.append(p[i])

        
print(min(len(c),len(d),len(e))))

Submission status: Runtime Error

Solution code:
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
a = len(filter(lambda x: x<=A,P))
b = len(filter(lambda x: A<x<=B,P))
c = len(filter(lambda x: B<x,P))
print(min(a,b,c))

Submission status: Runtime Error

Solution code:
7
5 15
1 10 16 2 7 20 12

Submission status: Runtime Error

Solution code:
n=int(input())
a,b=map(int, input().split())
p=list(map(int, input().split())
c=[0]*3
for i in p:
       if i <=a:
        c[0] +=1
       elif i>b:
        c[2] +=1
       else:
        c[1]+=1
print(min(c))

Submission status: Runtime Error

Solution code:
n=int(input())
a,b=map(int, input().split())
p=list(map(int, input().split())
c=[0,0,0]
for i in p:
       if i <=a:
        c[0] +=1
       elif i>b:
        c[2] +=1
       else:
        c[1]+=1
print(min(c))

Submission status: Runtime Error

Solution code:
N=int(input())
A,B=map(int, input().split())
P=list(map(int, input().split())
ans=[0,0,0]
for i in P
       if i <=a:
        ans[0] +=1
       else i>b:
        ans[2] +=1
       else:
        ans[1]+=1
print(min(ans))

Submission status: Runtime Error

Solution code:
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 < p <= b:
        c[1] += 1
    else:
        c[2] += 1

print(c)

Submission status: Runtime Error

Solution code:
n=int(input())
a,b=map(int,input().split())
d=[]
e=[]
f=[]
for i in range(n):
    k=int(input())
    if k<=a:
        d.append(k)
    elif a<k<=b:
        e.append(k)
    else:
        f.append(k)
print(min(len(d),len(e),len(f)))

Submission status: Runtime Error

Solution code:
N = int(input())
A, B = map(int, input().split())
P = listans1 = 0
ans2 = 0
ans3 = 0  
for i in P:
    if A>=i:
        ans1 = ans1 + 1
    if A+1 <= i <= B+1:
        ans2 = ans2 + 1
    if B+1 <= i:
        ans3 = ans3 + 1 


print(min(ans1,ans2,ans3))

Submission status: Runtime Error

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

lis = []

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

for i in P:
  if i <= A:
    lis[0] += 1
  elif i <= B:
    lis[1] += 1
  else:
    lis[2] += 1
    
print (min(lis))

Submission status: Runtime Error

Solution code:
#coding:utf-8
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))

p1 = 0
p2 = 0
p3 = 0

for i in p:
  if i <= a:
    p1 += 1
  elif i >= (a+1) and i <= b:
    p2 += 1
  elif i >= (b+1)
    p3 += 1

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

Submission status: Runtime Error

Solution code:
N,A,B,*P=map(int,open(0).read().split());b=len(p for p in P if p>A);c=len(p for p in P if p>B);print(min(N-b,b-c,c))

Submission status: Runtime Error

Solution code:
N = int(input())
A,B = map(int,input().split())
*P, = map(int,input().split())

a = len([p for p in P if p<=A])
a = min(a,
        len([p for p in P if A<p<=B])
a = min(a,
        len([p for p in P if B<p])
print(a)

Submission status: Runtime Error

Solution code:
n = int(input())
a, b = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
for i in range(n):
    if p[i] > a:
        key1 = i-1
        break
for i in range(key1+1,n):
    if p[i] > b:
        key2 = i-1
        break
print(min(key1+1,key2-key1,len(p)-1-key2))

Submission status: Runtime Error

Solution code:
A=input()
A,B=input().split()
P=input().split()
c=[0]*3
for i in P:
        if P <= A:c[0]+=1
        elif P <= B:c[1]+=1
        else :c[2]+=1
c.sort()
print(c[0])