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())
a=list(map(int,input().split()))
l=[0]*9
for i in a:
    if i<400:
        l[0]=1
    elif 400<=i<800:
        l[1]=1
    elif 800<=i<1200:
        l[2]=1
    elif 1200<=i<1600:
        l[3]=1
    elif 1600<=i<2000:
        l[4]=1
    elif 2000<=i<2400:
        l[5]=1
    elif 2400<=i<2800:
        l[6]=1
    elif 2800<=i<3200:
        l[7]=1
    else:
        l[8]+=1

if sum(l)>=8:
    max_=8
else:
    max_=sum(l)
    
if sum(l[:-1])==0:
    min_=1
else:
    min_=sum(l[:-1])
    
print(min_,max_)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[0]*9
for i in a:
    if i<400:
        l[0]=1
    elif 400<=i<800:
        l[1]=1
    elif 800<=i<1200:
        l[2]=1
    elif 1200<=i<1600:
        l[3]=1
    elif 1600<=i<2000:
        l[4]=1
    elif 2000<=i<2400:
        l[5]=1
    elif 2400<=i<2800:
        l[6]=1
    elif 2800<=i<3200:
        l[7]=1
    else:
        l[8]+=1

if sum(l)>=8:
    max_=8
else:
    max_=sum(l)
print(sum(l[:-1]),max_)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[0]*9
for i in a:
    if i<400:
        l[0]=1
    elif 400<=i<800:
        l[1]=1
    elif 800<=i<1200:
        l[2]=1
    elif 1200<=i<1600:
        l[3]=1
    elif 1600<=i<2000:
        l[4]=1
    elif 2000<=i<2400:
        l[5]=1
    elif 2400<=i<2800:
        l[6]=1
    elif 2800<=i<3200:
        l[7]=1
    else:
        l[8]+=1
if sum(l)>=8:
    max_=8
else:
    max_=sum(l)
print(sum(l[:-1]),max_)

Submission status: Wrong Answer

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

Colors = [0 for _ in range(8)]
any_color = 0

for a in A:
    if a <= 399:
        Colors[0] = 1
    elif a <= 799:
        Colors[1] = 1
    elif a <= 1199:
        Colors[2] = 1
    elif a <= 1599:
        Colors[3] = 1
    elif a <= 1999:
        Colors[4] = 1
    elif a <= 2399:
        Colors[5] = 1
    elif a <= 2799:
        Colors[6] = 1
    elif a <= 3199:
        Colors[7] = 1
    else:
        any_color += 1

ans_min = sum(Colors)
ans_max = sum(Colors) + any_color

print(str(ans_min) + ' ' + str(ans_max))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
import collections
N = int(input())
a = [int(x) for x in input().split()]
rate = [0] * 8
flag = 0
for i in a:
    if 1 <= i <= 399:
        rate[0] = 1
    elif 400 <= i <= 799:
        rate[1] = 1
    elif 800 <= i <= 1199:
        rate[2] = 1
    elif 1200 <= i <= 1599:
        rate[3] = 1
    elif 1600 <= i <= 1999:
        rate[4] = 1
    elif 2000 <= i <= 2399:
        rate[5] = 1
    elif 2400 <= i <= 2799:
        rate[6] = 1
    elif 2800 <= i <= 3199:
        rate[7] = 1
    elif 3200 <= i:
        flag += 1
color_count = rate.count(1)
if flag:
    ans = [max(1, color_count),min(color_count + flag, 8)]
    print(* ans)
else:
    ans = [color_count, color_count]
    print(* ans)

Submission status: Wrong Answer

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

color = set()
cnt = 0
for i in a:
  if 1 <= i <= 399:
    color.add("gray")
  elif 400 <= i <= 799:
    color.add("brown")
  elif 800 <= i <= 1199:
    color.add("green")
  elif 1200 <= i <= 1599:
    color.add("water")
  elif 1600 <= i <= 1999:
    color.add("blue")
  elif 2000 <= i <= 2399:
    color.add("yellow")
  elif 2400 <= i <= 2799:
    color.add("orange")
  elif 2800 <= i <= 3199:
    color.add("red")
  else:
    cnt += 1

print("%s %s" %(len(color), len(color) + cnt))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
color = [0] * 9

for i in range(N):
    if A[i] <= 399:
        color[0] += 1
    elif 400 <= A[i] and A[i] <= 799:
        color[1] += 1
    elif 800 <= A[i] and A[i] <= 1199:
        color[2] += 1
    elif 1200 <= A[i] and A[i] <= 1599:
        color[3] += 1
    elif 1600 <= A[i] and A[i] <= 1999:
        color[4] += 1
    elif 2000 <= A[i] and A[i] <= 2399:
        color[5] += 1
    elif 2400 <= A[i] and A[i] <= 2799:
        color[6] += 1
    elif 2800 <= A[i] and A[i] <= 3199:
        color[7] += 1
    else:
        color[8] += 1

num = 0
for i in range(8):
    if color[i] != 0:
        num += 1

ans = [max(1,num), min(num + color[8], 8)]
print(" ".join(str(s) for s in ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
color = [0] * 9

for i in range(N):
    if A[i] <= 399:
        color[0] += 1
    elif 400 <= A[i] and A[i] <= 799:
        color[1] += 1
    elif 800 <= A[i] and A[i] <= 1199:
        color[2] += 1
    elif 1200 <= A[i] and A[i] <= 1599:
        color[3] += 1
    elif 1600 <= A[i] and A[i] <= 1999:
        color[4] += 1
    elif 2000 <= A[i] and A[i] <= 2399:
        color[5] += 1
    elif 2400 <= A[i] and A[i] <= 2799:
        color[6] += 1
    elif 2800 <= A[i] and A[i] <= 3199:
        color[7] += 1
    else:
        color[8] += 1

num = 0
for i in range(8):
    if color[i] != 0:
        num += 1

ans = [num, min(num + color[8], 8)]
print(" ".join(str(s) for s in ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
i = map(int, input().split())
i = list(i)
 
grey = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0
 
minimo = 0
maximo = 0
 
for valor in i:
    if 1 <= valor <= 399:
        if grey == 0:
            minimo += 1
        grey += 1
    elif 400 <= valor <= 799:
        if brown == 0:
            minimo += 1
        brown += 1
    elif 800 <= valor <= 1199:
        if green == 0:
            minimo += 1
        green += 1
    elif 1200 <= valor <= 1599:
        if cyan == 0:
            minimo += 1
        cyan += 1
    elif 1600 <= valor <= 1999:
        if blue == 0:
            minimo += 1
        blue += 1
    elif 2000 <= valor <= 2399:
        if yellow == 0:
            minimo += 1
        yellow += 1
    elif 2400 <= valor <= 2799:
        if orange == 0:
            minimo += 1
        orange += 1
    elif 2800 <= valor <= 3199:
        if red == 0:
            minimo += 1
        red += 1
    else:
        maximo += 1
 
print(minimo, minimo+maximo)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = map(int, input().split())
i = list(i)

grey = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0

minimo = 0
maximo = 0

for valor in i:
    if 1 <= valor <= 399:
        if grey == 0:
            minimo += 1
        grey += 1
    elif 400 <= valor <= 799:
        if brown == 0:
            minimo += 1
        brown += 1
    elif 800 <= valor <= 1199:
        if green == 0:
            minimo += 1
        green += 1
    elif 1200 <= valor <= 1599:
        if cyan == 0:
            minimo += 1
        cyan += 1
    elif 1600 <= valor <= 1999:
        if blue == 0:
            minimo += 1
        blue += 1
    elif 2000 <= valor <= 2399:
        if yellow == 0:
            minimo += 1
        yellow += 1
    elif 2400 <= valor <= 2799:
        if orange == 0:
            minimo += 1
        orange += 1
    elif 2800 <= valor <= 3199:
        if red == 0:
            minimo += 1
        red += 1
    else:
        maximo += 1

    print(minimo, minimo+maximo)

Submission status: Wrong Answer

Solution code:
Nc = input()
N = int(Nc)
c = map(int,input().split())
cor = ''
l = list(c)
l2 = []
maxL = 0
gambiarra = 0

for num in l:
    if 1 <= N <= 100 and 1 <= num <= 4800 and type(num) == int and len(l) == N:
        if  1 <= num <= 399:
            cor = 'cinzento'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 400 <= num <= 799:
            cor = 'a'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 800 <= num <= 1199:
            cor = 'b'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1200 <= num <= 1599:
            cor = 'c'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1600 <= num <= 1999:
            cor = 'd'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2000 <= num <= 2399:
            cor = 'e'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2400 <= num <= 2799:
            cor = 'f'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2800 <= num <= 3199:
            cor = 'g'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 3199 <= num <= 4800:
            maxL = maxL + 1
            if cor not in l2:
                cor = 'escolha'
                l2.append(cor)
            if cor in l2:
                l2.append(cor)
                gambiarra = gambiarra + 1
            
            
           
print((len(l2) - gambiarra), maxL)

Submission status: Wrong Answer

Solution code:
Nc = input()
N = int(Nc)
c = map(int,input().split())
cor = ''
l = list(c)
l2 = []
maxL = 0
gambiarra = 0

for num in l:
    if 1 <= N <= 100 and 1 <= num <= 4800 and type(num) == int and len(l) == N:
        if  1 <= num <= 399:
            cor = 'cinzento'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 400 <= num <= 799:
            cor = 'a'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 800 <= num <= 1199:
            cor = 'b'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1200 <= num <= 1599:
            cor = 'c'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1600 <= num <= 1999:
            cor = 'd'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2000 <= num <= 2399:
            cor = 'e'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2400 <= num <= 2799:
            cor = 'f'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2800 <= num <= 3199:
            cor = 'g'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 3199 <= num <= 4800:
            cor = 'escolha'
            maxL = maxL + 1
            l2.append(cor)            
            if cor in l2:
                gambiarra = gambiarra + 1
        if len(l2) == gambiarra:
            gambiarra = gambiarra - 1
            
           
print((len(l2) - gambiarra), maxL)

Submission status: Wrong Answer

Solution code:
Nc = input()
N = int(Nc)
c = map(int,input().split())
cor = ''
l = list(c)
l2 = []
maxL = 0
gambiarra = 0

for num in l:
    if 1 <= N <= 100 and 1 <= num <= 4800 and type(num) == int and len(l) == N:
        if  1 <= num <= 399:
            cor = 'cinzento'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 400 <= num <= 799:
            cor = 'a'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 800 <= num <= 1199:
            cor = 'b'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1200 <= num <= 1599:
            cor = 'c'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1600 <= num <= 1999:
            cor = 'd'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2000 <= num <= 2399:
            cor = 'e'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2400 <= num <= 2799:
            cor = 'f'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2800 <= num <= 3199:
            cor = 'g'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 3199 <= num <= 4800:
            maxL = maxL + 1 
            if cor not in l2:
                gambiarra = gambiarra + 1
            
           
print((len(l2) - gambiarra), maxL)

Submission status: Wrong Answer

Solution code:
Nc = input()
N = int(Nc)
c = map(int,input().split())
cor = ''
l = list(c)
l2 = []
maxL = 0
gambiarra = 0

for num in l:
    if 1 <= N <= 100 and 1 <= num <= 4800 and type(num) == int:
        if  1 <= num <= 399:
            cor = 'cinzento'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 400 <= num <= 799:
            cor = 'a'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 800 <= num <= 1199:
            cor = 'b'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1200 <= num <= 1599:
            cor = 'c'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1600 <= num <= 1999:
            cor = 'd'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2000 <= num <= 2399:
            cor = 'e'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2400 <= num <= 2799:
            cor = 'f'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2800 <= num <= 3199:
            cor = 'g'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 3199 <= num <= 4800:
            maxL = maxL + 1 
            if cor not in l2:
                gambiarra = gambiarra + 1
            
           
print((len(l2) - gambiarra), maxL)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = map(int, input().split())
i = list(i)

grey = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0

minimo = 0
maximo = 0
coresLivres = 8
 
for valor in i:
    if 1 <= valor <= 399:
        if grey == 0:
            minimo += 1
            coresLivres -= 1
        grey += 1
    elif 400 <= valor <= 799:
        if brown == 0:
            minimo += 1
            coresLivres -= 1
        brown += 1
    elif 800 <= valor <= 1199:
        if green == 0:
            minimo += 1
            coresLivres -= 1
        green += 1
    elif 1200 <= valor <= 1599:
        if cyan == 0:
            minimo += 1
            coresLivres -= 1
        cyan += 1
    elif 1600 <= valor <= 1999:
        if blue == 0:
            minimo += 1
            coresLivres -= 1
        blue += 1
    elif 2000 <= valor <= 2399:
        if yellow == 0:
            minimo += 1
            coresLivres -= 1
        yellow += 1
    elif 2400 <= valor <= 2799:
        if orange == 0:
            minimo += 1
            coresLivres -= 1
        orange += 1
    elif 2800 <= valor <= 3199:
        if red == 0:
            minimo += 1
            coresLivres -= 1
        red += 1
    else:
        maximo += 1
 
if coresLivres == 8 and len(i) <= 8:
    print(1, maximo)
elif coresLivres == 8 and len(i) > 8:
    print(1,8)
elif maximo >= coresLivres:
    print(minimo, minimo+coresLivres)
else:
    print(minimo, minimo+maximo)

Submission status: Wrong Answer

Solution code:
Nc = input()
N = int(Nc)
c = map(int,input().split())
cor = ''
l = list(c)
l2 = []
maxL = 0
gambiarra = 0


for num in l:
    if 1 <= N <= 100 and 1 <= num <= 4800 and type(num) == int:
        if  1 <= num <= 399:
            cor = 'cinzento'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 400 <= num <= 799:
            cor = 'a'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 800 <= num <= 1199:
            cor = 'b'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1200 <= num <= 1599:
            cor = 'c'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1600 <= num <= 1999:
            cor = 'd'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2000 <= num <= 2399:
            cor = 'e'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2400 <= num <= 2799:
            cor = 'f'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2800 <= num <= 3199:
            cor = 'g'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 3199 <= num <= 4800:
            cor = 'h'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
            else:
                maxL = maxL + 1
                gambiarra = gambiarra + 1
            
           
print((len(l2) - gambiarra), maxL)

Submission status: Wrong Answer

Solution code:
Nc = input()
N = int(Nc)
c = map(int,input().split())
cor = ''
l = list(c)
l2 = []
maxL = 0
gambiarra = 0


for num in l:
    if 1 <= N <= 100 and 1 <= num <= 4800 and type(num) == int:
        if  1 <= num <= 399:
            cor = 'cinzento'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 400 <= num <= 799:
            cor = 'a'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 800 <= num <= 1199:
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1200 <= num <= 1599:
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 1600 <= num <= 1999:
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2000 <= num <= 2399:
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2400 <= num <= 2799:
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 2800 <= num <= 3199:
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 3199 <= num <= 4800:
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 3199 <= num <= 4800:
            if cor not in l2:
                maxL = maxL + 1
                gambiarra = gambiarra + 1
            
            
print((len(l2) - gambiarra), maxL)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = map(int, input().split())
i = list(i)

grey = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0

minimo = 0
maximo = 0
coresLivres = 8
 
for valor in i:
    if 1 <= valor <= 399:
        if grey == 0:
            minimo += 1
            coresLivres -= 1
        grey += 1
    elif 400 <= valor <= 799:
        if brown == 0:
            minimo += 1
            coresLivres -= 1
        brown += 1
    elif 800 <= valor <= 1199:
        if green == 0:
            minimo += 1
            coresLivres -= 1
        green += 1
    elif 1200 <= valor <= 1599:
        if cyan == 0:
            minimo += 1
            coresLivres -= 1
        cyan += 1
    elif 1600 <= valor <= 1999:
        if blue == 0:
            minimo += 1
            coresLivres -= 1
        blue += 1
    elif 2000 <= valor <= 2399:
        if yellow == 0:
            minimo += 1
            coresLivres -= 1
        yellow += 1
    elif 2400 <= valor <= 2799:
        if orange == 0:
            minimo += 1
            coresLivres -= 1
        orange += 1
    elif 2800 <= valor <= 3199:
        if red == 0:
            minimo += 1
            coresLivres -= 1
        red += 1
    elif 3200 <= valor <= 4800:
        maximo += 1
    else:
        pass
 
if coresLivres == 8:
    print(1, maximo)
elif maximo >= coresLivres:
    print(minimo, minimo+coresLivres)
else:
    print(minimo, minimo+maximo)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = map(int, input().split())
i = list(i)

grey = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0

minimo = 0
maximo = 0
coresLivres = 8
if 1 <= n <= 100:
    for valor in i:
        if 1 <= valor <= 399:
            if grey == 0:
                minimo += 1
                coresLivres -= 1
            grey += 1
        elif 400 <= valor <= 799:
            if brown == 0:
                minimo += 1
                coresLivres -= 1
            brown += 1
        elif 800 <= valor <= 1199:
            if green == 0:
                minimo += 1
                coresLivres -= 1
            green += 1
        elif 1200 <= valor <= 1599:
            if cyan == 0:
                minimo += 1
                coresLivres -= 1
            cyan += 1
        elif 1600 <= valor <= 1999:
            if blue == 0:
                minimo += 1
                coresLivres -= 1
            blue += 1
        elif 2000 <= valor <= 2399:
            if yellow == 0:
                minimo += 1
                coresLivres -= 1
            yellow += 1
        elif 2400 <= valor <= 2799:
            if orange == 0:
                minimo += 1
                coresLivres -= 1
            orange += 1
        elif 2800 <= valor <= 3199:
            if red == 0:
                minimo += 1
                coresLivres -= 1
            red += 1
        else:
            maximo += 1

if coresLivres == 8:
    print(1, maximo)
elif maximo >= coresLivres:
    print(minimo, minimo+coresLivres)
else:
    print(minimo, minimo+maximo)

Submission status: Wrong Answer

Solution code:
Nc = input()
N = int(Nc)
c = map(int,input().split())
l = list(c)
l2 = []
maxL = 0
gambiarra = 0


for num in l:
    if 1 <= N <= 100 and 1 <= num <= 4800 and type(num) == int:
        if  1 <= num <= 399 and num not in l2:
            l2.append(num)
            maxL = maxL + 1
        elif 400 <= num <= 799 and num not in l2:
            l2.append(num)
            maxL = maxL + 1
        elif 800 <= num <= 1199 and num not in l2:
            l2.append(num)
            maxL = maxL + 1
        elif 1200 <= num <= 1599 and num not in l2:
            l2.append(num)
            maxL = maxL + 1
        elif 1600 <= num <= 1999 and num not in l2:
            l2.append(num)
            maxL = maxL + 1
        elif 2000 <= num <= 2399 and num not in l2:
            l2.append(num)
            maxL = maxL + 1
        elif 2400 <= num <= 2799 and num not in l2:
            l2.append(num)
            maxL = maxL + 1
        elif 2800 <= num <= 3199 and num not in l2:
            l2.append(num)
            maxL = maxL + 1
        elif 3199 <= num <= 4800 and num not in l2:
            l2.append(num)
            maxL = maxL + 1
        elif 3199 <= num <= 4800 and num in l2:
            maxL = maxL + 1
            gambiarra = gambiarra + 1
            
            
print((len(l2) - gambiarra), maxL)

Submission status: Wrong Answer

Solution code:
Nc = input()
N = int(Nc)
cor = ''
c = map(int,input().split())
l = list(c)
l2 = []
maxL = 0


for num in l:
    if 1 <= N <= 100 and 1 <= num <= 4800 and type(num) == int:
        if  1 <= num <= 399 and num not in l2:
            cor = 'cinzento'
            l2.append(num)
            maxL = maxL + 1
        elif 400 <= num <= 799 and num not in l2:
            cor = 'castanho'
            l2.append(num)
            maxL = maxL + 1
        elif 800 <= num <= 1199 and num not in l2:
            cor = 'verde'
            l2.append(num)
            maxL = maxL + 1
        elif 1200 <= num <= 1599 and num not in l2:
            cor = 'ciano'
            l2.append(num)
            maxL = maxL + 1
        elif 1600 <= num <= 1999 and num not in l2:
            cor = 'azul'
            l2.append(num)
            maxL = maxL + 1
        elif 2000 <= num <= 2399 and num not in l2:
            cor = 'amarelo'
            l2.append(num)
            maxL = maxL + 1
        elif 2400 <= num <= 2799 and num not in l2:
            cor = 'laranja'
            l2.append(num)
            maxL = maxL + 1
        elif 2800 <= num <= 3199 and num not in l2:
            cor = 'vermelho'
            l2.append(num)
            maxL = maxL + 1
        elif 3199 <= num <= 4800 and num not in l2:
            maxL = maxL + 1

Submission status: Wrong Answer

Solution code:
n = int(input())
i = map(int, input().split())
i = list(i)
grey = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0
minimo = 0
maximo = 0
coresLivres = 8

for valor in i:
    if 1 <= valor <= 399:
        if grey == 0:
            minimo += 1
            coresLivres -= 1
        grey += 1
    elif 400 <= valor <= 799:
        if brown == 0:
            minimo += 1
            coresLivres -= 1
        brown += 1
    elif 800 <= valor <= 1199:
        if green == 0:
            minimo += 1
            coresLivres -= 1
        green += 1
    elif 1200 <= valor <= 1599:
        if cyan == 0:
            minimo += 1
            coresLivres -= 1
        cyan += 1
    elif 1600 <= valor <= 1999:
        if blue == 0:
            minimo += 1
            coresLivres -= 1
        blue += 1
    elif 2000 <= valor <= 2399:
        if yellow == 0:
            minimo += 1
            coresLivres -= 1
        yellow += 1
    elif 2400 <= valor <= 2799:
        if orange == 0:
            minimo += 1
            coresLivres -= 1
        orange += 1
    elif 2800 <= valor <= 3199:
        if red == 0:
            minimo += 1
            coresLivres -= 1
        red += 1
    else:
        maximo += 1

if coresLivres == 8:
    print(1, maximo)

elif maximo >= coresLivres:
    print(minimo, minimo+coresLivres)
else:
    print(minimo, minimo+maximo)

Submission status: Wrong Answer

Solution code:
n = input()
i = map(int, input().split())
i = list(i)
grey = 0
brown = 0
green = 0
cyan = 0
blue = 0
yellow = 0
orange = 0
red = 0
minimo = 0
maximo = 0
coresLivres = 8

for valor in i:
    if 1 <= valor <= 399:
        if grey == 0:
            minimo += 1
            coresLivres -= 1
        grey += 1
    elif 400 <= valor <= 799:
        if brown == 0:
            minimo += 1
            coresLivres -= 1
        brown += 1
    elif 800 <= valor <= 1199:
        if green == 0:
            minimo += 1
            coresLivres -= 1
        green += 1
    elif 1200 <= valor <= 1599:
        if cyan == 0:
            minimo += 1
            coresLivres -= 1
        cyan += 1
    elif 1600 <= valor <= 1999:
        if blue == 0:
            minimo += 1
            coresLivres -= 1
        blue += 1
    elif 2000 <= valor <= 2399:
        if yellow == 0:
            minimo += 1
            coresLivres -= 1
        yellow += 1
    elif 2400 <= valor <= 2799:
        if orange == 0:
            minimo += 1
            coresLivres -= 1
        orange += 1
    elif 2800 <= valor <= 3199:
        if red == 0:
            minimo += 1
            coresLivres -= 1
        red += 1
    else:
        maximo += 1

if maximo >= coresLivres:
    print(minimo, minimo+coresLivres)
else:
    print(minimo, minimo+maximo)

Submission status: Wrong Answer

Solution code:
Nc = input()
N = int(Nc)
cor = ''
c = map(int,input().split())
l = list(c)
l2 = []
l3 = []
maxL = 0

for num in l:
    if 1 <= N <= 100 and 1 <= num <= 4800 and type(num) == int:
        if  1 <= num <= 399:
            cor = 'cinzento'
            l2.append(cor)
        elif 400 <= num <= 799:
            cor = 'castanho'
            l2.append(cor)
        elif 800 <= num <= 1199:
            cor = 'verde'
            l2.append(cor)
        elif 1200 <= num <= 1599:
            cor = 'ciano'
            l2.append(cor)
        elif 1600 <= num <= 1999:
            cor = 'azul'
            l2.append(cor)
        elif 2000 <= num <= 2399:
            cor = 'amarelo'
            l2.append(cor)
        elif 2400 <= num <= 2799:
            cor = 'laranja'
            l2.append(cor)
        elif 2800 <= num <= 3199:
            cor = 'vermelho'
            l2.append(cor)
        else:
            maxL = maxL+1
          
for color in l2:
    if color not in l3 :
        l3.append(color)
        maxL = maxL+ 1
print(len(l3), maxL)

Submission status: Wrong Answer

Solution code:
def color_check(n):
    if n < 400:
        return "grey"
    elif n < 800:
        return "brown"
    elif n < 1200:
        return "green"
    elif n < 1600:
        return "cyan"
    elif n < 2000:
        return "blue"
    elif n < 2400:
        return "yellow"
    elif n < 2800:
        return "orange"
    elif n < 3200:
        return "red"
    else:
        return "any"

colors_so_far = set()
cany = 0
n = input()
c = map(int, input().split())

for i in c:
    color = color_check(i)
    if color != "any":
        colors_so_far.add(color)
    else:
        cany += 1

print(len(colors_so_far), len(colors_so_far)+cany)

Submission status: Wrong Answer

Solution code:
input()
color = [0] * 8
gold = 0
for a in map(int, input().split()):
  if a >= 3200:
    gold += 1
  else:
    color[a // 400] = 1
print(sum(color), sum(color) + gold)

Submission status: Wrong Answer

Solution code:
li=[0]*8
o=0
n,*a=map(int,open(0).read().split())
for i in a:
  if i>=3200:
    o+=1  
  else:
    li[i//400]=1

#全員3200以上==(sum(li)==0)> 1,min(o,8)
#全員3200未満==(o==0)> sum(li),min(sum(li)+o,8)
#それ以外>sum(li)
if sum(li)==0:
  print(1,min(o,8))
else:
  print(sum(li),min(sum(li)+o,8))