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:
N = int(input())
A,B=map(int, input().split())
hoge1=[]
hoge2=[]
hoge3=[]
hoge = [int(i) for i in input().split()]
for j in range(N):
    p=hoge[j]
    if(p<=A):
        hoge1.append(p)
    elif(B+1<=p):
        hoge3.append(p)
    else:
        hoge2.append(p)
print(min(len(hoge1),len(hoge2),len(hoge3)))

Submission status: Accepted

Solution code:
#!/usr/bin/python

def main():
    n = int(input())
    a, b = [int(x) for x in input().split()]
    p = [int(x) for x in input().split()]
    
    q1count = len([x for x in p if x<=a])
    q2count = len([x for x in p if a+1<=x and x<=b])
    q3count = len([x for x in p if b+1<=x])

    print(min(q1count, q2count, q3count))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# B
# input
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
# calc
o1 = sum(1 for x in p if x<=a)
o3 = sum(1 for x in p if x>b)
o2 = n-o1-o3
# output
print(min(o1,o2,o3))

Submission status: Accepted

Solution code:
import math
def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
n=nCast(input())
ab=nCast(input().split())
p=nCast(input().split())
x,y,z=0,0,0
for number in p:
    if number<=ab[0]:
        x+=1
    elif number>ab[1]:
        z+=1
    else:
        y+=1
print(min(x,y,z))

Submission status: Accepted

Solution code:
import numpy as np

N=int(input())
a,b= map(int,input().split())
P = list(map(int, input().split()))
# P
# P=np.sort(P)

a1=[]
a2=[]
a3=[]

for i in range(0,N):
    # print(i)
    if(P[i]<=a):
        a1.append(P[i])
    elif(P[i]<=b):
        a2.append(P[i])

    else:
        a3.append(P[i])

print(np.min([len(a1),len(a2),len(a3)]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
low, high = map(int, input().split())
points = list(map(int, input().split()))
c = len(list(filter(lambda p: p > high, points)))
b = len(list(filter(lambda p: low < p <= high, points)))
a = len(list(filter(lambda p: p <= low, points)))
print(min(a,b,c))

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
A,B = map(int,input().split())
point = list(map(int,input().split()))
point = np.array(point)

first = np.sum(point <= A)
third = np.sum(point >= B+1)
second = N - first - third
#print(first,second,third)
print(min(first,second,third))

Submission status: Accepted

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

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

q1 = 0
q2 = 0
q3 = 0

for i in range(n):
    if p[i]<=a:
        q1 += 1
    elif p[i] > b:
        q3 += 1
    else:
        q2 += 1

print(int(min(q1, q2, q3)))

Submission status: Accepted

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

first_list = list(filter(lambda x: x <= A, p_list))
second_list = list(filter(lambda x: A + 1 <= x <= B, p_list))
third_list = list(filter(lambda x: x >= B + 1, p_list))

print(min(map(len, [first_list, second_list, third_list])))

Submission status: Accepted

Solution code:

import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    input_raw = read_func().strip().split()
    [A, B] = [long(input_raw[0]), long(input_raw[1])]
    input_raw = read_func().strip().split()
    P = []
    for i in range(N):
        P.append(int(input_raw[i]))

    P.sort()

    A_Count = 0
    B_Count = 0
    C_Count = 0
    for i in range(N):
        if P[i] <= A:
            A_Count += 1
        elif A < P[i] and P[i] <= B:
            B_Count += 1
        elif B < P[i]:
            C_Count += 1
    print min(A_Count, B_Count, C_Count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

n = int(input())

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

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


first = sum( 1 if i<=a else 0 for i in x )
sec = sum( 1 if a<i and i<=b else 0 for i in x)
third = sum(1 if b<i else 0 for i in x)

ans = min([first,sec,third])
print(ans)

Submission status: Accepted

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

P.sort()


p1=0
p2=0
p3=0

for x in P:
	if x<=A:
		p1+=1
	elif A+1<=x<=B:

		p2+=1
	elif B+1<=x:
		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()))

a = 0
b = 0
c = 0
for i in range(len(P)):
    if P[i] <= A:
        a += 1
    elif A < P[i] <= B:
        b += 1
    elif P[i] > B:
        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()))
L1 = [1 for x in P if x <= A]
L2 = [1 for x in P if A < x <= B]
L3 = [1 for x in P if B < x]
print(min(sum(L1), sum(L2), sum(L3)))

Submission status: Accepted

Solution code:
def m():
    N = int(input())
    A, B = map(int, input().split())
    P = list(map(int, input().split()))
    tmp = [0] * 3
    for i in P:
        if i <= A:
            tmp[0] += 1
        elif i > A and i <= B:
            tmp[1] += 1
        elif i > B:
            tmp[2] += 1
    return min(tmp)

print(m())

Submission status: Accepted

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

Submission status: Accepted

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

s1 = []
s2 = []
s3 = []
for x in p:
    if x <= a:
        s1.append(x)
    elif x <= b:
        s2.append(x)
    else:
        s3.append(x)
print(min(len(s1), len(s2) ,len(s3)))

Submission status: Accepted

Solution code:
N = int(input())
A,B = map(int, input().split())
p_list =  list(map(int,input().split()))
p_list.sort()
count_one = 0
count_two = 0
count_three = 0
for i in p_list:
    if i <= A:
        count_one += 1
    elif B < i:
        count_three += 1
    else:
        count_two += 1
print(min(count_one,count_two,count_three))

Submission status: Accepted

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

a = []
b = []
c = []

for i in p:
    if i <= A:
        a.append(i)
    elif (A+1 <= i) and (i <= B):
        b.append(i)
    else:
        c.append(i)

print(min(len(a),len(b),len(c)))

Submission status: Accepted

Solution code:
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
q1 = []
q2 = []
q3 = []
for i in range(len(p)):
    if(p[i]<=a):
        q1.append(p[i])
    elif(p[i]>a and p[i]<=b):
        q2.append(p[i])
    else:
        q3.append(p[i])
print(min(len(q1), len(q2), len(q3)))

Submission status: Accepted

Solution code:
n = int(input())
a,b = list(map(int,input().split()))
p = list(map(int ,input().split()))
q1 = []
q2 = []
q3 = []
for i in p:
  if i <= a:
    q1.append(i)
  elif i <= b:
    q2.append(i)
  else:
    q3.append(i)
print(min(len(q1),len(q2),len(q3)))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 12 20:43:52 2019

@author: Owner
"""

# -*- coding: utf-8 -*-
"""
Created on Sat Jan 12 20:43:41 2019

@author: Owner
"""

# -*- coding: utf-8 -*-
"""
Created on Sat Dec 29 18:42:51 2018

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*M
Y = [0]*M
for m in range(M):
    P[m], Y[m] = map(int, input().split())
    
all(nstr.count(c) for c in '753')
"""# -*- coding: utf-8 -*-
"""
Created on Sat Jan 12 20:43:41 2019

@author: Owner
"""

# -*- coding: utf-8 -*-
"""
Created on Sat Dec 29 18:42:51 2018

@author: Owner
"""

import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*M
Y = [0]*M
for m in range(M):
    P[m], Y[m] = map(int, input().split())
    
all(nstr.count(c) for c in '753')
"""

N = int(input())
A, B = map(int, input().split())
P = [0]*N
P[:] = map(int, input().split())

P.sort()

num1 = len([i for i in P if i <= A])
num3 = len([i for i in P if i >= B+1])
num2 = N-num1-num3

num = min(num1, num2, num3)
print(num)

Submission status: Accepted

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

    r1 = len(list(filter(lambda x: x <= a, scores)))
    r2 = len(list(filter(lambda x: a < x <= b, scores)))
    r3 = len(list(filter(lambda x: b < x, scores)))

    print(min(r1,r2,r3))


    return

main()

Submission status: Accepted

Solution code:
N = int(input())
A,B = map(int,input().split())
plist = [int(_) for _ in input().split()]


a,b,c = 0,0,0
list = []
for p in plist:
    if p <= A:
        a += 1
    elif A+1 <= p <= B:
        b += 1
    elif B+1 <= p:
        c += 1

list.append(a)
list.append(b)
list.append(c)

print(min(list))

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
t1 = sum(1 for x in p if x <= a)
t2 = sum(1 for x in p if a+1 <= x and x <= b)
t3 = sum(1 for x in p if x >= b+1)
print(min(t1, t2, t3))

Submission status: Accepted

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

first_problems = []
second_problems = []
third_problems = []
for problem in problems:
    if problem <= A:
        first_problems.append(problem)
    elif problem <= B:
        second_problems.append(problem)
    else:
        third_problems.append(problem)
        
print(min(len(first_problems), len(second_problems), len(third_problems)))

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
probs = [int(x) for x in input().split()]
probs.sort()

intervals = [0, 0, 0]
point = 0

for x in probs:
    if point == 0:
        if x <= a:
            intervals[0] += 1
        else:
            point += 1
    if point == 1:
        if x <= b:
            intervals[1] += 1
        else:
            point += 1
    if point == 2:
        intervals[2] += 1

print(min(intervals))

Submission status: Accepted

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

t = [0, 0, 0]
for i in range(n):
    if(p[i] <= a):
        t[0] += 1
    elif(p[i] >= a+1 and p[i] <= b):
        t[1] += 1
    else:
        t[2] += 1

print(min(t))

Submission status: Accepted

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

cd1 = 0
cd2 = 0
cd3 = 0

for n in li:
    if n <= A: cd1 += 1
    elif n >= A + 1 and n <= B : cd2 += 1
    elif n >= B+1: cd3 += 1

print(min(cd1, cd2, cd3))

Submission status: Accepted

Solution code:
from sys import stdin, stdout
from math import sin, tan, cos, pi, atan2, sqrt, acos, atan, factorial
from random import randint

n = int(stdin.readline())
a, b = map(int, stdin.readline().split())
cnt = [0, 0, 0]

values = list(map(int, stdin.readline().split()))
for v in values:
    if v <= a:
        cnt[0] += 1
    elif v <= b:
        cnt[1] += 1
    else:
        cnt[2] += 1

stdout.write(str(min(cnt)))

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
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)
fc = len(f)
sc = len(s)
tc = len(t)
print(min(fc, sc, tc))

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
p = []
p = list(map(int, list(str(input()).split())))
print(min(len([i for i in p if i <= a]), len([i for i in p if i > a if i <= b]), len([i for i in p if i > b])))

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
A = [int(i) for i in input().split()]
p1= 0
p2 = 0
p3 = 0

for i in range(n):
    if A[i] <= a:
        p1 += 1
    elif A[i] >= a + 1 and A[i] <= 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 = [int(p) for p in input().split(" ")]
prob1 = [p for p in P if p <=A]
prob2 = [p for p in P if A<p<=B]
prob3 = [p for p in P if B<p]
print(min(len(prob1),len(prob2),len(prob3)))

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


N = ii()
A, B = il()
P = il()
q1 = [p for p in P if p <= A]
q2 = [p for p in P if A + 1 <= p <= B]
q3 = [p for p in P if B + 1 <= p]
print(min(len(q1), len(q2), len(q3)))

Submission status: Accepted

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

q1 = sum(1 for i in P if i <= A)
q2 = sum(1 for j in P if (j > A and j <= B))
q3 = sum(1 for k in P if k > B)

print(min([q1, q2, q3]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A,B  = list(map(int, input().split()))
lis = list(map(int, input().split()))
lis_1=[]
lis_2=[]
lis_3=[]
for i in lis:
    if i <= A:
       lis_1.append(i)
    elif i > A and i <=B:
       lis_2.append(i)
    else:
       lis_3.append(i)

print(min([len(lis_1),len(lis_2),len(lis_3)]))

Submission status: Accepted

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

first = 0 
second = 0 
third = 0  

for p in P:
    if p<=A:
        first += 1     
    elif p<=B:
        second += 1     
    else:
        third += 1
print(min(first,second,third))

Submission status: Accepted

Solution code:
def solve(A, B, arr):
  lowNum = len(list(filter(lambda n: n <= A, arr)))
  highNum = len(list(filter(lambda n: n > B, arr)))
  midNum = len(arr) - lowNum - highNum
  return min([lowNum, midNum, highNum])

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

print(solve(A, B, arr))

Submission status: Accepted

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

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

print(min(len(x),len(y),len(z)))

Submission status: Accepted

Solution code:
n = int(input())
a,b = map(int,input().split())
p = [int(x) for x in input().split()]
low = 0
middle = 0
high = 0
for i in p:
    if(i<=a):
        low+=1
    elif(i<=b):
        middle+=1
    else:
        high+=1

l = [low,middle,high]
print(min(l))

Submission status: Accepted

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

num = [0, 0, 0]

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

print(min(num))

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
input = sys.stdin.readline

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

a = sum(1 for x in lst_P if x<=A)
b = sum(1 for x in lst_P if A<x<=B)
c = sum(1 for x in lst_P if x>B)

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

Submission status: Accepted

Solution code:
n = int(input())
a, b = [int(i) for i in input().split()]
ps = sorted([int(i) for i in input().split()])
p1 = len([True for p in ps if p <= a])
p2 = len([True for p in ps if a < p <= b])
p3 = len([True for p in ps if b < p])
print(min(p1, p2, p3))

Submission status: Accepted

Solution code:
N = int(input())
A,B=[int(_) for _ in input().split()]
aP=[int(_) for _ in input().split()]
dA=[0]*3
for i in range(N):
    p = aP[i]
    if p <= A:
        dA[0] += 1
    elif p <= B:
        dA[1] += 1
    else:
        dA[2] += 1
print (min(dA))

Submission status: Accepted

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

low = []
middle = []
high = []

for i in range(len(P)):
    P[i] = int(P[i])
    if P[i] <= A:
        low.append(P[i])
    elif P[i] <= B:
        middle.append(P[i])
    else:
        high.append(P[i])

atta = [len(low), len(middle), len(high)]

print(min(atta))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

a=[]
b=[]
c=[]

for num in P:
    if num<=A:
        a.append(num)
    elif num>=(A+1) and num<=B:
        b.append(num)
    else:
        c.append(num)
        
print(min(len(a), len(b), len(c)))

Submission status: Accepted

Solution code:
import math as mt
import itertools as it
import functools as ft
import random as rnd

stdin = lambda type_ = "int", sep = " ": list(map(eval(type_), input().split(sep)))
joint = lambda sep = " ", *args: sep.join(str(i) if type(i) != list else sep.join(map(str, i)) for i in args)

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

_1, _2, _3 = 0, 0, 0

for p in P:
    if p <= A:
        _1 += 1
    elif p <= B:
        _2 += 1
    else:
        _3 += 1

print(min(_1, _2, _3))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
P = [int(i) for i in input().split()]
q1 = [i for i in P if i <= A]
q2 = [i for i in P if A < i <= B]
q3 = [i for i in P if B < i]
print(min(len(q1), len(q2), len(q3)))

Submission status: Accepted

Solution code:
#encoding:utf-8

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

P.sort()
a_count = len([i for i in P if i<= A])
b_count = len([i for i in P if A < i <= B])
c_count = len([i for i in P if B < i])

print(min(a_count,b_count,c_count))

Submission status: Accepted

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

first=0
second=0
third=0

for i in range(n):
    if p[i]<=a:
        first+=1
    elif a<p[i]<=b:
        second+=1
    else:
        third+=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

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

S1 = len(list(filter(lambda x : x <=A , P)))
S2 = len(list(filter(lambda x : x > A and x<= B , P)))
S3 = len(list(filter(lambda x : x > B , P)))

print("%d" % (min(S1, min(S2, S3))))

Submission status: Accepted

Solution code:
#!/Users/takahiro.kida/git/atcorder/venv/bin/python

import numpy
import scipy

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

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

print(min(cnt))

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
A, B = map(int, input().split())
nums = list(map(int, input().split()))
lis = [0, 0, 0]

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
A, B = list(map(int, input().split(" ")))
p_array = np.asarray(sorted(list(map(int, input().split(" ")))))

type_1 = (p_array <= A)
type_3 = (p_array >= B+1)
type_2 = (~type_1) * (~type_3)

out = min([sum(type_1), sum(type_2), sum(type_3)])

print(out)

Submission status: Accepted

Solution code:
#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit
    
N, = getIntList()
#print(N)

A,B  = getIntList()
zp  = getIntList()

zp.sort()
r0 = 0
r1 = 0
r2 = 0
for x in zp:
    if x<= A:
        r0 +=1
    elif x>B:
        r2+=1
    else:
        r1 +=1
print( min(r0,r1,r2))

Submission status: Accepted

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

P.sort()
a,b,c=0,0,0
for i in range(len(P)):
    if P[i]<=A:
        a +=1
#        b+=1
#        c+=1
    elif P[i]<=B:
        b+=1
#        c+=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()))
q1 = q2 = q3 = 0
for i in P:
	if i <= A:
		q1 += 1
	elif i <= B:
		q2 += 1
	else:
		q3 += 1
print(min(q1, q2, q3))

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
# print(a, b, p, sep='\n')

first = []
second = []
final = []

for ele in p:
    if ele <= a:
        first.append(ele)
    elif ele <= b:
        second.append(ele)
    else:
        final.append(ele)

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

Submission status: Accepted

Solution code:
n = int(input())
a, b = map(int, input().split())
p_list = list(map(int, input().split()))
p1 = [p for p in p_list if p <= a]
p2 = [p for p in p_list if p <= b and p > a]
p3 = [p for p in p_list if p > b]
print(min(len(p1), len(p2), len(p3)))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
Pn = list(map(int, input().split()))
a = 0
b = 0
c = 0
for p in Pn:
    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 = [int(x) for x in input().split()]
score = [0, 0, 0]
lst = [int(x) for x in input().split()]
for i in lst:
    if i <= A:
        score[0] += 1
    elif i <= B:
        score[1] += 1
    else:
        score[2] += 1
    
print(min(score))

Submission status: Accepted

Solution code:
N = int(input())
A,B = map(int, input().split())
P = list(map(int, input().split()))
print(min(sum(p<=A for p in P),sum(A<p and p<=B for p in P),sum(B<p for p in P)))

Submission status: Accepted

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

import numpy as np
P=np.array(P)

print min(len(np.where(P<=A)[0]),len(np.where((P>A) & (P<=B))[0]),len(np.where(P>B)[0]))

Submission status: Accepted

Solution code:
n = int(input())
a,b = map(int, input().split())
p = [int(i) for i in input().split()] 
count1 = 0
count2 = 0
count3 = 0
for i in p:
    if i <= a:
        count1 += 1
    if a+1 <= i <= b:
        count2 += 1
    if b+1 <= i:
        count3 += 1
print(min(count1,count2,count3))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
a,b=map(int,input().split())
l=list(map(int,input().split()))
x,y,z=0,0,0
for i in l:
  if(i<=a):
    x+=1
  elif(i>a and i<=b):
    y+=1
  elif(i>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()))

cnta=0
cntm=0
cntb=0

for i in range(n):
  if p[i]<=a:
    cnta+=1
  elif (p[i]>=a+1) and (p[i]<=b):
    cntm+=1
  else:
    cntb+=1

print(min(cnta,cntm,cntb))

Submission status: Accepted

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

x = [a for a in P if a <= A]
y = [a for a in P if (a > A)and(a <= B)]
z = [a for a in P if (a > B)]

r = min(len(x), len(y), len(z))

print(r)

Submission status: Accepted

Solution code:
N = input()
A,B = list(map(int,input().split()))
P = list(map(int,input().split()))
c1 = [1 if x<=A else 0 for x in P]
c2 = [1 if (x>A and x<=B) else 0 for x in P]
c3 =[1 if x>B else 0 for x in P]
c1 = sum(c1)
c2 = sum(c2)
c3 = sum(c3)
print(min([c1,c2,c3]))

Submission status: Accepted

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

t = [[] for _ in range(3)]

for i in p:
    if i <= a:
        t[0].append(i)
    elif i <= b:
        t[1].append(i)
    else:
        t[2].append(i)

print(min(len(t[0]), len(t[1]), len(t[2])))

Submission status: Accepted

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

for i in range(n):
  if p[i]<=a:
    a_cnt+=1
  elif p[i]>=a+1 and b>=p[i]:
    b_cnt+=1
  elif p[i]>=b+1:
    c_cnt+=1

print(min(a_cnt, b_cnt, c_cnt))

Submission status: Accepted

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

Submission status: Accepted

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

one = []
two = []
three = []

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

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

Submission status: Accepted

Solution code:
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
x1,x2,x3 = 0,0,0
for i in range(N):
    if P[i]<=A:
        x1 += 1
    if P[i]>=A+1 and P[i]<=B:
        x2 += 1
    if P[i]>= B+1:
        x3 += 1
print(min(x1,x2,x3))

Submission status: Accepted

Solution code:
N = int(input())
A, B = map(int, input().split())
P = [int(s) for s 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))