Problem:


Score : 300 points

Problem Statement

In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:  

Rating 1-399 : gray

Rating 400-799 : brown

Rating 800-1199 : green

Rating 1200-1599 : cyan

Rating 1600-1999 : blue

Rating 2000-2399 : yellow

Rating 2400-2799 : orange

Rating 2800-3199 : red

Other than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.

Currently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.

Find the minimum and maximum possible numbers of different colors of the users.  

Constraints

1 ≤ N ≤ 100

1 ≤ a_i ≤ 4800

a_i is an integer.

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 ... a_N

Output

Print the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.  

Sample Input 1

4
2100 2500 2700 2700

Sample Output 1

2 2

The user with rating 2100 is "yellow", and the others are "orange". There are two different colors.  

Sample Input 2

5
1100 1900 2800 3200 3200

Sample Output 2

3 5

The user with rating 1100 is "green", the user with rating 1900 is blue and the user with rating 2800 is "red".

If the fourth user picks "red", and the fifth user picks "blue", there are three different colors. This is one possible scenario for the minimum number of colors.

If the fourth user picks "purple", and the fifth user picks "black", there are five different colors. This is one possible scenario for the maximum number of colors.  

Sample Input 3

20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990

Sample Output 3

1 1

All the users are "green", and thus there is one color.



Sample input:
4
2100 2500 2700 2700


Sample output:
2 2

Submission status: Wrong Answer

Solution code:
N = int(input())
lst = [0] * 9

for x in [int(x) for x in input().split()]:
    if x <= 399:
        lst[0] = 1
    elif x <= 799:
        lst[1] = 1
    elif x <= 1199:
        lst[2] = 1
    elif x <= 1599:
        lst[3] = 1
    elif x <= 1999:
        lst[4] = 1
    elif x <= 2399:
        lst[5] = 1
    elif x <= 2799:
        lst[6] = 1
    elif x <= 3199:
        lst[7] = 1
    else:
        lst[8] += 1

a = sum(lst[:-1])
b = lst[8]
if a == 0 and b > 0:
    print("1 {0}".format(min(8, b)))
else:
    print("{0} {1}".format(a, min(8, a + b)))

Submission status: Wrong Answer

Solution code:
N = int(input())
lst = [0] * 9

for x in [int(x) for x in input().split()]:
    if x <= 399:
        lst[0] = 1
    elif x <= 799:
        lst[1] = 1
    elif x <= 1199:
        lst[2] = 1
    elif x <= 1599:
        lst[3] = 1
    elif x <= 1999:
        lst[4] = 1
    elif x <= 2399:
        lst[5] = 1
    elif x <= 2799:
        lst[6] = 1
    elif x <= 3199:
        lst[7] = 1
    else:
        lst[8] += 1

a = sum(lst[:-1])
b = lst[8]
if 8 - a < b:
    b = 8 - a
if a == 0 and b > 0:
    print("1 {0}".format(b))
else:
    print("{0} {1}".format(a, a + b))

Submission status: Wrong Answer

Solution code:
N = int(input())
lst = [0] * 9

for x in [int(x) for x in input().split()]:
    if x <= 399:
        lst[0] = 1
    elif x <= 799:
        lst[1] = 1
    elif x <= 1199:
        lst[2] = 1
    elif x <= 1599:
        lst[3] = 1
    elif x <= 1999:
        lst[4] = 1
    elif x <= 2399:
        lst[5] = 1
    elif x <= 2799:
        lst[6] = 1
    elif x <= 3199:
        lst[7] = 1
    else:
        lst[8] += 1

a = sum(lst[:-1])
b = lst[8]
if 8 - a < b:
    b = 8 - a
print("{0} {1}".format(a, a + b))

Submission status: Wrong Answer

Solution code:
N = int(input())
lst = [0] * 9

for x in [int(x) for x in input().split()]:
    if x <= 399:
        lst[0] = 1
    elif x <= 799:
        lst[1] = 1
    elif x <= 1199:
        lst[2] = 1
    elif x <= 1599:
        lst[3] = 1
    elif x <= 1999:
        lst[4] = 1
    elif x <= 2399:
        lst[5] = 1
    elif x <= 2799:
        lst[6] = 1
    elif x <= 3199:
        lst[7] = 1
    else:
        lst[8] += 1

a = sum(lst[:-1])
b = lst[8]
print(lst)
if 8 - a < b:
    b = 8 - a
print("{0} {1}".format(a, a + b))

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0
colors = [0]*8
cList = list(map(int,input().split()))

for i in cList:
  if i >= 3200:
    count += 1
  else:
    colors[(i//400)] = 1

print(sum(colors),sum(colors)+count)

Submission status: Wrong Answer

Solution code:

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

colors = { "gray": 0, "brown": 0, "green": 0, "water": 0, "blue": 0, "yellow": 0, "orange": 0, "red": 0 }

other = 0

for a in A:
  if 1 <= a <= 399:
    colors["gray"] += 1
  elif 400 <= a <= 799:
    colors["brown"] += 1
  elif 800 <= a <= 1199:
    colors["green"] += 1
  elif 1200 <= a <= 1599:
    colors["water"] += 1
  elif 1600 <= a <= 1999:
    colors["blue"] += 1
  elif 2000 <= a <= 2399:
    colors["yellow"] += 1
  elif 2400 <= a <= 2799:
    colors["orange"] += 1
  elif 2800 <= a <= 3199:
    colors["red"] += 1
  else:
    other += 1

num = len(list(filter(lambda x: x > 0, colors.values())))

print(num, min(num + other, 8))

Submission status: Wrong Answer

Solution code:

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

colors = { "gray": 0, "brown": 0, "green": 0, "water": 0, "blue": 0, "yellow": 0, "orange": 0, "red": 0 }

other = 0

for a in A:
  if 1 <= a <= 399:
    colors["gray"] += 1
  elif 400 <= a <= 799:
    colors["brown"] += 1
  elif 800 <= a <= 1199:
    colors["green"] += 1
  elif 1200 <= a <= 1599:
    colors["water"] += 1
  elif 1600 <= a <= 1999:
    colors["blue"] += 1
  elif 2000 <= a <= 2399:
    colors["yellow"] += 1
  elif 2400 <= a <= 2799:
    colors["orange"] += 1
  elif 2800 <= a <= 3199:
    colors["red"] += 1
  else:
    other += 1

num = len(list(filter(lambda x: x > 0, colors.values())))

print(num, num + other)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
color = [0 for i in range(9)]
a.sort()
for i in a:
    number = i//400
    if number >=8:
        color[8] += 1
    else:
        color[number] += 1
left = 8 - color[:8].count(0)
right = color[8]
if left == 8:
    print('{} {}'.format(8,8))
elif left == 0:
    if right >= 8:
        print('{} {}'.format(1,8))
    else:
        print('{} {}'.format(1,right))
else:
    sum_color = left + right
    if sum_color >= 8:
        print('{} {}'.format(left,8))
    else:
        print('{} {}'.format(left,sum_color))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
color = [0 for i in range(9)]
a.sort()
for i in a:
    number = i//400
    if number >=8:
        color[8] += 1
    else:
        color[number] += 1
left = 8 - color[:8].count(0)
right = color[8]
if left == 8:
    print('{} {}'.format(8,8))
elif left == 0:
    print('{} {}'.format(1,right))
else:
    sum_color = left + right
    if sum_color >= 8:
        print('{} {}'.format(left,8))
    else:
        print('{} {}'.format(left,sum_color))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
color = [0 for i in range(9)]
a.sort()
for i in a:
    number = i//400
    if number >=8:
        color[8] += 1
    else:
        color[number] += 1
left = 8 - color[:8].count(0)
right = color[8]
if left == 8:
    print('{} {}'.format(8,8))
else:
    sum_color = left + right
    if sum_color >= 8:
        print('{} {}'.format(left,8))
    else:
        print('{} {}'.format(left,sum_color))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
rank = [0] * 9
for i in a:
    if i < 3200:
        rank[i // 400] += 1
    rank[8] += 1

s = 0
for i in range(8):
    if rank[i] > 0:
        s += 1
if s > 0:
    s1 = s
else:
    s1 = 1
s2 = s + rank[8]
print(s1, s2)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
B=[0,0,0,0,0,0,0,0]
red=int(0)
for i in range(n):
    now=int(A[i]/400)
    if now<8:
        B[now]=1
    else:
        red+=1

ans=B.count(1)
if ans==0:
    ans=1
print("{} {}".format(ans,ans+red))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
B=[0,0,0,0,0,0,0,0]
red=int(0)
for i in range(n):
    now=int(A[i]/400)
    if now<8:
        B[now]=1
    else:
        red+=1

ans=B.count(1)
print("{} {}".format(ans,ans+red))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
B=[0,0,0,0,0,0,0,0]
red=int(0)
for i in range(n):
    now=int(A[i]/400)
    if now<=7:
        B[now]=1
    else:
        red+=1

ans=B.count(1)

    
print("{} {}".format(ans,ans+red))

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':

	#入力
	N = int(input())
	score_lst = [int(a) for a in input().split()]
	grade_lst = []
	for i in score_lst:
		grade = int(i / 400)
		if grade > 7:
			grade = 8
		grade_lst.append(grade)

	count = 0

	for i in range(0,8):
		if grade_lst.count(i) > 0:
			count += 1

	min_count = count
	max_count = count + grade_lst.count(8)

	print("{} {}".format(min_count,max_count))

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

# N 参加した人数
n = int(input())

# ai 各参加者のレート
rate = list(map(int, input().split()))

# 各レートによる人数
people = np.zeros(8)
# 3200以上の好きな色を選べる人数
free = 0

for r in rate:
    # レートによって人数を求める
    if r < 400:
        people[0] += 1
    elif r < 800:
        people[1] += 1
    elif r < 1200:
        people[2] += 1
    elif r < 1600:
        people[3] += 1
    elif r < 2000:
        people[4] += 1
    elif r < 2400:
        people[5] += 1
    elif r < 2800:
        people[6] += 1
    elif r < 3200:
        people[7] += 1
    else:
        free += 1

# 最小は色の数
min_color = people[people > 0].size

# 最大は、最小 + 選べる人数
max_col = min_color + free

print(min_color, max_col)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=0
s=set()
for i in a:
  if i<400:
    s.add(0)
  elif i<800:
    s.add(1)
  elif i<1200:
    s.add(2)
  elif i<1600:
    s.add(3)
  elif i<2000:
    s.add(4)
  elif i<2400:
    s.add(5)
  elif i<2800:
    s.add(6)
  elif i<3200:
    s.add(7)
  elif i>=3200:
    c+=1
print(len(s),len(s)+c)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=0
s=set()
for i in a:
  if i<400:
    s.add(0)
  elif i<800:
    s.add(1)
  elif i<1200:
    s.add(2)
  elif i<1600:
    s.add(3)
  elif i<2000:
    s.add(4)
  elif i<2400:
    s.add(5)
  elif i<2800:
    s.add(6)
  elif i<3200:
    s.add(7)
  elif i>=3200:
    c+=1
print(len(s),min(len(s)+c,8))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [min(int(i) // 400, 8) for i in input().split()]

n, c = 0, 0
ranks = set()
for a_i in a:
    if a_i == 8:
        n += 1
    else:
        ranks.add(a_i)

min_v = len(ranks)
max_v = len(ranks)
if n > 0:
    min_v = max(1, len(ranks))
    max_v = min(max_v + n, 8)

print(min_v, max_v)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]

tops = 0
others = set()
for a_i in a:
    rank = a_i // 400
    if rank >= 8:
        tops += 1
    else:
        others.add(a_i // 400)

if len(others) == 0:
    ans = min(tops, 1), min(tops, 8)
else:
    ans = len(others), min(len(others) + tops, 8)

print(*ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
a = [int(i) // 400 for i in input().split()]

d = defaultdict(int)
for a_i in a:
    d[a_i] += 1

min_v = 0
max_v = 0
for k, v in d.items():
    if k >= 8:
        max_v += v
        if min_v == 0:
            min_v += 1
    else:
        max_v += 1
        min_v += 1

max_v = min(max_v, 8)

print(min_v, max_v)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
a = [int(i) // 400 for i in input().split()]

d = defaultdict(int)
for a_i in a:
    d[a_i] += 1

min_v = 0
max_v = 0
for k, v in d.items():
    if k == 8:
        max_v += v
        if min_v == 0:
            min_v += 1
    else:
        max_v += 1
        min_v += 1

max_v = min(max_v, 8)

print(min_v, max_v)

Submission status: Wrong Answer

Solution code:
from collections import Counter
input()
A = list(map(int, input().split()))
C = Counter([sum(a >= r for r in [400,800,1200,1600,2000,2400,2800,3200]) for a in A])
c8 = C[8] if 8 in C else 0
a1 = len(C) - (1 if c8 else 0)
a2 = a1+c8
print(a1, a2)

Submission status: Wrong Answer

Solution code:
from collections import Counter
input()
A = list(map(int, input().split()))
C = Counter([sum(a >= r for r in [400,800,1200,1600,2000,2400,2800,3200]) for a in A])
c8 = C[8] if 8 in C else 0
a1 = len(C) - (1 if c8 else 0)
a2 = min(8, a1+c8)
print(a1, a2)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    A = [int(x) for x in input().split()]

    color = [0] * 9
    ans = 0
    for a in A:
        if a >= 3200:
            color[8] += 1
        else:
            color[a // 400] += 1

    mi = 0
    for c in color[:8]:
        if c > 0:
            mi += 1
    if mi == 0:
        print(1, 1)
    else:
        print(mi, mi + color[8])



    

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    A = [int(x) for x in input().split()]

    color = [0] * 9
    ans = 0
    for a in A:
        if a >= 3200:
            color[8] += 1
        else:
            color[a // 400] += 1

    mi = 0
    for c in color[:8]:
        if c > 0:
            mi += 1
    print(mi, mi + color[8])



    

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))

c = [0] * 9

for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1

c_sum = sum(c[:8])
c_min = max(c_sum, min(c[8],1))
c_max = min(c_sum + c[8],8)

print(c_min, c_max)

Submission status: Wrong Answer

Solution code:
N=int(input())
S=list(map(int,input().split()))

D=[0]*9
for s in S:
    s//=400
    if(s>=8):
        s=8
    D[s]+=1
c=0
for i in range(8):
    if(D[i]==0):
        c+=1
print(max(8-c,min(D[8],1)),min(8-c+min(c,D[8]),8))

Submission status: Wrong Answer

Solution code:
N=int(input())
S=list(map(int,input().split()))

D=[0]*9
for s in S:
    s//=400
    if(s>=8):
        s=8
    D[s]+=1
c=0
for i in range(8):
    if(D[i]==0):
        c+=1
print(max(8-c,D[8]),min(8-c+min(c,D[8]),8))

Submission status: Wrong Answer

Solution code:
N=int(input())
S=list(map(int,input().split()))

D=[0]*9
for s in S:
    s//=400
    if(s>=8):
        s=8
    D[s]+=1
c=0
for i in range(8):
    if(D[i]==0):
        c+=1
print(max(8-c,D[8]),max(8-c+min(c,D[8]),8))

Submission status: Wrong Answer

Solution code:
N=int(input())
S=list(map(int,input().split()))

D=[0]*9
for s in S:
    s//=400
    if(s>=8):
        s=8
    D[s]+=1
c=0
for i in range(8):
    if(D[i]==0):
        c+=1
print(8-c,8-c+min(c,D[8]))

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
l = [int(i)//400 if int(i)//400 <= 7 else 8 for i in input().split()]
multi = l.count(8)
if multi == 0:
    num_cols = len(set(l))
    print(num_cols, num_cols)
    sys.exit()
    
num_cols = len(set(l)) - 1
min_cols = max(1,num_cols)
max_cols = min(8, num_cols+multi)
print(min_cols, max_cols)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))

c = [0] * 9

for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1

c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = min(c_sum + c[8], 8)

print(c_min, c_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))

colors = [0] * 9

for rate in a:
    if rate < 400:
        colors[0] += 1
    elif rate < 800:
        colors[1] += 1
    elif rate < 1200:
        colors[2] += 1
    elif rate < 1600:
        colors[3] += 1
    elif rate < 2000:
        colors[4] += 1
    elif rate < 2400:
        colors[5] += 1
    elif rate < 2800:
        colors[6] += 1
    elif rate < 3200:
        colors[7] += 1
    else:
        colors[8] += 1

c_min = len(list(filter(lambda x: x != 0, colors[:8])))
c_max = min(c_min + colors[8], 8)

print(max(c_min, 1), c_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))

colors = [0] * 9

for rate in a:
    if rate < 400:
        colors[0] += 1
    elif rate < 800:
        colors[1] += 1
    elif rate < 1200:
        colors[2] += 1
    elif rate < 1600:
        colors[3] += 1
    elif rate < 2000:
        colors[4] += 1
    elif rate < 2400:
        colors[5] += 1
    elif rate < 2800:
        colors[6] += 1
    elif rate < 3200:
        colors[7] += 1
    else:
        colors[8] += 1

c_min = len(list(filter(lambda x: x != 0, colors[:8])))
c_max = min(c_min + colors[8], 8)

print(c_min, c_max)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    A = list(map(int,input().split()))
    m = {}
    for x in A:
        i = min(3200 // 400,x // 400)
        m[i] = m.get(i,0) + 1
    mi = 0
    for k in m.keys():
        mi += 1
    if m.get(3200 // 400,0) > 0:
        mi = mi - 1
    ma = mi
    ma += m.get(3200 // 400,0)
    print("{} {}".format(mi,ma))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
d = dict()
target = 0
for i in a:
    if i < 3200:
        d[i//400] = d.get(i//400, 0) + 1
    else:
        target += 1


res = 8 - len(d)

mi = max(len(d), 1)
ma = 0
if len(d) == 0:
    ma = min(8, target)
else:
    ma = len(d) + min(8-len(d), target)

print(mi, ma)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
d = dict()
target = 0
for i in a:
    if i < 3200:
        d[i//400] = d.get(i//400, 0) + 1
    else:
        target += 1


res = 8 - len(d)

print(max(len(d), 1), len(d)+min(res, target))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
d = dict()
target = 0
for i in a:
    if i < 3200:
        d[i//400] = d.get(i//400, 0) + 1
    else:
        target += 1


res = 8 - len(d)

print(max(len(d), 1), min(len(d) + res, len(d) + target))

Submission status: Wrong Answer

Solution code:
N = input()
L = [1,2,3,4,5,6,7,8]
M = 0
for x in input().split():
    x = int(x)
    if x == 0:
        continue
    if 400 > x:
        v = 1
    elif 800 > x:
        v = 2
    elif 1200 > x:
        v = 3
    elif 1600 > x:
        v = 4
    elif 2000 > x:
        v = 5
    elif 2400 > x:
        v = 6
    elif 2800 > x:
        v = 7
    elif 3200 > x:
        v = 8
    else:
        M += 1
        continue
    if v in L:
        L.remove(v)
C = 8 - len(L)
print(str(C),end=" ")
print(8 if C+M>8 else C+M)

Submission status: Wrong Answer

Solution code:
N = input()
L = [1,2,3,4,5,6,7,8]
M = 0
for x in input().split():
    x = int(x)
    if 400 > x:
        v = 1
    elif 800 > x:
        v = 2
    elif 1200 > x:
        v = 3
    elif 1600 > x:
        v = 4
    elif 2000 > x:
        v = 5
    elif 2400 > x:
        v = 6
    elif 2800 > x:
        v = 7
    elif 3200 > x:
        v = 8
    else:
        M += 1
        continue
    if v in L:
        L.remove(v)
C = 8 - len(L)
print(str(C),end=" ")
print(8 if C+M>8 else C+M)

Submission status: Wrong Answer

Solution code:
N = input()
L = [1,2,3,4,5,6,7,8]
M = 0
for x in input().split():
    x = int(x)
    if 400 > x:
        v = 1
    elif 800 > x:
        v = 2
    elif 1200 > x:
        v = 3
    elif 1600 > x:
        v = 4
    elif 2000 > x:
        v = 5
    elif 2400 > x:
        v = 6
    elif 2800 > x:
        v = 7
    elif 3200 > x:
        v = 8
    else:
        M += 1
        continue
    if v in L:
        L.remove(v)
C = 8 - len(L)
print(str(C)+" "+str(C + M))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())
N = int(input())
a = list(map(int, input().split()))

C = [0 for _ in range(9)]

for i in range(N) :
  if a[i] < 3200 :
    C[a[i]//400] += 1
  else :
    C[8] += 1

minN = 0
maxN = 0
for j in range(8) :
  if C[j] > 0 :
    minN += 1
  
maxN = min(minN + C[8], 8)

if minN == 0 :
  minN = 1
  
print (str(minN) + " " + str(maxN))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())
N = int(input())
a = list(map(int, input().split()))

C = [0 for _ in range(9)]

for i in range(N) :
  if a[i] < 3200 :
    C[a[i]//400] += 1
  else :
    C[8] += 1

min = 0
max = 0
for j in range(8) :
  if C[j] > 0 :
    min += 1
  
max = min + C[8]
if max >= 8 :
  max = 8

if min == 0 :
  min = 1
  
print (str(min) + " " + str(max))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())
N = int(input())
a = list(map(int, input().split()))

C = [0 for _ in range(9)]

for i in range(N) :
  if a[i] < 3200 :
    C[a[i]//400] += 1
  else :
    C[8] += 1

min = 0
max = 0
for j in range(8) :
  if C[j] > 0 :
    min += 1

max = min + C[8]
if max >= 8 :
  max = 8

print (str(min) + " " + str(max))

Submission status: Wrong Answer

Solution code:
import sys
import bisect
n = int(input())
a_ls = [int(i) for i in sys.stdin.readline().split()]
ls = [i * 400 - 1 for i in range(1, 9)]
_set = set()
n_max = 0
for a in a_ls:
    ind = bisect.bisect_left(ls ,a)
    if ind == 8:
        n_max += 1
    else:
        _set.add(ind)
_min = max(len(_set), 1)
print(_min, min(8, len(_set) + n_max))

Submission status: Wrong Answer

Solution code:
import sys
import bisect
n = int(input())
a_ls = [int(i) for i in sys.stdin.readline().split()]
ls = [i * 400 - 1 for i in range(1, 9)]
_set = set()
n_max = 0
for a in a_ls:
    ind = bisect.bisect_left(ls ,a)
    if ind == 8:
        n_max += 1
    else:
        _set.add(ind)
_min = len(_set) if len(_set) != 0 else 1
print(_min, min(8, len(_set) + n_max))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(int(x)/400) for x in input().split()]
b = [x if x <= 7 else 8 for x in a]

ans = len(set(b))
if (8 in b):
   ans -= 1
   if (ans == 0):
      print(1, 1)
   else:
      ans2 = b.count(8) + ans
      print(ans, ans2)
else:
   print(ans, ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(int(x)/400) for x in input().split()]
b = [x if x <= 7 else 8 for x in a]

ans = len(set(b))
if (8 in b):
   ans -= 1
   ans2 = b.count(8) + ans
   print(ans, ans2)
else:
   print(ans, ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(int(x)/400) for x in input().split()]
b = [x if x <= 7 else 8 for x in a]

ans = len(set(b))
if (8 in b):
   ans2 = b.count(8) + ans - 1
   if (ans2 > 8):
      print(ans - 1, 8)
   else:
      print(ans - 1, ans2)
else:
   print(ans, ans)

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    A = LI()
    taken = set()
    free = 0
    for a in A:
        if 0 <= a < 400:
            taken.add('gray')
        elif a < 800:
            taken.add('br')
        elif a < 1200:
            taken.add('green')
        elif a < 1600:
            taken.add('wat')
        elif a < 2000:
            taken.add('blue')
        elif a < 2400:
            taken.add('yellow')
        elif a < 2800:
            taken.add('orange')
        elif a < 3200:
            taken.add('red')
        else:
            free += 1
    minval = len(taken)
    maxval = minval + free
    print(minval, maxval)

main()

Submission status: Wrong Answer

Solution code:
color_list = [0]*9

x = input()

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

for i in score_lists:
    if i < 400:
        color_list[0] = 1
    elif i < 800:
        color_list[1] = 1
    elif i < 1200:
        color_list[2] = 1
    elif i < 1600:
        color_list[3] = 1
    elif i < 2000:
        color_list[4] = 1
    elif i < 2400:
        color_list[5] = 1
    elif i < 2800:
        color_list[6] = 1
    elif i < 3200:
        color_list[7] = 1
    else:
        color_list[8] = color_list[8] + 1

ans_min = color_list[0] + color_list[1] + color_list[2] + color_list[3] + color_list[4]\
     + color_list[5] + color_list[6] + color_list[7]

if ans_min == 0 and color_list[8] != 0:
    ans_min = 1

ans_max = color_list[0] + color_list[1] + color_list[2] + color_list[3] + color_list[4]\
     + color_list[5] + color_list[6] + color_list[7] + color_list[8]

if ans_max > 8:
    ans_max = 8

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))

color = set()
mx = 0

for i in a:
    if 1 <= i <= 399:
        color.add('a')
    elif 400 <= i <= 799:
        color.add('b')
    elif 800 <= i <= 1199:
        color.add('c')
    elif 1200 <= i <= 1599:
        color.add('d')
    elif 1600 <= i <= 1999:
        color.add('e')
    elif 2000 <= i <= 2399:
        color.add('f')
    elif 2400 <= i <= 2799:
        color.add('g')
    elif 2800 <= i <= 3199:
        color.add('h')
    elif 3200 <= i:
        mx += 1

cn = len(color)
cx = cn + mx

print(cn, cx)

Submission status: Wrong Answer

Solution code:
color_list = [0]*9

x = input()

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

for i in score_lists:
    if i < 400:
        if color_list[0] == 0:
            color_list[0] = 1
    elif i < 800:
        if color_list[1] == 0:
            color_list[1] = 1
    elif i < 1200:
        if color_list[2] == 0:
            color_list[2] = 1
    elif i < 1600:
        if color_list[3] == 0:
            color_list[3] = 1
    elif i < 2000:
        if color_list[4] == 0:
            color_list[4] = 1
    elif i < 2400:
        if color_list[5] == 0:
            color_list[5] = 1
    elif i < 2800:
        if color_list[6] == 0:
            color_list[6] = 1
    elif i < 3200:
        if color_list[7] == 0:
            color_list[7] = 1
    else:
        color_list[8] = color_list[8] + 1

ans_min = color_list[0] + color_list[1] + color_list[2] + color_list[3] + color_list[4]\
     + color_list[5] + color_list[6] + color_list[7]

if ans_min == 0 and color_list[8] != 0:
    ans_min = 1

ans_max = color_list[0] + color_list[1] + color_list[2] + color_list[3] + color_list[4]\
     + color_list[5] + color_list[6] + color_list[7] + color_list[8]

if ans_max > 8:
    ans_max = 8

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
color_list = [0]*9

x = input()

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

for i in score_lists:
    if i < 400:
        if color_list[0] == 0:
            color_list[0] = 1
    elif i < 800:
        if color_list[1] == 0:
            color_list[1] = 1
    elif i < 1200:
        if color_list[2] == 0:
            color_list[2] = 1
    elif i < 1600:
        if color_list[3] == 0:
            color_list[3] = 1
    elif i < 2000:
        if color_list[4] == 0:
            color_list[4] = 1
    elif i < 2400:
        if color_list[5] == 0:
            color_list[5] = 1
    elif i < 2800:
        if color_list[6] == 0:
            color_list[6] = 1
    elif i < 3200:
        if color_list[7] == 0:
            color_list[7] = 1
    else:
        color_list[8] = color_list[8] + 1

ans_min = color_list[0] + color_list[1] + color_list[2] + color_list[3] + color_list[4]\
     + color_list[5] + color_list[6] + color_list[7]

if ans_min == 0 and color_list[8] != 0:
    ans_min = 1

ans_max = color_list[0] + color_list[1] + color_list[2] + color_list[3] + color_list[4]\
     + color_list[5] + color_list[6] + color_list[7] + color_list[8]

if ans_max > 9:
    ans_max = 9

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
color_list = [0]*9

x = input()

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

for i in score_lists:
    if i < 400:
        if color_list[0] == 0:
            color_list[0] = 1
    elif i < 800:
        if color_list[1] == 0:
            color_list[1] = 1
    elif i < 1200:
        if color_list[2] == 0:
            color_list[2] = 1
    elif i < 1600:
        if color_list[3] == 0:
            color_list[3] = 1
    elif i < 2000:
        if color_list[4] == 0:
            color_list[4] = 1
    elif i < 2400:
        if color_list[5] == 0:
            color_list[5] = 1
    elif i < 2800:
        if color_list[6] == 0:
            color_list[6] = 1
    elif i < 3200:
        if color_list[7] == 0:
            color_list[7] = 1
    else:
        color_list[8] = color_list[8] + 1

ans_min = color_list[0] + color_list[1] + color_list[2] + color_list[3] + color_list[4]\
     + color_list[5] + color_list[6] + color_list[7]

if ans_min == 0 and color_list[7] != 0:
    ans_min = 1

ans_max = color_list[0] + color_list[1] + color_list[2] + color_list[3] + color_list[4]\
     + color_list[5] + color_list[6] + color_list[7] + color_list[8]

if ans_max > 8:
    ans_max = 8

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
a = [int(i) for i in input().split()]
li = [False] * 8
count_over = 0
for i in range(N) :
    if 1 <= a[i] <= 399 :
        if li[0] == False :
            li[0] = True
    if 400 <= a[i] <= 799 :
        if li[1] == False :
            li[1] = True
    if 800 <= a[i] <= 1199 :
        if li[2] == False :
            li[2] = True
    if 1200 <= a[i] <= 1599 :
        if li[3] == False :
            li[3] = True
    if 1600 <= a[i] <= 1999 :
        if li[4] == False :
            li[4] = True
    if 2000 <= a[i] <= 2399 :
        if li[5] == False :
            li[5] = True
    if 2400 <= a[i] <= 2799 :
        if li[6] == False :
            li[6] = True
    if 2800 <= a[i] <= 3199 :
        if li[7] == False :
            li[7] = True
    if 3200 <= a[i] :
        count_over += 1
sum = 0
for i in range(8) :
    if li[i] :
        sum+=1
maxx = min(8,sum+count_over)
minn = 0
if sum == 0 :
    minn = 1
else :
    minn = sum
print(minn,maxx)