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:
import sys
#input = sys.stdin.readline
#sys.setrecursionlimit(10**6)
#from collections import Counter
#from copy import deepcopy
#from itertools import combinations
#from operator import itemgetter
#from copy import deepcopy
#from operator import mul
#from functools import reduce

def main():
    n = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 8
    over3200 = 0
    for ia in a:
        if ia < 3200:
            # print(ia//400)
            colors[ia // 400] = 1
        else:
            over3200 += 1

    if sum(colors) == 0:
        r_min = 1
        r_max = over3200
    else:
        r_min = sum(colors)
        r_max = min(8, sum(colors) + over3200)
    print(r_min, r_max)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

color = ["gray","braun","green","watter","bruee","yellow","orange","red"]

lis = []

count = 0

for i in a:
    if 1 <= i <=399:
        lis.append("gray")
    
    if 400 <= i <= 799:
        lis.append("braun")
    
    if 800 <= i <= 1199:
        lis.append("green")
    
    if 1600 <= i <= 1999:
        lis.append("bruee")

    if 1200 <= i <= 1599:
        lis.append("watter")
    
    if 2000 <= i <= 2399:
        lis.append("yellow")
    
    if 2400 <= i <= 2799:
        lis.append("orange")

    if 2800 <= i <= 3199:
        lis.append("red")
    if 3200 <= i:
        count = count + 1

mincase = len(set(lis))

if len(set(lis)) == 0:
    mincase = 1
else:
    mincase = len(set(lis))

maxcase = min(8,len(set(lis)) + count)

print(mincase , '', maxcase)

Submission status: Wrong Answer

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

color = ["gray","braun","green","watter","bruee","yellow","orange","red"]

lis = []

count = 0

for i in a:
    if 1 <= i <=399:
        lis.append("gray")
    
    if 400 <= i <= 799:
        lis.append("braun")
    
    if 800 <= i <= 1199:
        lis.append("green")
    
    if 1600 <= i <= 1999:
        lis.append("bruee")

    if 1200 <= i <= 1599:
        lis.append("watter")
    
    if 2000 <= i <= 2399:
        lis.append("yellow")
    
    if 2400 <= i <= 2799:
        lis.append("orange")

    if 2800 <= i <= 3199:
        lis.append("red")
    if 3200 <= i:
        count = count + 1

mincase = len(set(lis))
maxcase = min(8,len(set(lis)) + count)

print(mincase , '', maxcase)

Submission status: Wrong Answer

Solution code:
input()
a = list(map(int, input().split()))
counter = [False] * 8
colorfulcounter = 0

for i in a:
    if 1 <= i <= 399:
        counter[0] = True
    elif 400 <= i <= 799:
        counter[1] = True
    elif 800 <= i <= 1199:
        counter[2] = True
    elif 1200 <= i <= 1599:
        counter[3] = True
    elif 1600 <= i <= 1999:
        counter[4] = True
    elif 2000 <= i <= 2399:
        counter[5] = True
    elif 2400 <= i <= 2799:
        counter[6] = True
    elif 2800 <= i <= 3199:
        counter[7] = True
    elif 3200 <= i:
        colorfulcounter += 1

print(max(sum(counter), colorfulcounter), end = " ")
print(sum(counter) + colorfulcounter)

Submission status: Wrong Answer

Solution code:
input()
a = list(map(int, input().split()))
counter = [False] * 8
colorfulcounter = 0

for i in a:
    if 1 <= i <= 399:
        counter[0] = True
    elif 400 <= i <= 799:
        counter[1] = True
    elif 800 <= i <= 1199:
        counter[2] = True
    elif 1200 <= i <= 1599:
        counter[3] = True
    elif 1600 <= i <= 1999:
        counter[4] = True
    elif 2000 <= i <= 2399:
        counter[5] = True
    elif 2400 <= i <= 2799:
        counter[6] = True
    elif 2800 <= i <= 3199:
        counter[7] = True
    elif 3200 <= i:
        colorfulcounter += 1

print(sum(counter), end = " ")
print(sum(counter) + colorfulcounter)

Submission status: Wrong Answer

Solution code:
input()
a = list(map(int, input().split()))
counter = [False] * 8
colorfulcounter = 0

for i in a:
    if 1 <= i <= 399:
        counter[0] = True
    elif 400 <= i <= 799:
        counter[1] = True
    elif 800 <= i <= 1199:
        counter[2] = True
    elif 1200 <= i <= 1599:
        counter[3] = True
    elif 1600 <= i <= 1999:
        counter[4] = True
    elif 2000 <= i <= 2399:
        counter[5] = True
    elif 2400 <= i <= 2799:
        counter[6] = True
    elif 2800 <= i <= 3199:
        counter[7] = True
    elif 3200 <= i:
        colorfulcounter += 1

print(sum(counter), end = " ")
print(min(sum(counter) + colorfulcounter, 8))

Submission status: Wrong Answer

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

b = [val//400 for val in a]
#print(b)
c = set(b)
if b.count(8):
    M=len(c)-1+b.count(8)
    m=len(c)-1
    if m == 0:
        m=1
else:
    M=len(c)
    m=M
print(m, M)

Submission status: Wrong Answer

Solution code:
N = int(input())
a_list = list(map(int, input().split()))
color_dic = {"gray":False, "brown":False, "green":False, "thin_blue":False, "blue":False, "yellow":False, "orange":False, "red":False, "legend":0}
for i in a_list:
    if 1<=i and i<=399:
       color_dic["gray"] = True
    elif 400<=i and i<=799:
        color_dic["brown"] = True
    elif 800<=i and i<=1199:
        color_dic["green"] = True
    elif 1200<=i and i<=1599:
        color_dic["thin_blue"] = True
    elif 1600<=i and i<=1999:
        color_dic["blue"] = True
    elif 2000<=i and i<=2399:
        color_dic["yellow"] = True
    elif 2400<=i and i<=2799:
        color_dic["orange"] = True
    elif 2800<=i and i<=3199:
        color_dic["red"] = True
    else:
        color_dic["legend"] += 1
ans = 0
for k, v in color_dic.items():
    if k!="legend":
        if v==True:
            ans += 1
ans_min = ans
ans += color_dic["legend"]
if ans_min == 0:
    if color_dic["legend"]>=1:
        ans_min = 1
if ans > 8:
    ans = 8
print(ans_min, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a_list = list(map(int, input().split()))
color_dic = {"gray":False, "brown":False, "green":False, "thin_blue":False, "blue":False, "yellow":False, "orange":False, "red":False, "legend":0}
for i in a_list:
    if 1<=i and i<=399:
       color_dic["gray"] = True
    elif 400<=i and i<=799:
        color_dic["brown"] = True
    elif 800<=i and i<=1199:
        color_dic["green"] = True
    elif 1200<=i and i<=1599:
        color_dic["thin_blue"] = True
    elif 1600<=i and i<=1999:
        color_dic["blue"] = True
    elif 2000<=i and i<=2399:
        color_dic["yellow"] = True
    elif 2400<=i and i<=2799:
        color_dic["orange"] = True
    elif 2800<=i and i<=3199:
        color_dic["red"] = True
    else:
        color_dic["legend"] += 1
ans = 0
for k, v in color_dic.items():
    if k!="legend":
        if v==True:
            ans += 1
ans_min = ans
ans += color_dic["legend"]
if ans_min == 0 and color_dic["legend"] >= 1:
    ans_min = 1
if ans > 8:
    ans = 8
print(ans_min, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a_list = list(map(int, input().split()))
color_dic = {"gray":False, "brown":False, "green":False, "thin_blue":False, "blue":False, "yellow":False, "orange":False, "red":False, "legend":0}
for i in a_list:
    if 1<=i and i<=399:
       color_dic["gray"] = True
    elif 400<=i and i<=799:
        color_dic["brown"] = True
    elif 800<=i and i<=1199:
        color_dic["green"] = True
    elif 1200<=i and i<=1599:
        color_dic["thin_blue"] = True
    elif 1600<=i and i<=1999:
        color_dic["blue"] = True
    elif 2000<=i and i<=2399:
        color_dic["yellow"] = True
    elif 2400<=i and i<=2799:
        color_dic["orange"] = True
    elif 2800<=i and i<=3199:
        color_dic["red"] = True
    else:
        color_dic["legend"] += 1
ans = 0
for k, v in color_dic.items():
    if k!="legend":
        if v==True:
            ans += 1
    else:
        ans_min = ans
        ans += v
        if ans_min == 0 and v >= 1:
            ans_min = 1
        if ans > 8:
            ans = 8
print(ans_min, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a_list = list(map(int, input().split()))
color_dic = {"gray":False, "brown":False, "green":False, "thin_blue":False, "blue":False, "yellow":False, "orange":False, "red":False, "legend":0}
for i in a_list:
    if 1<=i and i<=399:
       color_dic["gray"] = True
    elif 400<=i and i<=799:
        color_dic["brown"] = True
    elif 800<=i and i<=1199:
        color_dic["green"] = True
    elif 1200<=i and i<=1599:
        color_dic["thin_blue"] = True
    elif 1600<=i and i<=1999:
        color_dic["blue"] = True
    elif 2000<=i and i<=2399:
        color_dic["yellow"] = True
    elif 2400<=i and i<=2799:
        color_dic["orange"] = True
    elif 2800<=i and i<=3199:
        color_dic["red"] = True
    else:
        color_dic["legend"] += 1
ans = 0
for k, v in color_dic.items():
    if k!="legend":
        if v==True:
            ans += 1
    else:
        ans_min = ans
        ans += v
print(ans_min, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a_list = list(map(int, input().split()))
color_dic = {"gray":False, "brown":False, "green":False, "thin_blue":False, "blue":False, "yellow":False, "orange":False, "red":False, "legend":0}
for i in a_list:
    if 1<=i and i<=399:
       color_dic["gray"] = True
    elif 400<=i and i<=799:
        color_dic["brown"] = True
    elif 800<=i and i<=1199:
        color_dic["green"] = True
    elif 1200<=i and i<=1599:
        color_dic["thin_blue"] = True
    elif 1600<=i and i<=1999:
        color_dic["blue"] = True
    elif 2000<=i and i<=2399:
        color_dic["yellow"] = True
    elif 2400<=i and i<=2799:
        color_dic["orange"] = True
    elif 2800<=i and i<=3199:
        color_dic["red"] = True
    else:
        color_dic["legend"] += 1
ans = 0
print(color_dic)
for k, v in color_dic.items():
    if k!="legend":
        if v==True:
            ans += 1
    else:
        ans_min = ans
        ans += v
print(ans_min, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a_list = list(map(int, input().split()))
color_dic = {"gray":False, "brown":False, "green":False, "thin_blue":False, "blue":False, "yellow":False, "orange":False, "red":False, "legend":0}
for i in a_list:
    if 1<=i and i<=399:
       color_dic["gray"] = True
    elif 400<=i and i<=799:
        color_dic["brown"] = True
    elif 800<=i and i<=1199:
        color_dic["green"] = True
    elif 1200<=i and i<=1599:
        color_dic["thin_blue"] = True
    elif 1600<=i and i<=1999:
        color_dic["blue"] = True
    elif 2000<=i and i<=2399:
        color_dic["yellow"] = True
    elif 2400<=i and i<=2799:
        color_dic["orange"] = True
    elif 2800<=i and i<=3199:
        color_dic["red"] = True
    else:
        color_dic["legend"] += 1
ans = 0
for k, v in color_dic.items():
    if k!="legend":
        if v==True:
            ans += 1
    else:
        ans += v
print(ans-v, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a_list = list(map(int, input().split()))
color_dic = {"gray":False, "brown":False, "green":False, "thin_blue":False, "blue":False, "yellow":False, "orange":False, "red":False, "legend":0}
for i in a_list:
    if 1<=i and i<=399:
       color_dic["gray"] = True
    elif 400<=i and i<=799:
        color_dic["brown"] = True
    elif 800<=i and i<=1199:
        color_dic["green"] = True
    elif 1200<=i and i<=1599:
        color_dic["thin_blue"] = True
    elif 1600<=i and i<=1999:
        color_dic["blue"] = True
    elif 2000<=i and i<=2399:
        color_dic["yellow"] = True
    elif 2400<=i and i<=2799:
        color_dic["orange"] = True
    elif 2800<=i and i<=3199:
        color_dic["red"] = True
    else:
        color_dic["legend"] += 1
ans = 0
for k, v in color_dic.items():
    if k!="legend":
        if v==True:
            ans += 1
    else:
        ans += v
print(ans-v ,ans)

Submission status: Wrong Answer

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

ans = 0
a_1 = 0
a_2 = 0
a_3 = 0
a_4 = 0
a_5 = 0
a_6 = 0
a_7 = 0
a_8 = 0
add = 0
for i in range(n):
    if a[i]  < 400 and a_1 == 0:
        a_1 = 1
        ans +=1
    elif a[i]  < 800 and a[i] >= 400 and a_2 == 0:
        a_2 = 1
        ans +=1
    elif a[i]  < 1200 and a[i] >= 800 and a_3 == 0:
        a_3 = 1
        ans +=1
    elif a[i]  < 1600 and a[i] >= 1200 and a_4 == 0:
        a_4 = 1
        ans +=1
    elif a[i]  < 2000 and a[i] >= 1600 and a_5 == 0:
        a_5 = 1
        ans +=1
    elif a[i]  < 2400 and a[i] >= 2000 and a_6 == 0:
        a_6 = 1
        ans +=1
    elif a[i]  < 2800 and a[i] >= 2400 and a_7 == 0:
        a_7 = 1
        ans +=1
    elif a[i]  < 3200 and a[i] >= 2800 and a_8 == 0:
        a_8 = 1
        ans +=1
    elif a[i] >= 3200:
        add +=1

if ans == 8:
    print('8 8')
elif ans == 0 and add >=8:
    print('1 8')
elif ans == 0:
    print('1 '+str(add))
#elif ans + add >= 8:
#    print(str(ans)+' 8')
else:
    print(str(ans)+' '+str(ans+add))

Submission status: Wrong Answer

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

ans = 0
a_1 = 0
a_2 = 0
a_3 = 0
a_4 = 0
a_5 = 0
a_6 = 0
a_7 = 0
a_8 = 0
add = 0
for i in range(n):
    if a[i]  < 400 and a_1 == 0:
        a_1 = 1
        ans +=1
    elif a[i]  < 800 and a[i] >= 400 and a_2 == 0:
        a_2 = 1
        ans +=1
    elif a[i]  < 1200 and a[i] >= 800 and a_3 == 0:
        a_3 = 1
        ans +=1
    elif a[i]  < 1600 and a[i] >= 1200 and a_4 == 0:
        a_4 = 1
        ans +=1
    elif a[i]  < 2000 and a[i] >= 1600 and a_5 == 0:
        a_5 = 1
        ans +=1
    elif a[i]  < 2400 and a[i] >= 2000 and a_6 == 0:
        a_6 = 1
        ans +=1
    elif a[i]  < 2800 and a[i] >= 2400 and a_7 == 0:
        a_7 = 1
        ans +=1
    elif a[i]  < 3200 and a[i] >= 2800 and a_8 == 0:
        a_8 = 1
        ans +=1
    elif a[i] >= 3200:
        add +=1

if ans == 8:
    print('8 8')
elif ans == 0 and add >=8:
    print('1 8')
elif ans == 0:
    print('1 '+str(add))
elif ans + add >= 8:
    print(str(ans)+' 8')
else:
    print(str(ans)+' '+str(ans+add))

Submission status: Wrong Answer

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

ans = 0
a_1 = 0
a_2 = 0
a_3 = 0
a_4 = 0
a_5 = 0
a_6 = 0
a_7 = 0
a_8 = 0
add = 0
for i in range(n):
    if a[i]  < 400 and a_1 == 0:
        a_1 = 1
        ans +=1
    elif a[i]  < 800 and a[i] >= 400 and a_2 == 0:
        a_2 = 1
        ans +=1
    elif a[i]  < 1200 and a[i] >= 800 and a_3 == 0:
        a_3 = 1
        ans +=1
    elif a[i]  < 1600 and a[i] >= 1200 and a_4 == 0:
        a_4 = 1
        ans +=1
    elif a[i]  < 2000 and a[i] >= 1600 and a_5 == 0:
        a_5 = 1
        ans +=1
    elif a[i]  < 2400 and a[i] >= 2000 and a_6 == 0:
        a_6 = 1
        ans +=1
    elif a[i]  < 2800 and a[i] >= 2400 and a_7 == 0:
        a_7 = 1
        ans +=1
    elif a[i]  < 3200 and a[i] >= 2800 and a_8 == 0:
        a_8 = 1
        ans +=1
    elif a[i] >= 3200:
        add +=1

if ans == 8:
    print('8 8')
elif ans == 0 and add >=8:
    print('1 8')
elif ans == 0:
    print('1 '+str(add))
elif ans + add >= 9:
    print(str(ans)+' 8')
else:
    print(str(ans)+' '+str(ans+add))

Submission status: Wrong Answer

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

ans = 0
a_1 = 0
a_2 = 0
a_3 = 0
a_4 = 0
a_5 = 0
a_6 = 0
a_7 = 0
a_8 = 0
add = 0
for i in range(n):
    if a[i]  < 400 and a_1 == 0:
        a_1 = 1
        ans +=1
    elif a[i]  < 800 and a[i] >= 400 and a_2 == 0:
        a_2 = 1
        ans +=1
    elif a[i]  < 1200 and a[i] >= 800 and a_3 == 0:
        a_3 = 1
        ans +=1
    elif a[i]  < 1600 and a[i] >= 1200 and a_4 == 0:
        a_4 = 1
        ans +=1
    elif a[i]  < 2000 and a[i] >= 1600 and a_5 == 0:
        a_5 = 1
        ans +=1
    elif a[i]  < 2400 and a[i] >= 2000 and a_6 == 0:
        a_6 = 1
        ans +=1
    elif a[i]  < 2800 and a[i] >= 2400 and a_7 == 0:
        a_7 = 1
        ans +=1
    elif a[i]  < 3200 and a[i] >= 2800 and a_8 == 0:
        a_8 = 1
        ans +=1
    elif a[i] >= 3200:
        add +=1
if ans == 0 :
    ans += 1
if ans == 8:
    print('8 8')
elif ans + add >= 8:
    print(str(ans)+' 8')
else:
    print(str(ans)+' '+str(ans+add))

Submission status: Wrong Answer

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

ans = 0
a_1 = 0
a_2 = 0
a_3 = 0
a_4 = 0
a_5 = 0
a_6 = 0
a_7 = 0
a_8 = 0
add = 0
for i in range(n):
    if a[i]  < 400 and a_1 == 0:
        a_1 = 1
        ans +=1
    elif a[i]  < 800 and a[i] >= 400 and a_2 == 0:
        a_2 = 1
        ans +=1
    elif a[i]  < 1200 and a[i] >= 800 and a_3 == 0:
        a_3 = 1
        ans +=1
    elif a[i]  < 1600 and a[i] >= 1200 and a_4 == 0:
        a_4 = 1
        ans +=1
    elif a[i]  < 2000 and a[i] >= 1600 and a_5 == 0:
        a_5 = 1
        ans +=1
    elif a[i]  < 2400 and a[i] >= 2000 and a_6 == 0:
        a_6 = 1
        ans +=1
    elif a[i]  < 2800 and a[i] >= 2400 and a_7 == 0:
        a_7 = 1
        ans +=1
    elif a[i]  < 3200 and a[i] >= 2800 and a_8 == 0:
        a_8 = 1
        ans +=1
    elif a[i] >= 3200:
        add +=1
if ans == 8:
    print('8 8')
elif ans + add >= 8:
    print(str(ans)+' 8')
else:
    print(str(ans)+' '+str(ans+add))

Submission status: Wrong Answer

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

ans = 0
a_1 = 0
a_2 = 0
a_3 = 0
a_4 = 0
a_5 = 0
a_6 = 0
a_7 = 0
a_8 = 0
add = 0
for i in range(n):
    if a[i]  < 400 and a_1 == 0:
        a_1 = 1
        ans +=1
    elif a[i]  < 800 and a[i] >= 400 and a_2 == 0:
        a_2 = 1
        ans +=1
    elif a[i]  < 1200 and a[i] >= 800 and a_3 == 0:
        a_3 = 1
        ans +=1
    elif a[i]  < 1600 and a[i] >= 1200 and a_4 == 0:
        a_4 = 1
        ans +=1
    elif a[i]  < 2000 and a[i] >= 1600 and a_5 == 0:
        a_5 = 1
        ans +=1
    elif a[i]  < 2400 and a[i] >= 2000 and a_6 == 0:
        a_6 = 1
        ans +=1
    elif a[i]  < 2800 and a[i] >= 2400 and a_7 == 0:
        a_7 = 1
        ans +=1
    elif a[i]  < 3200 and a[i] >= 2800 and a_8 == 0:
        a_8 = 1
        ans +=1
    elif a[i] >= 3200:
        add +=1
if ans >= 8:
    print('8 8')
elif ans + add >= 8:
    print(str(ans)+' 8')
else:
    print(str(ans)+' '+str(ans+add))

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

from collections import defaultdict

n = ni()
a = na()
dic = defaultdict(int)

def color(n):
    if n >= 1 and n <= 399:
        return "a"
    if n >= 400 and n <= 799:
        return "b"
    if n >= 800 and n <= 1199:
        return "c"
    if n >= 1200 and n <= 1599:
        return "d"
    if n >= 1600 and n <= 1999:
        return "e"
    if n >= 2000 and n <= 2399:
        return "f"
    if n >= 2400 and n <= 2799:
        return "g"
    if n >= 2800 and n <= 3199:
        return "h"
    return "z"

for i in range(n):
    c = color(a[i])
    if c != "z" and dic[c] >= 1:
        continue
    dic[color(a[i])] += 1

print(sum(dic.values()) - dic["z"], sum(dic.values()))

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

from collections import defaultdict

n = ni()
a = na()
dic = defaultdict(int)

def color(n):
    if n >= 1 and n <= 399:
        return "a"
    if n >= 400 and n <= 799:
        return "b"
    if n >= 800 and n <= 1199:
        return "c"
    if n >= 1200 and n <= 1599:
        return "d"
    if n >= 1600 and n <= 1999:
        return "e"
    if n >= 2000 and n <= 2399:
        return "f"
    if n >= 2400 and n <= 2799:
        return "g"
    if n >= 2800 and n <= 3199:
        return "h"
    return "z"

for i in range(n):
    c = color(a[i])
    if c != "z" and dic[c] >= 1:
        continue
    dic[color(a[i])] += 1

print(sum(dic.values()) - dic["z"], min(8, sum(dic.values())))

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

from collections import defaultdict

n = ni()
a = na()
dic = defaultdict(int)

def color(n):
    if n >= 1 and n <= 399:
        return "a"
    if n >= 400 and n <= 799:
        return "b"
    if n >= 800 and n <= 1199:
        return "c"
    if n >= 1200 and n <= 1599:
        return "d"
    if n >= 1600 and n <= 1999:
        return "e"
    if n >= 2000 and n <= 2399:
        return "f"
    if n >= 2400 and n <= 2799:
        return "g"
    if n >= 2800 and n <= 3199:
        return "h"
    return "z"

for i in range(n):
    dic[color(a[i])] += 1

tourist = 1 if "z" in dic else 0
print(len(dic.keys()) - tourist, min(8, len(dic.keys()) - tourist + dic["z"]))

Submission status: Wrong Answer

Solution code:

def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ls = [False] * 8
    cnt = 0
    for i in A:

        if i<3200:
            ls[i//400]=True
        else:
            cnt += 1


    if ls.count(True)==0:
        if cnt==0:
            minval=0
        else:
            minval=1
    else:
        minval=ls.count(True)
    if ls.count(False) <= cnt:
        maxval = 8
    else:
        maxval = 8 - (ls.count(False) - cnt)

    print(minval, maxval)


resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ls = [False] * 8
    cnt = 0
    for i in A:

        if i<3200:
            ls[i//400]=True
        else:
            cnt += 1

    if ls.count(False) <= cnt:
        maxval = 8
    else:
        maxval = 8 - (ls.count(False) - cnt)

    print(ls.count(True), maxval)


resolve()

Submission status: Wrong Answer

Solution code:

def resolve():
    N=int(input())
    A=list(map(int,input().split()))
    ls=[False]*8
    cnt=0
    for i in A:

        if 1<=i<=399:
            ls[0]=True
        elif 400<=i<=799:
            ls[1]=True
        elif 800<=i<=1199:
            ls[2]=True
        elif 1200<=i<=1599:
            ls[3]=True
        elif 1600<=i<=1999:
            ls[4]=True
        elif 2000<=i<=2399:
            ls[5]=True
        elif 2400<=i<=2799:
            ls[6]=True
        elif 2800<=i<=3199:
            ls[7]=True
        else:
            cnt+=1


    if ls.count(False)<=cnt:
        maxval=8
    else:
        maxval=8-(ls.count(False)-cnt)

    print(ls.count(True), maxval)




resolve()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
colorNum = [0] * 8
color = [399,799,1199,1599,1999,2399,2799,3199]
free, minNum, notUsedColor = 0,0,0
for i in range(n):
  for m in range(8):
    if color[m] >= a[i]:
      colorNum[m] += 1
      break
  if a[i] >= 3200:
    free += 1
for m in range(8):
  if colorNum[m] > 0:
    minNum += 1
  else:
    notUsedColor += 1
maxNum = 0
if notUsedColor - free >= 0:
  maxNum = free
else:
  maxNum = notUsedColor
print(minNum, minNum + maxNum)

Submission status: Wrong Answer

Solution code:
n = input()
d = [0 for _ in range(9)]
seq = [int(x) for x in input().split()]
for val in seq:
    val = min(val, 3300)
    d[(val // 400)] += 1
a = sum(1 for val in d[:-1] if val > 0)
print(max(1,a), min(8,a + d[-1]))

Submission status: Wrong Answer

Solution code:
n = input()
d = [0 for _ in range(9)]
seq = [int(x) for x in input().split()]
for val in seq:
    val = min(val, 3300)
    d[(val // 400)] += 1
a = sum(1 for val in d[:-1] if val > 0)
print(min(1,a), min(8,a + d[-1]))

Submission status: Wrong Answer

Solution code:
n = input()
d = [0 for _ in range(9)]
seq = [int(x) for x in input().split()]
for val in seq:
    val = min(val, 3300)
    d[(val // 400)] += 1
a = sum(1 for val in d[:-1] if val > 0)
print(a, min(8,a + d[-1]))

Submission status: Wrong Answer

Solution code:
N= int(input())
a_li = list(map(int,input().split()))
a_conv = []
for i in a_li:
    if 1 <= i <= 399:
        a_conv.append(1)
    elif 400 <= i <= 799:
        a_conv.append(2)
    elif 800 <= i <= 1199:
        a_conv.append(3)
    elif 1200 <= i <= 1599:
        a_conv.append(4)
    elif 1600 <= i <= 1999:
        a_conv.append(5)
    elif 2000 <= i <= 2399:
        a_conv.append(6)
    elif 2400 <= i <= 2799:
        a_conv.append(7)
    elif 2800 <= i <= 3199:
        a_conv.append(8)
    elif 3200 <= i:
        a_conv.append(9)
free = a_conv.count(9)
ans_min = 0
ans_max = 0
if free == len(a_conv):
    print(1,1)
    exit()
for i in range(1,9):
    if i in a_conv:
        ans_min += 1
ans_max = ans_min + free
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
N= int(input())
a_li = list(map(int,input().split()))
a_conv = []
for i in a_li:
    if 1 <= i <= 399:
        a_conv.append(1)
    elif 400 <= i <= 799:
        a_conv.append(2)
    elif 800 <= i <= 1199:
        a_conv.append(3)
    elif 1200 <= i <= 1599:
        a_conv.append(4)
    elif 1600 <= i <= 1999:
        a_conv.append(5)
    elif 2000 <= i <= 2399:
        a_conv.append(6)
    elif 2400 <= i <= 2799:
        a_conv.append(7)
    elif 2800 <= i <= 3199:
        a_conv.append(8)
    elif 3200 <= i:
        a_conv.append(9)
ans_min = 0
ans_max = 0
for i in range(1,9):
    if i in a_conv:
        ans_min += 1
free = a_conv.count(9)
ans_max = ans_min + free
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
N= int(input())
a_li = list(map(int,input().split()))
colors = {"gray":0,"brown":0,"green":0,"lightblue":0,"blue":0,"yellow":0,"orange":0,"red":0,"free":0}
for i in a_li:
    if 1 <= i <= 399:
        colors["gray"] += 1
    elif 400 <= i <= 799:
        colors["brown"] += 1
    elif 800 <= i <= 1199:
        colors["green"] += 1
    elif 1200 <= i <= 1599:
        colors["lightblue"] += 1
    elif 1600 <= i <= 1999:
        colors["blue"] += 1
    elif 2000 <= i <= 2399:
        colors["yellow"] += 1
    elif 2400 <= i <= 2799:
        colors["orange"] += 1
    elif 2800 <= i <= 3199:
        colors["red"] += 1
    elif 3200 <= i:
        colors["free"] += 1
if sum(list(colors.values())[:-1]) == 0:
    print(1)
    exit()
ans_max = 0
ans_min = 0
for key,num in list(colors.items())[:-1]:
    if num >= 1:
        ans_min += 1
free = colors["free"]
ans_max = ans_min + free
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
N= int(input())
a_li = list(map(int,input().split()))
colors = {"gray":0,"brown":0,"green":0,"lightblue":0,"blue":0,"yellow":0,"orange":0,"red":0,"free":0}
for i in a_li:
    if 1 <= i <= 399:
        colors["gray"] += 1
    elif 400 <= i <= 799:
        colors["brown"] += 1
    elif 800 <= i <= 1199:
        colors["green"] += 1
    elif 1200 <= i <= 1599:
        colors["lightblue"] += 1
    elif 1600 <= i <= 1999:
        colors["blue"] += 1
    elif 2000 <= i <= 2399:
        colors["yellow"] += 1
    elif 2400 <= i <= 2799:
        colors["orange"] += 1
    elif 2800 <= i <= 3199:
        colors["red"] += 1
    elif 3200 <= i:
        colors["free"] += 1
ans_max = 0
ans_min = 0
for key,num in list(colors.items())[:-1]:
    if num >= 1:
        ans_min += 1
free = colors["free"]
ans_max = ans_min + free
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
N= int(input())
a_li = list(map(int,input().split()))
colors = {"gray":0,"brown":0,"green":0,"lightblue":0,"blue":0,"yellow":0,"orange":0,"red":0,"free":0}
for i in a_li:
    if 1 <= i <= 399:
        colors["gray"] += 1
    elif 400 <= i <= 799:
        colors["brown"] += 1
    elif 800 <= i <= 1199:
        colors["green"] += 1
    elif 1200 <= i <= 1599:
        colors["lightblue"] += 1
    elif 1600 <= i <= 1999:
        colors["blue"] += 1
    elif 2000 <= i <= 2399:
        colors["yellow"] += 1
    elif 2400 <= i <= 2799:
        colors["orange"] += 1
    elif 2800 <= i <= 3199:
        colors["red"] += 1
    else:
        colors["free"] += 1
ans_max = 0
ans_min = 0
for key,num in list(colors.items())[:-1]:
    if num >= 1:
        ans_min += 1
free = colors["free"]
ans_max = ans_min + free
print(ans_min,ans_max)