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,*a=map(int,open(0).read().split())
""" 
1 399：灰色 
400 799：茶色
800 1199：緑色
1200 1599：水色 
1600 1999：青色 
2000 2399：黄色 
2400 2799：橙色
2800 3199：赤色
"""
if n==1:
  print(1,1)
  exit()

li=[False]*8
over3200=0
for i in a:
  if i>=3200:
    over3200+=1
  else:
    li[(i//400)]=True
    
k=sum(li)
print(k,min(8,k+over3200))

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
""" 
1 399：灰色 
400 799：茶色
800 1199：緑色
1200 1599：水色 
1600 1999：青色 
2000 2399：黄色 
2400 2799：橙色
2800 3199：赤色
"""
if n==1:
  print(1,1)
  exit()

li=[False]*8
over3200=0
for i in a:
  if i>=3200:
    over3200+=1
  else:
    li[(i//400)]=True
    
k=sum(li)
print(k,max(8,k+over3200))

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
""" 
1 399：灰色 
400 799：茶色
800 1199：緑色
1200 1599：水色 
1600 1999：青色 
2000 2399：黄色 
2400 2799：橙色
2800 3199：赤色
"""
if n==1:
  print(1,1)
  exit()

li=[False]*8
over3200=0
for i in a:
  if i>=3200:
    over3200+=1
  else:
    li[(i//400)]=True
    
k=sum(li)
print(k,k+over3200)

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
""" 
1 399：灰色 
400 799：茶色
800 1199：緑色
1200 1599：水色 
1600 1999：青色 
2000 2399：黄色 
2400 2799：橙色
2800 3199：赤色
"""
li=[False]*8
over3200=0
for i in a:
  if i>=3200:
    over3200+=1
  else:
    li[(i//400)]=True
    
k=sum(li)
print(k,k+over3200)

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

n = int(sys.stdin.readline().rstrip())
a = np.array(sys.stdin.readline().split(), dtype=np.int64)

def main():
    res = np.bincount(np.minimum(a // 400, 8), minlength=9)
    
    ans_min = np.count_nonzero(res[:8])
    ans_max = ans_min + res[8]
    return ans_min, ans_max

if __name__ == '__main__':
    ans = main()
    print(*ans, sep=' ')

Submission status: Wrong Answer

Solution code:
color = [0 for i in range(8)]

n = int(input())
al = list(map(int,input().split()))

p = 0
for a in al:
    if a < 3200:
        color[a//400] = 1
    else:
        p += 1
print(max(sum(color), 1))
print(min(sum(color) + p, 8))

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    over=0
    n=int(input())
    aa=LI()
    cnt=[0]*8
    for a in aa:
        if a>=3200:over+=1
        else:cnt[a//400]=1
    s=sum(cnt)
    print(s,s+over)

main()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
s = set()
r = 0
for i in a:
  if i < 3200:
    s.add(i//400)
  else:
    r += 1
print(max(len(s), 1), min(len(s)+r, 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
color = [0] * 11
for p in a:
    if p >= 3200: color[8] += 1
    else: color[p // 400] += 1
small = len([c for c in color[0:8] if c > 0])
big = small + color[8]
print(small, big)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
color = [0] * 9
for p in a:
    if p >= 3200: color[8] += 1
    else: color[p // 400] += 1
small = len([c for c in color[0:8] if c > 0])
big = small + color[8]
print(small, big)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
color = [0] * 9
for p in a:
    if p >= 3200: color[8] += 1
    else: color[p // 400] += 1
small = len([c for c in color[0:8] if c > 0])
if(color[7] == 0 and color[8] > 0): small += 1
big = small + color[8]
print(small, big)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
color = [0] * 9
for p in a:
    if p > 3200: color[8] += 1
    else: color[p // 400] += 1
small = len([c for c in color[0:8] if c > 0])
if(color[7] == 0 and color[8] > 0): small += 1
big = small + color[8]
print(small, big)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
color = [0] * 9
for p in a:
    if p > 3200: color[8] += 1
    else: color[p // 400] += 1
small = len([c for c in color[0:8] if c > 0])
big = small + color[8]
print(small, big)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
color = [0] * 9
for p in a:
    if p > 3200: color[8] += 1
    else: color[p // 400] += 1
small = len([c for c in color[0:8] if c > 0])
big = min(small + color[8], 8)
print(small, big)

Submission status: Wrong Answer

Solution code:
import sys
N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
maxA = max(A)
L=[0 for _ in range(9)]
for a in A:
    if a <=399:
        L[0]+=1
    elif a <=799:
        L[1]+=1
    elif a <=1199:
        L[2]+=1
    elif a <=1599:
        L[3]+=1
    elif a <=1999:
        L[4]+=1
    elif a <=2399:
        L[5]+=1
    elif a <=2799:
        L[6]+=1
    elif a <=3199:
        L[7]+=1
    else:
        L[8]+=1
cnt=0
for i in range(8):
    if L[i] !=0:
        cnt+=1
zero_cnt = 8-cnt
Max = cnt + min(zero_cnt, L[8])
if cnt==0 and L[8]>0:
    cnt+=1
print(cnt, Max)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [int(i) for i in input().split()]
ans = [0 for _ in range(9)]
free = 0
for i in l:
    if i < 3200:
        ans[i//400] += 1
    else:
        free += 1
        
ans = [i for i in ans if i != 0]
print(len(ans),len(ans) + free)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
max_ans = 0
min_ans = 0
colors = [False] * 8
for i in range(n):
    rate = a[i]
    if 1 <= rate and rate < 400:
        colors[0] = True
    elif rate < 800:
        colors[1] = True
    elif rate < 1200:
        colors[2] = True
    elif rate < 1600:
        colors[3] = True
    elif rate < 2000:
        colors[4] = True
    elif rate < 2400:
        colors[5] = True
    elif rate < 2800:
        colors[6] = True
    elif rate < 3200:
        colors[7] = True
    else:
        max_ans += 1
min_ans += colors.count(True)
max_ans += colors.count(True)
print(min_ans, max_ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
C = set()
R = 0
for a in A:
    c = a//400 if a<3200 else 8
    C.add(c)
    if c==8: R+=1

print(len(C) - min(1, R), len(C) + max(0, R-1))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
C = set()
R = 0
for a in A:
    c = a//400 if a<2800 else 7
    C.add(c)
    if c==7: R+=1

print(len(C), len(C)+max(0, R-1))

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [0 for i in range(9)]
S = list(map(int, input().split()))
for i in range(N):
  p = S[i] // 400
  if p <= 7:
    L[p] += 1
  else:
    L[8] += 1
Z, M, m = 0, 0, 0
for i in range(8):
  if L[i] == 0:
    Z += 1
  else:
    M += 1
    m += 1
M += L[8]
print(L)
if m == 0 and L[8] != 0:
  m = 1
print(m, M)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [0 for i in range(9)]
S = list(map(int, input().split()))
for i in range(N):
  p = S[i] // 400
  if p <= 7:
    L[p] += 1
  else:
    L[8] += 1
Z, M, m = 0, 0, 0
for i in range(8):
  if L[i] == 0:
    Z += 1
  else:
    M += 1
    m += 1
M += min(Z, L[8])
if m == 0 and L[8] != 0:
  m = 1
print(m, M)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [0 for i in range(9)]
S = list(map(int, input().split()))
for i in range(N):
  p = S[i] // 400
  if p <= 7:
    L[p] += 1
  else:
    L[8] += 1
Z, M, m = 0, 0, 0
for i in range(8):
  if L[i] == 0:
    Z += 1
  else:
    M += 1
    m += 1
M += min(Z, L[8])
print(m, M)

Submission status: Wrong Answer

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

d = {"Gray": 0, "Brown": 0, "Green": 0, "Sky": 0, "Blue": 0, "Yellow": 0, "Orange": 0, "Red": 0}
f = 0

for i in range(N):
    s = A[i]
    if s <= 399:
        d["Gray"] += 1
    elif s >= 400 and s <= 799:
        d["Brown"] += 1
    elif s >= 800 and s <= 1199:
        d["Green"] += 1
    elif s >= 1200 and s <= 1599:
        d["Sky"] += 1
    elif s >= 1600 and s <= 1999:
        d["Blue"] += 1
    elif s >= 2000 and s <= 2399:
        d["Yellow"] += 1
    elif s >= 2400 and s <= 2799:
        d["Orange"] += 1
    elif s >= 2800 and s <= 3199:
        d["Red"] += 1
    elif s >= 3200:
        f += 1

MIN = 0
for v in d.values():
    if v > 0:
        MIN += 1

MAX = MIN + f

if MAX > 8:
    MAX = 8

if MIN == 0 : MIN = 1

print(MIN, MAX)

Submission status: Wrong Answer

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

d = {"Gray": 0, "Brown": 0, "Green": 0, "Sky": 0, "Blue": 0, "Yellow": 0, "Orange": 0, "Red": 0}
f = 0

for i in range(N):
    s = A[i]
    if s <= 399:
        d["Gray"] += 1
    elif s >= 400 and s <= 799:
        d["Brown"] += 1
    elif s >= 800 and s <= 1199:
        d["Green"] += 1
    elif s >= 1200 and s <= 1599:
        d["Sky"] += 1
    elif s >= 1600 and s <= 1999:
        d["Blue"] += 1
    elif s >= 2000 and s <= 2399:
        d["Yellow"] += 1
    elif s >= 2400 and s <= 2799:
        d["Orange"] += 1
    elif s >= 2800 and s <= 3199:
        d["Red"] += 1
    elif s >= 3200:
        f += 1

MIN = 0
for v in d.values():
    if v > 0:
        MIN += 1

MAX = MIN
if f > 0 and MIN < 8:
    MAX += f

if MAX > 8:
    MAX = 8

if MIN == 0 : MIN = 1

print(MIN, MAX)

Submission status: Wrong Answer

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

min_color = 0
max_color = 0

color = [0] * 8

for i in a:
    if i < 400 and color[0] == 0:
        min_color += 1
        max_color += 1
        color[0] = 1

    elif 400 <= i and i < 800 and color[1] == 0:
        min_color += 1
        max_color += 1
        color[1] = 1

    elif 800 <= i and i < 1200 and color[2] == 0:
        min_color += 1
        max_color += 1
        color[2] = 1

    elif 1200 <= i and i < 1600 and color[3] == 0:
        min_color += 1
        max_color += 1
        color[3] = 1

    elif 1600 <= i and i < 2000 and color[4] == 0:
        min_color += 1
        max_color += 1
        color[4] = 1

    elif 2000 <= i and i < 2400 and color[5] == 0:
        min_color += 1
        max_color += 1
        color[5] = 1

    elif 2400 <= i and i < 2800 and color[6] == 0:
        min_color += 1
        max_color += 1
        color[6] = 1

    elif 2800 <= i and i < 3200 and color[7] == 0:
        min_color += 1
        max_color += 1
        color[7] = 1

    elif i >= 3200:
        max_color += 1

print(min_color, max_color)

Submission status: Wrong Answer

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

min_color = 0
max_color = 0

color = [0] * 8

for i in a:
    if i < 400 and color[0] == 0:
        min_color += 1
        max_color += 1
        color[0] = 1

    elif 400 <= i and i < 800 and color[1] == 0:
        min_color += 1
        max_color += 1
        color[1] = 1

    elif 800 <= i and i < 1200 and color[2] == 0:
        min_color += 1
        max_color += 1
        color[2] = 1

    elif 1200 <= i and i < 1600 and color[3] == 0:
        min_color += 1
        max_color += 1
        color[3] = 1

    elif 1600 <= i and i < 2000 and color[4] == 0:
        min_color += 1
        max_color += 1
        color[4] = 1

    elif 2000 <= i and i < 2400 and color[5] == 0:
        min_color += 1
        max_color += 1
        color[5] = 1

    elif 2400 <= i and i < 2800 and color[6] == 0:
        min_color += 1
        max_color += 1
        color[6] = 1

    elif i >= 2800:
        if color[7] == 0:
            min_color += 1
            color[7] = 1
        max_color += 1

print(min_color, max_color)

Submission status: Wrong Answer

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

d = {"Gray": 0, "Brown": 0, "Green": 0, "Sky": 0, "Blue": 0, "Yellow": 0, "Orange": 0, "Red": 0}
f = 0

for i in range(N):
    s = A[i]
    if s <= 399:
        d["Gray"] += 1
    elif s >= 400 and s <= 799:
        d["Brown"] += 1
    elif s >= 800 and s <= 1199:
        d["Green"] += 1
    elif s >= 1200 and s <= 1599:
        d["Sky"] += 1
    elif s >= 1600 and s <= 1999:
        d["Blue"] += 1
    elif s >= 2000 and s <= 2399:
        d["Yellow"] += 1
    elif s >= 2400 and s <= 2799:
        d["Orange"] += 1
    elif s >= 2800 and s <= 3199:
        d["Red"] += 1
    elif s >= 3200:
        f += 1

MIN = 0
for v in d.values():
    if v > 0:
        MIN += 1

MAX = MIN
if f > 0 and MIN < 9:
    MAX += f

if MAX > 9:
    MAX = 9

if MIN == 0 : MIN = 1

print(MIN, MAX)

Submission status: Wrong Answer

Solution code:
import sys

if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

N = INT()
A = MAP()

norm = []
genius = []
for a in A:
	if a >= 3200: genius.append(a//400)
	else: norm.append(a//400)

#print(norm)
#print(genius)

print(len(set(norm)), len(set(norm))+len(genius))

Submission status: Wrong Answer

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

d = {"Gray": 0, "Brown": 0, "Green": 0, "Sky": 0, "Blue": 0, "Yellow": 0, "Orange": 0, "Red": 0}
f = 0

for i in range(N):
    s = A[i]
    if s <= 399:
        d["Gray"] += 1
    elif s >= 400 and s <= 799:
        d["Brown"] += 1
    elif s >= 800 and s <= 1199:
        d["Green"] += 1
    elif s >= 1200 and s <= 1599:
        d["Sky"] += 1
    elif s >= 1600 and s <= 1999:
        d["Blue"] += 1
    elif s >= 2000 and s <= 2399:
        d["Yellow"] += 1
    elif s >= 2400 and s <= 2799:
        d["Orange"] += 1
    elif s >= 2800 and s <= 3199:
        d["Red"] += 1
    elif s >= 3200:
        f += 1

MIN = 0
for v in d.values():
    if v > 0:
        MIN += 1

MAX = MIN
if f > 0 and MIN < 9:
    MAX += f

if MAX > 9:
    MAX = 9

if MIN == 0 : M = 1

print(MIN, MAX)

Submission status: Wrong Answer

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

d = {"Gray": 0, "Brown": 0, "Green": 0, "Sky": 0, "Blue": 0, "Yellow": 0, "Orange": 0, "Red": 0}
f = 0

for i in range(N):
    s = A[i]
    if s <= 399:
        d["Gray"] += 1
    elif s >= 400 and s <= 799:
        d["Brown"] += 1
    elif s >= 800 and s <= 1199:
        d["Green"] += 1
    elif s >= 1200 and s <= 1599:
        d["Sky"] += 1
    elif s >= 1600 and s <= 1999:
        d["Blue"] += 1
    elif s >= 2000 and s <= 2399:
        d["Yellow"] += 1
    elif s >= 2400 and s <= 2799:
        d["Orange"] += 1
    elif s >= 2800 and s <= 3199:
        d["Red"] += 1
    elif s >= 3200:
        f += 1

MIN = 0
for v in d.values():
    if v > 0:
        MIN += 1

MAX = MIN
if f > 0 and MIN < 9:
    MAX += f

if MAX > 9:
    MAX = 9

print(MIN, MAX)

Submission status: Wrong Answer

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
a = list(map(int, stdin.readline().rstrip().split()))

c = [0] * 9
for i in a:
    if i >= 3200:
        c[8] += 1
    else:
        for j in range(9):
            if 400 * j <= i < 400 * j + 399:
                c[j] += 1

res = len([i for i in c[:-1] if i > 0])
print(1 if res == 0 else res, res + c[-1])

Submission status: Wrong Answer

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
a = list(map(int, stdin.readline().rstrip().split()))

c = [0] * 9
for i in a:
    if i >= 3200:
        c[8] += 1
    else:
        for j in range(9):
            if 400 * j <= i < 400 * j + 399:
                c[j] += 1

if c[8] > 0:
    resmin = len([i for i in c[:8] if i > 0])
    if resmin == 0:
        resmin = 1
        if c[8] == 1:
            resmax = 1
        else:
            resmax = c[8]
    else:
        resmax = resmin + c[8]

    print(str(resmin) + ' ' + str(resmax))
else:
    res = len([i for i in c if i > 0])
    print(str(res) + ' ' + str(res))

Submission status: Wrong Answer

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
a = list(map(int, stdin.readline().rstrip().split()))

c = [0] * 9
for i in a:
    if i >= 3200:
        c[8] += 1
    else:
        for j in range(9):
            if 400 * j <= i < 400 * j + 399:
                c[j] += 1

if c[8] > 0:
    resmin = len([i for i in c[:8] if i > 0])
    if resmin == 0:
        resmin = 1
    if c[8] >= len([i for i in c[:8] if i == 0]):
        resmax = 8
    else:
        resmax = resmin + c[8] % (8 - resmin)
    print(str(resmin) + ' ' + str(resmax))
else:
    res = len([i for i in c if i > 0])
    print(str(res) + ' ' + str(res))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
colorSet = set()
minAns = 0
maxAns = 0
cnt = 0

for i in range(n):
    color = a[i] // 400
    if color < 8:
        colorSet.add(color)
    else:
        colorSet.add(8)
    
    if color >= 8:
        cnt += 1

#print(colorSet)

if len(colorSet) > 1 and any(item >= 8 for item in colorSet):
    minAns = len(colorSet) - 1
else:
    minAns = len(colorSet)

if cnt > 0:
    maxAns = min(len(colorSet) - 1 + cnt, 8)
else:
    maxAns = len(colorSet)

print(minAns, maxAns)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
colorSet = set()
minAns = 0
maxAns = 0
cnt = 0

for i in range(n):
    color = a[i] // 400
    colorSet.add(color)
    if color >= 8:
        cnt += 1

#print(colorSet)

if len(colorSet) > 1 and any(item >= 8 for item in colorSet):
    minAns = len(colorSet) - 1
else:
    minAns = len(colorSet)

if cnt > 0:
    maxAns = min(len(colorSet) - 1 + cnt, 8)
else:
    maxAns = len(colorSet)

print(minAns, maxAns)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
colorSet = set()
minAns = 0
maxAns = 0
cnt = 0

for i in range(n):
    color = a[i] // 400
    colorSet.add(color)
    print(i, color)
    if color >= 8:
        cnt += 1

#print(colorSet)

if len(colorSet) > 1 and any(item >= 8 for item in colorSet):
    minAns = len(colorSet) - 1
else:
    minAns = len(colorSet)

if cnt > 0:
    maxAns = min(len(colorSet) - 1 + cnt, 8)
else:
    maxAns = len(colorSet)

print(minAns, maxAns)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
colorSet = set()
minAns = 0
maxAns = 0
cnt = 0

for i in range(n):
    color = a[i] // 400
    colorSet.add(color)
    if color >= 8:
        cnt += 1

#print(colorSet)

if any(item >= 8 for item in colorSet):
    minAns = len(colorSet) - 1
else:
    minAns = len(colorSet)

if cnt > 0:
    maxAns = min(len(colorSet) - 1 + cnt, 8)
else:
    maxAns = len(colorSet)

print(minAns, maxAns)

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
a = sorted(list(map(int, input().split())))
color = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
border = []
for i in color:
    border.append(bisect.bisect_left(a, i))
border = [0] + border
num = []
for i in range(len(color)):
    num.append(border[i+1] - border[i])
num.append(N - sum(num))
colornum = sum(x>0 for x in num[:-1])
if colornum == 0:
    colornum = 1
    num[-1] -= 1
print(str(colornum) + " " + str(min(colornum + num[-1], 8)))

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
a = sorted(list(map(int, input().split())))
color = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
border = []
for i in color:
    border.append(bisect.bisect_left(a, i))
border = [0] + border
num = []
for i in range(len(color)):
    num.append(border[i+1] - border[i])
num.append(N - sum(num))
colornum = sum(x>0 for x in num[:-1])
if colornum == 0:
    colornum = 1
    num[-1] -= 1
print(num)
print(str(colornum) + " " + str(min(colornum + num[-1], 8)))

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
a = sorted(list(map(int, input().split())))
color = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
border = []
for i in color:
    border.append(bisect.bisect_left(a, i))
border = [0] + border
num = []
for i in range(len(color)):
    num.append(border[i+1] - border[i])
num.append(N - sum(num))
colornum = sum(x>0 for x in num[:-1])
if colornum == 0:
    colornum = 1
print(num)
print(str(colornum) + " " + str(min(colornum + num[-1], 8)))

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
a = sorted(list(map(int, input().split())))
color = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
border = []
for i in color:
    border.append(bisect.bisect_left(a, i))
border = [0] + border
num = []
for i in range(len(color)):
    num.append(border[i+1] - border[i])
num.append(N - sum(num))
colornum = sum(x>0 for x in num[:-1])
print(str(colornum) + " " + str(max(colornum + num[-1], 8)))

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
a = sorted(list(map(int, input().split())))
color = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
border = []
for i in color:
    border.append(bisect.bisect_left(a, i))
border = [0] + border
num = []
for i in range(len(color)):
    num.append(border[i+1] - border[i])
num.append(N - sum(num))
colornum = sum(x>0 for x in num[:-1])
print(str(colornum) + " " + str(min(colornum + num[-1], 8)))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
col = [0]*8
wild = 0
for i in a:
    if i//400 <= 7:
        col[i//400] = 1
    else:
        wild += 1
minimum = max(1,sum(col))
maximum = min(8,sum(col)+wild)
print(minimum,maximum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
col = [0]*8
wild = 0
for i in a:
    if i//400 <= 7:
        col[i//400] = 1
    else:
        wild += 1
minimum = sum(col)
maximum = min(8,sum(col)+wild)
print(minimum,maximum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
num = [0 for i in range(9)]
for i in range(N):
    if a[i] < 3200:
        num[a[i]//400] += 1
    else:
        num[-1] += 1

if num[-1] == 0:
    num = [i for i in num if i != 0]
    print(len(num),len(num))
else:
    n = num.pop(-1)
    num2 = [i for i in num if i != 0]
    print(max(1,len(num2)),min(8,len(num2)+n))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
num = [0 for i in range(9)]
for i in range(N):
    if a[i] < 3600:
        num[a[i]//400] += 1
    else:
        num[-1] += 1

if num[-1] == 0:
    num = [i for i in num if i != 0]
    print(len(num),len(num))
else:
    n = num.pop(-1)
    num2 = [i for i in num if i != 0]
    print(max(1,len(num2)),min(8,len(num2)+n))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
num = [0 for i in range(9)]
for i in range(N):
    if a[i] < 3600:
        num[a[i]//400] += 1
    else:
        num[-1] += 1

if num[-1] == 0:
    num = [i for i in num if i != 0]
    print(len(num),len(num))
else:
    n = num.pop(-1)
    num2 = [i for i in num if i != 0]
    print(min(1,len(num2)),min(8,len(num2)+n))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
num = [0 for i in range(9)]
for i in range(N):
    if a[i] < 3600:
        num[a[i]//400] += 1
    else:
        num[-1] += 1

if num[-1] == 0:
    num = [i for i in num if i != 0]
    print(len(num),len(num))
else:
    n = num.pop(-1)
    num2 = [i for i in num if i != 0]
    print(len(num2),min(8,len(num2)+n))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
rate_list = [0] * 9

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

count = 0
for i in range(8):
    if rate_list[i] > 0:
        count += 1

count2 = count
count2 += rate_list[8]

if rate_list[8] > 0:
    print(1, min(8, count2))
else:
    print(max(count, 0), min(8, count2))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
rate_list = [0] * 9

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

count = 0
for i in range(8):
    if rate_list[i] > 0:
        count += 1

count2 = count
count2 += rate_list[8]

print(max(rate_list[8], count), min(8, count2))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
rate_list = [0] * 8

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

count = 0
for i in range(7):
    if rate_list[i] > 0:
        count += 1

count2 = count
count2 += rate_list[7]

print(max(rate_list[7], count), min(8, count2))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
rate_list = [0] * 8

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

count = 0
for i in range(7):
    if rate_list[i] > 0:
        count += 1

count2 = count
count2 += rate_list[7]

print(count, min(8, count2))

Submission status: Wrong Answer

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

color = [0]*9
for i in range(n):
    if a[i] < 400:
        color[0] += 1
    elif 400 <= a[i] < 800:
        color[1] += 1
    elif 800 <= a[i] < 1200:
        color[2] += 1
    elif 1200 <= a[i] < 1600:
        color[3] += 1
    elif 1600 <= a[i] < 2000:
        color[4] += 1
    elif 2000 <= a[i] < 2400:
        color[5] += 1
    elif 2400 <= a[i] < 2800:
        color[6] += 1
    elif 2800 <= a[i] < 3200:
        color[7] += 1
    else:
        color[8] += 1

k = len(list(filter(lambda x: x > 0, color[:-1])))
print(k, k + color[-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
c = [False] * 8
red = 0
for i in range(n):
    if l[i] <= 399:
        c[0] = True
    elif l[i] <= 799:
        c[1] = True
    elif l[i] <= 1199:
        c[2] = True
    elif l[i] <= 1599:
        c[3] = True
    elif l[i] <= 1999:
        c[4] = True
    elif l[i] <= 2399:
        c[5] = True
    elif l[i] <= 2799:
        c[6] = True
    elif l[i] <= 3199:
        c[7] = True
    else:
        red += 1
ans_min = max(1, c.count(True))
ans_max = min(len(c), c.count(True) + red)
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
c = [False] * 8
red = 0
for i in range(n):
    if l[i] <= 399:
        c[0] = True
    elif l[i] <= 799:
        c[1] = True
    elif l[i] <= 1199:
        c[2] = True
    elif l[i] <= 1599:
        c[3] = True
    elif l[i] <= 1999:
        c[4] = True
    elif l[i] <= 2399:
        c[5] = True
    elif l[i] <= 2799:
        c[6] = True
    elif l[i] <= 3199:
        c[7] = True
    else:
        red += 1
ans_min = c.count(True)
if ans_min == 0 and red > 0:
    ans_min = 1
ans_max = min(len(c), c.count(True) + red)
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
cnt = [0,0,0,0,0,0,0,0]
count = 0
num = 0

for i in a:
    if 1 <= i <= 399:
        cnt[0] += 1
    elif 400<= i <= 799:
        cnt[1] += 1
        
    elif 800<= i <= 1199:
        cnt[2] += 1
        
    elif 1200<= i <= 1599:
        cnt[3] += 1
        
    elif 1600<= i <= 1999:
        cnt[4] += 1
        
    elif 2000<= i <= 2399:
        cnt[5] += 1
        
    elif 2400<= i <= 2799:
        cnt[6] += 1
       
    elif 2800 <= i <= 3199:
        cnt[7] += 1
        
    else:
        count += 1
for i in range(len(cnt)):
    if cnt[i] > 0:
        num +=1
print(num,num+count)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
dct = {}

for i in range(9):
  dct[i] = 0
  
for i in A:
  if (i >= 1 and i < 400):
    dct[0] += 1
  elif (i >= 400 and i < 800):
    dct[1] += 1
  elif (i >= 800 and i < 1200):
    dct[2] += 1
  elif (i >= 1200 and i < 1600):
    dct[3] += 1    
  elif (i >= 1600 and i < 2000):
    dct[4] += 1    
  elif (i >= 2000 and i < 2400):
    dct[5] += 1    
  elif (i >= 2400 and i < 2800):
    dct[6] += 1    
  elif (i >= 2800 and i < 3200):
    dct[7] += 1    
  else:
    dct[8] += 1  

color1 = 0
color2 = 0
for i in dct.items():  
  if (i[0] == 8):
    color2 = i[1]
  else:
    if (i[1] > 0):
      color1 += 1
ans1 = color1
ans2 = min(8,color1+color2)
if (color1 == 0):
  ans1 = 1
print(ans1,ans2)