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:
from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))


def main():
    n = input()
    a = readLine_int_list()

    c = []
    _c = [] 
    f = False

    for i in a:
        rank = i//400
        if rank == 8:
           _c.append(rank) 
        else:    
            c.append(rank)
    
    
    p = len(set(c))
    _p = len(_c)
    
    if p == 0:
        p = 1
    
    print(p, p + _p -1)

    
        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))


def main():
    n = input()
    a = readLine_int_list()

    l = []
    f = False

    for i in a:
        rank = i//400
        if rank == 8:
            f = True
        l.append(i//400)
    any_col = l.count(8)
    p = len(set(l))

    if f:
        print(p-1, p+any_col-1)
    else:
        print(p, p)
        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

border = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]

ret = 0
for i in range(len(border) - 1):
    if len(list(filter(lambda n: border[i] <= n < border[i + 1], A))) > 0:
        ret += 1
print(ret, ret + len(list(filter(lambda n: 3200 <= n, A))))

Submission status: Wrong Answer

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

border = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]

ret = 0
for i in range(len(border) - 1):
    if len(list(filter(lambda n: border[i] <= n < border[i + 1], A))) > 0:
        ret += 1
print(ret, ret + len(list(filter(lambda n: 3200 <= n, A))))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
ans = set()
other = 0

for i in a:
    if i <400:
        ans.add("gray")
    elif i <800:
        ans.add("green")
    elif i < 1200:
        ans.add("brown")
    elif i <1600:
        ans.add("light_blue")
    elif i<2000:
        ans.add("blue")
    elif i<2400:
        ans.add("yellow")
    elif i <2800:
        ans.add("orange")
    elif i <3200:
        ans.add("red")
    else:
        other += 1

color = len(ans)
if other == N:
    print(1," ",min(other,8))
else:
    print(color, " " ,min(8,color +other))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
ans = set()
other = 0

for i in a:
    if i <400:
        ans.add("gray")
    elif i <800:
        ans.add("green")
    elif i < 1200:
        ans.add("brown")
    elif i <1600:
        ans.add("light_blue")
    elif i<2000:
        ans.add("blue")
    elif i<2400:
        ans.add("yellow")
    elif i <2800:
        ans.add("orange")
    elif i <3200:
        ans.add("red")
    else:
        other += 1

color = len(ans)
if other + color >=8:
    print(color, " ", 8)
else:
    print(color," ",color+other)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
ans = set()
other = 0

for i in a:
    if i <400:
        ans.add("gray")
    elif i <800:
        ans.add("green")
    elif i < 1200:
        ans.add("brown")
    elif i <1600:
        ans.add("light_blue")
    elif i<2000:
        ans.add("blue")
    elif i<2400:
        ans.add("yellow")
    elif i <2800:
        ans.add("orange")
    elif i <3200:
        ans.add("red")
    else:
        other += 1

color = len(ans)
if other + color >=8:
    print(color, " ", 8)
else:
    print(print(color," ",color+other))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
ans = set()
other = 0

for i in a:
    if i <400:
        ans.add("gray")
    elif i <800:
        ans.add("green")
    elif i < 1200:
        ans.add("brown")
    elif i <1600:
        ans.add("light_blue")
    elif i<2000:
        ans.add("blue")
    elif i<2400:
        ans.add("yellow")
    elif i <2800:
        ans.add("orange")
    elif i <3200:
        ans.add("red")
    else:
        other += 1

color = len(ans)
if other + color >=8:
    other = 8-color

print(color," ",color+other)

Submission status: Wrong Answer

Solution code:
n = input()
a = map(int, raw_input().split())
color = [0 for _ in range(9)]
for item in a:
    i = item / 400
    i = min(i, 8)
    color[i] += 1

ans = 0
for num in color[0:8]:
    if num != 0:
        ans += 1

min_ans = max(ans, 1)
max_ans = ans + color[8]
max_ans = min(max_ans, 8)

print min_ans, max_ans

Submission status: Wrong Answer

Solution code:
n = input()
a = map(int, raw_input().split())
color = [0 for _ in range(9)]
for item in a:
    i = item / 400
    i = min(i, 8)
    color[i] += 1

ans = 0
for num in color[0:8]:
    if num != 0:
        ans += 1

min_ans = max(ans, 1)
max_ans = ans + color[8]
max_ans = min(max_ans, 9)

print min_ans, max_ans

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
http://abc064.contest.atcoder.jp/tasks/abc064_c

"""
import sys
from sys import stdin
from collections import defaultdict
input = stdin.readline


def get_color(s):
    ans = 'any'
    if s < 400:
        ans = 'gray'
    elif s < 800:
        ans = 'brown'
    elif s < 1200:
        ans = 'green'
    elif s < 1600:
        ans = 'light blue'
    elif s < 2000:
        ans = 'blue'
    elif s < 2400:
        ans = 'yellow'
    elif s < 2800:
        ans = 'orange'
    elif s < 3200:
        ans = 'red'
    return ans


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

    colors = defaultdict(int)
    for s in scores:
        res = get_color(s)
        colors[res] += 1

    normal_color = 0
    for k, v in colors.items():
        if k != 'any':
            normal_color += 1
    any_color = colors['any']
    print(normal_color, normal_color + any_color)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
http://abc064.contest.atcoder.jp/tasks/abc064_c

"""
import sys
from sys import stdin
from collections import defaultdict
input = stdin.readline


def get_color(s):
    ans = 'any'
    if s < 400:
        ans = 'gray'
    elif s < 800:
        ans = 'brown'
    elif s < 1200:
        ans = 'green'
    elif s < 1600:
        ans = 'light blue'
    elif s < 2000:
        ans = 'blue'
    elif s < 2400:
        ans = 'yellow'
    elif s < 2800:
        ans = 'orange'
    elif s < 3200:
        ans = 'red'
    return ans


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

    colors = defaultdict(int)
    for s in scores:
        res = get_color(s)
        colors[res] += 1

    normal_color = 0
    for k, v in colors.items():
        if k != 'any':
            normal_color += 1
    any_color = colors['any']
    print(max(normal_color, any_color), normal_color + any_color)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Wrong Answer

Solution code:
b = {}
b['gray'] = 0
b['brown'] = 0
b['green'] = 0
b['cyan'] = 0
b['blue'] = 0
b['yellow'] = 0
b['orange'] = 0
b['red'] = 0
b['other'] = 0

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

for ai in a:
    if ai < 400:
        b['gray'] += 1
    elif ai < 800:
        b['brown'] += 1
    elif ai < 1200:
        b['green'] += 1
    elif ai < 1600:
        b['cyan'] += 1
    elif ai < 2000:
        b['blue'] += 1
    elif ai < 2400:
        b['yellow'] += 1
    elif ai < 2800:
        b['orange'] += 1
    elif ai < 3200:
        b['red'] += 1
    else:
        b['other'] += 1

ans = 0
for k, v in b.items():
    if k != 'other' and v > 0:
        ans += 1

print(ans, ans + b['other'])

Submission status: Wrong Answer

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

rating = [0 for i in range(9)]
for aa in a:
    if aa <= 3199:
        rating[aa // 400] += 1
    else:
        rating[8] += 1

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

ans_max = min(ans_min + rating[8], 8)

ans_min = max(ans_min, 1)

print(ans_min, ans_max)

Submission status: Wrong Answer

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

rating = [0 for i in range(9)]
for aa in a:
    if aa <= 3199:
        rating[aa // 400] += 1
    else:
        rating[8] += 1

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

ans_min = max(ans_min, 1)

ans_max = min(ans_min + rating[8], 8)

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
N = input()
num = 0
while N[num] == ')':
    N = '(' + N
    num += 2
    if num >= n*2:
        break
a = N.count('(')
b = len(N) - a
if (a - b) < 0:
    for i in range(b-a):
        N = '(' + N
elif (a -b) > 0:
    for i in range(a-b):
        N = N + ')'

print(N)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
rank = [0]*9
ans = [0]*2
for i in range(len(a)):
    if a[i] < 400:
        rank[0] = 1
    elif a[i] < 800:
        rank[1] = 1
    elif a[i] < 1200:
        rank[2] = 1
    elif a[i] < 1600:
        rank[3] = 1
    elif a[i] < 2000:
        rank[4] = 1
    elif a[i] < 2400:
        rank[5] = 1
    elif a[i] < 2800:
        rank[6] = 1
    elif a[i] < 3200:
        rank[7] = 1
    else:
        rank[8] += 1
ans[0] = sum(rank)
if 8 < ans[0]:
    ans[0] = 8
if sum(rank[:8]) == 0:
    ans[1] = 1
else:
    ans[1] = sum(rank[:8])

[print(ans[i], end=' ') for i in reversed(range(len(ans)))]

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
rank = [0]*9
ans = [0]*2
for i in range(len(a)):
    if a[i] < 400:
        rank[0] = 1
    elif a[i] < 800:
        rank[1] = 1
    elif a[i] < 1200:
        rank[2] = 1
    elif a[i] < 1600:
        rank[3] = 1
    elif a[i] < 2000:
        rank[4] = 1
    elif a[i] < 2400:
        rank[5] = 1
    elif a[i] < 2800:
        rank[6] = 1
    elif a[i] < 3200:
        rank[7] = 1
    else:
        rank[8] += 1
ans[0] = sum(rank)
if 8 < ans[0]:
    ans[0] = 8
if rank[8] != 0 and (sum(rank[0:8])) == 0:
    ans[1] = 1
else:
    ans[1] = sum(rank[0:8])

[print(ans[i], end=' ') for i in reversed(range(len(ans)))]

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
rank = [0]*9
ans = [0]*2
for i in range(len(a)):
    if a[i] < 400:
        rank[0] = 1
    elif a[i] < 800:
        rank[1] = 1
    elif a[i] < 1200:
        rank[2] = 1
    elif a[i] < 1600:
        rank[3] = 1
    elif a[i] < 2000:
        rank[4] = 1
    elif a[i] < 2400:
        rank[5] = 1
    elif a[i] < 2800:
        rank[6] = 1
    elif a[i] < 3200:
        rank[7] = 1
    else:
        rank[8] += 1
ans[0] = sum(rank)
if 8 < ans[0]:
    ans[0] = 8
if rank[8] != 0 and (sum(rank[0:8])) == 0:
    ans[1] = 1
else:
    ans[1] = sum(rank[0:8])

[print(ans[i], end=' ') for i in range(len(ans))]

Submission status: Wrong Answer

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

b = 0
c = []
for i in range(n):
    if a[i] > 7:
        b += 1
    elif a[i] not in c:
        c.append(a[i])

print(max(1, len(c)), min(8, len(c)+b))

Submission status: Wrong Answer

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

b = 0
for i in range(n):
    a[i] = a[i]//400
    if a[i] > 7:
        b += 1

c = 0
for i in range(8):
    if i in a:
        c += 1

print(max(1, c), min(8, c+b))

Submission status: Wrong Answer

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

for i in range(len(a)):
    a[i] = a[i]//400

c = 0
for i in range(8):
    if i in a:
        c += 1

x = a.count(8)

print(max(1, c), min(8, c+x))

Submission status: Wrong Answer

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

sep = 400
flag = [False]*8
c = 0
for a in A:
    s = a//sep
    if s >= 8:
        c += 1
    else:
        flag[s] = True

min = flag.count(True)
max = min + c

print("{0} {1}".format(min,max))

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[int(x) for x in input().split()]


r=[]
r.append([i for i in a_n if 1<=i<=399])
r.append([i for i in a_n if 400<=i<=799])
r.append([i for i in a_n if 800<=i<=1199])
r.append([i for i in a_n if 1200<=i<=1599])
r.append([i for i in a_n if 1600<=i<=1999])
r.append([i for i in a_n if 2000<=i<=2399])
r.append([i for i in a_n if 2400<=i<=2799])
r.append([i for i in a_n if 2800<=i<=3199])
R=[i for i in a_n if 3200<=i]

count=0
for i in range(len(r)):
    if r[i]:
        count+=1
if count==0:
    count+=1

print(str(count), str(count+len(R)))

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[int(x) for x in input().split()]


r=[]
r.append([i for i in a_n if 1<=i<=399])
r.append([i for i in a_n if 400<=i<=799])
r.append([i for i in a_n if 800<=i<=1199])
r.append([i for i in a_n if 1200<=i<=1599])
r.append([i for i in a_n if 1600<=i<=1999])
r.append([i for i in a_n if 2000<=i<=2399])
r.append([i for i in a_n if 2400<=i<=2799])
r.append([i for i in a_n if 2800<=i<=3199])
R=[i for i in a_n if 3200<=i]

count=0
for i in range(len(r)):
    if r[i]:
        count+=1

print(str(count), str(count+len(R)))

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[int(x) for x in input().split()]


r=[]
r.append([i for i in a_n if 1<=i<=399])
r.append([i for i in a_n if 400<=i<=799])
r.append([i for i in a_n if 800<=i<=1199])
r.append([i for i in a_n if 1200<=i<=1599])
r.append([i for i in a_n if 1600<=i<=1999])
r.append([i for i in a_n if 2000<=i<=2399])
r.append([i for i in a_n if 2400<=i<=2799])
r.append([i for i in a_n if 2800<=i<=3199])
R=[i for i in a_n if 3200<=i]

count=0
for i in range(len(r)):
    if r[i]:
        count+=1

print(str(count)+' '+str(count+len(R)))

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[int(x) for x in input().split()]


r=[]
r.append([i for i in a_n if 1<=i<=400])
r.append([i for i in a_n if 400<=i<=799])
r.append([i for i in a_n if 800<=i<=1199])
r.append([i for i in a_n if 1200<=i<=1599])
r.append([i for i in a_n if 1600<=i<=1999])
r.append([i for i in a_n if 2000<=i<=2399])
r.append([i for i in a_n if 2400<=i<=2799])
r.append([i for i in a_n if 2800<=i<=3199])
R=[i for i in a_n if 3200<=i]

count=0
for i in range(len(r)):
    if r[i]:
        count+=1

print(str(count)+' '+str(count+len(R)))

Submission status: Wrong Answer

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

color_list = []
anycolor = 0
for rate in a:
    if(rate >= 3200):
        anycolor+=1
        continue
    color = rate // 400
    if(color not in color_list):
        color_list.append(color)

minc = len(color_list)
maxc = len(color_list) + anycolor

print(minc, maxc)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
num = [0] * 9
for i in range(N):
    if 1 <= a[i] <= 399:
        num[0] = 1
    elif 400 <= a[i] <= 799:
        num[1] = 1
    elif 800 <= a[i] <= 1199:
        num[2] = 1
    elif 1200 <= a[i] <= 1599:
        num[3] = 1
    elif 1600 <= a[i] <= 1999:
        num[4] = 1
    elif 2000 <= a[i] <= 2399:
        num[5] = 1
    elif 2400 <= a[i] <= 2799:
        num[6] = 1
    elif 2800 <= a[i] <= 3199:
        num[7] = 1
    else:
        num[8] = num[8] + 1

if num[8] == 0:
    maximum = sum(num[0:8])
    minimum = sum(num[0:8])
else:
    if num[8] == N:
        maximum = 1
        minimum = 1
    else:
        minimum = sum(num[0:8])
        if sum(num[0:8]) + num[8] <= 8:
            maximum = sum(num[0:8]) + num[8]
        else:
            maximum = 8

print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
num = [0] * 9
for i in range(N):
    if 1 <= a[i] <= 399:
        num[0] = 1
    elif 400 <= a[i] <= 799:
        num[1] = 1
    elif 800 <= a[i] <= 1199:
        num[2] = 1
    elif 1200 <= a[i] <= 1599:
        num[3] = 1
    elif 1600 <= a[i] <= 1999:
        num[4] = 1
    elif 2000 <= a[i] <= 2399:
        num[5] = 1
    elif 2400 <= a[i] <= 2799:
        num[6] = 1
    elif 2800 <= a[i] <= 3199:
        num[7] = 1
    else:
        num[8] = num[8] + 1

if num[8] == 0:
    maximum = sum(num[0:8])
    minimum = sum(num[0:8])
else:
    if num[8] == N:
        minimum = 1
    else:
        minimum = sum(num[0:8])

if sum(num[0:8]) + num[8] < 8:
    maximum = sum(num[0:8]) + num[8]
else:
    maximum = 8

print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
n = int(input())
lst0 = list(map(int, input().split()))
lst1 = [0, 0, 0, 0, 0, 0, 0, 0]
god = 0
Mx, Mn = (0, 0)
for i in range(n):
    if 1 <= lst0[i] <= 399:
        lst1[0] += 1
    elif 400 <= lst0[i] <= 799:
        lst1[1] += 1
    elif 800 <= lst0[i] <= 1199:
        lst1[2] += 1
    elif 1200 <= lst0[i] <= 1599:
        lst1[3] += 1
    elif 1600 <= lst0[i] <= 1999:
        lst1[4] += 1
    elif 2000 <= lst0[i] <= 2399:
        lst1[5] += 1
    elif 2400 <= lst0[i] <= 2799:
        lst1[6] += 1
    elif 2800 <= lst0[i] <= 3199:
        lst1[7] += 1
    else:
        god += 1

Mn = 8 - lst1.count(0)
Mx = Mn + god
if Mn==0:
    Mn = 1
if Mx>8:
    Mx = 8
print(str(Mn) + " " + str(Mx))

Submission status: Wrong Answer

Solution code:
n = int(input())
lst0 = list(map(int, input().split()))
lst1 = [0, 0, 0, 0, 0, 0, 0, 0]
god = 0
Mx, Mn = (0, 0)
for i in range(n):
    if 1 <= lst0[i] <= 399:
        lst1[0] += 1
    elif 400 <= lst0[i] <= 799:
        lst1[1] += 1
    elif 800 <= lst0[i] <= 1199:
        lst1[2] += 1
    elif 1200 <= lst0[i] <= 1599:
        lst1[3] += 1
    elif 1600 <= lst0[i] <= 1999:
        lst1[4] += 1
    elif 2000 <= lst0[i] <= 2399:
        lst1[5] += 1
    elif 2400 <= lst0[i] <= 2799:
        lst1[6] += 1
    elif 2800 <= lst0[i] <= 3199:
        lst1[7] += 1
    else:
        god += 1

Mn = 8 - lst1.count(0)
if Mn==0:
    Mn = 1
Mx = Mn + god
if Mx>8:
    Mx = 8
print(str(Mn) + " " + str(Mx))

Submission status: Wrong Answer

Solution code:
n = int(input())
lst0 = list(map(int, input().split()))
lst1 = [0, 0, 0, 0, 0, 0, 0, 0]
god = 0
Mx, Mn = (0, 0)
for i in range(n):
    if 1 <= lst0[i] <= 399:
        lst1[0] += 1
    elif 400 <= lst0[i] <= 799:
        lst1[1] += 1
    elif 800 <= lst0[i] <= 1199:
        lst1[2] += 1
    elif 1200 <= lst0[i] <= 1599:
        lst1[3] += 1
    elif 1600 <= lst0[i] <= 1999:
        lst1[4] += 1
    elif 2000 <= lst0[i] <= 2399:
        lst1[5] += 1
    elif 2400 <= lst0[i] <= 2799:
        lst1[6] += 1
    elif 2800 <= lst0[i] <= 3199:
        lst1[7] += 1
    else:
        god += 1

Mn = 8 - lst1.count(0)
Mx = Mn + god
if Mx>8:
    Mx = 8
print(str(Mn) + " " + str(Mx))

Submission status: Wrong Answer

Solution code:
import collections

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

cnt = collections.defaultdict(lambda: 0)
for i in range(N):
    if a[i] < 399:
        cnt['gray'] += 1
    elif a[i] < 799:
        cnt['brown'] += 1
    elif a[i] < 1199:
        cnt['green'] += 1
    elif a[i] < 1599:
        cnt['sky'] += 1
    elif a[i] < 1999:
        cnt['blue'] +=1
    elif a[i] < 2399:
        cnt['yellow'] += 1
    elif a[i] < 2799:
        cnt['orange'] +=1
    elif a[i] < 3199:
        cnt['red'] += 1
    else:
        cnt['any'] += 1

key = cnt.keys()
if 'any' in key:
    color_type = len(key) - 1
else:
    color_type = len(key)
    
color_sum = 0

for each in key:
    if each != 'any':
        color_sum += cnt[each]
        
any_sum = N - color_sum

if any_sum != 0:
    max_type = any_sum + color_type
else:
    max_type = color_type
    
if color_type == 0:
    min_type = 1
else:
    min_type = color_type

print(min_type, max_type)

Submission status: Wrong Answer

Solution code:
import collections

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

cnt = collections.defaultdict(lambda: 0)
for i in range(N):
    if a[i] < 399:
        cnt['gray'] += 1
    elif a[i] < 799:
        cnt['brown'] += 1
    elif a[i] < 1199:
        cnt['green'] += 1
    elif a[i] < 1599:
        cnt['sky'] += 1
    elif a[i] < 1999:
        cnt['blue'] +=1
    elif a[i] < 2399:
        cnt['yellow'] += 1
    elif a[i] < 2799:
        cnt['orange'] +=1
    elif a[i] < 3199:
        cnt['red'] += 1
    else:
        cnt['any'] += 1

key = cnt.keys()
if 'any' in key:
    color_type = len(key) - 1
else:
    color_type = len(key)
    
color_sum = 0

for each in key:
    if each != 'any':
        color_sum += cnt[each]
        
any_sum = N - color_sum

if color_type == 8:
    print(8,8)
else:
    if any_sum == 0:
        print(color_type, color_type)
    else:
        print(color_type, min(8, max(N, color_type + any_sum)))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from collections import deque

n = int(sys.stdin.readline())
ai = list(map(int, sys.stdin.readline().split()))

o = [0] * 9

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

on = 0
for i in range(0, 8):
	if o[i] > 0:
		on += 1

min = on
if min == 0:
	min = 1

on += o[8]
if on > 8:
	on = 8

max = on

print(str(min) + ' ' + str(max))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from collections import deque

n = int(sys.stdin.readline())
ai = list(map(int, sys.stdin.readline().split()))

o = [0] * 9

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

on = 0
for i in range(0, 8):
	if o[i] > 0:
		on += 1

min = on
if on < o[8]:
	min = o[8]

on += o[8]
if on > 8:
	on = 8

max = on

print(str(min) + ' ' + str(max))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from collections import deque

n = int(sys.stdin.readline())
ai = list(map(int, sys.stdin.readline().split()))

o = [0] * 9

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

on = 0
for i in range(0, 8):
	if o[i] > 0:
		on += 1

min = on

on += o[8]
if on > 8:
	on = 8

max = on

print(str(min) + ' ' + str(max))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from collections import deque

n = int(sys.stdin.readline())
ai = list(map(int, sys.stdin.readline().split()))

o = [0] * 9

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

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

min = on

on += o[8]
if on > 8:
	on = 8

max = on

print(str(min) + ' ' + str(max))

Submission status: Wrong Answer

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

print(sum(other),sum(other)+red)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=[int(i) for i in input().split()]
b,c,d,e,f,g,h,j,k=0,0,0,0,0,0,0,0,0
for i in range(N):
 if (a[i]<400):
  b=1
 elif (400<=a[i]<800):
  c=1
 elif (800<=a[i]<1200):
  d=1
 elif (1200<=a[i]<1600):
  e=1
 elif (1600<=a[i]<2000):
  f=1
 elif (2000<=a[i]<2400):
  g=1
 elif (2400<=a[i]<2800):
  h=1
 elif (2800<=a[i]<3200):
  j=1
 else:
  k=1
print (b+c+d+e+f+g+h+j,b+c+d+e+f+g+h+j+k)

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
a=map(int,raw_input().split())
#color=[hai,cha,midori,mizu,ao,ki,daidai,aka]
c=[0 for i in xrange(8)]
ext=0
for x in a:
 if 1<=x<=399:
  c[0]+=1
 elif 400<=x<=799:
  c[1]+=1
 elif 800<=x<=1199:
  c[2]+=1
 elif 1200<=x<=1599:
  c[3]+=1
 elif 1600<=x<=1999:
  c[4]+=1
 elif 2000<=x<=2399:
  c[5]+=1
 elif 2400<=x<=2799:
  c[6]+=1
 elif 2800<=x<=3199:
  c[7]+=1
 else:
  ext+=1
res1=max(1,len(c)-c.count(0))
res2=res1+ext
print res1,res2

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
a=map(int,raw_input().split())
#color=[hai,cha,midori,mizu,ao,ki,daidai,aka]
c=[0 for i in xrange(8)]
ext=0
for x in a:
 if 1<=x<=399:
  c[0]+=1
 elif 400<=x<=799:
  c[1]+=1
 elif 800<=x<=1199:
  c[2]+=1
 elif 1200<=x<=1599:
  c[3]+=1
 elif 1600<=x<=1999:
  c[4]+=1
 elif 2000<=x<=2399:
  c[5]+=1
 elif 2400<=x<=2799:
  c[6]+=1
 elif 2800<=x<=3199:
  c[7]+=1
 else:
  ext+=1
res1=len(c)-c.count(0)
res2=res1+ext
print res1,res2

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
a=map(int,raw_input().split())
#color=[hai,cha,midori,mizu,ao,ki,daidai,aka]
c=[0 for i in xrange(8)]
ext=0
for x in a:
 if 1<=x<=399:
  c[0]+=1
 elif 400<=x<=799:
  c[1]+=1
 elif 800<=x<=1199:
  c[2]+=1
 elif 1200<=x<=1599:
  c[3]+=1
 elif 1600<=x<=1999:
  c[4]+=1
 elif 2000<=x<=2399:
  c[5]+=1
 elif 2400<=x<=2799:
  c[6]+=1
 elif 2800<=x<=3199:
  c[7]+=1
 else:
  ext+=1
res1=len(c)-c.count(0)
res2=min(res1+ext,len(c))
print res1,res2

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
a=map(int,raw_input().split())
#color=[hai,cha,midori,mizu,ao,ki,daidai,aka]
c=[0 for i in xrange(8)]
ext=0
for x in a:
 if 1<=x<=399:
  c[0]+=1
 elif 400<=x<=799:
  c[1]+=1
 elif 800<=x<=1199:
  c[2]+=1
 elif 1200<=x<=1599:
  c[3]+=1
 elif 1600<=x<=1999:
  c[4]+=1
 elif 2000<=x<=2399:
  c[5]+=1
 elif 2400<=x<=2799:
  c[6]+=1
 elif 2800<=x<=3199:
  c[7]+=1
 else:
  ext+=1
print c
res1=len(c)-c.count(0)
res2=min(res1+ext,len(c))
print res1,res2

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
def main():
	N = int(input())
	scores = list(map(int, input().split()))
	ranges_colored = set([x // 400 for x in scores if x <= 3199])
	n_colored = len(ranges_colored)
	n_free = len([x for x in scores if x >= 3200])
	print(max(n_colored, 1), min(n_free + n_colored, 8))
	
if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
def main():
	N = int(input())
	scores = list(map(int, input().split()))
	ranges_colored = set([x // 400 for x in scores if x <= 3199])
	n_colored = len(ranges_colored)
	n_free = len([x for x in scores if x >= 3200])
	print(n_colored, min(n_free + n_colored, 8))
	
if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict


def main():
    N = int(input())
    a_list = list(map(int, input().split()))
    color_set = set()
    free = 0
    for a in a_list:
        for i, (s, e) in enumerate([(1, 399), (400, 799), (800, 1199), (1200, 1599), (1600, 1999), (2000, 2399), (2400, 2799), (2800, 3199)]):
            if s <= a <= e:
                color_set.add(i)
                break
        else:
            free += 1
    print(max(1, len(color_set)), min(8, len(color_set) + free))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
hai,cha,mid,miz,ao,ki,dai,aka,zen = 0,0,0,0,0,0,0,0,0
for i in range(N):
    if a[i] < 400:
        hai = 1
    elif a[i] < 800:
        cha = 1
    elif a[i] < 1200:
        mid = 1
    elif a[i] < 1600:
        miz = 1
    elif a[i] < 2000:
        ao = 1
    elif a[i] < 2400:
        ki = 1
    elif a[i] < 2800:
        dai = 1
    elif a[i] < 3200:
        aka = 1
    else:
        zen += 1
Min = hai+cha+mid+miz+ao+ki+dai+aka
Max = Min+zen
if Max > 8:
    Max = 8
if Min == 0:
    Min = 1
print(Min,Max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
hai,cha,mid,miz,ao,ki,dai,aka,zen = 0,0,0,0,0,0,0,0,0
for i in range(N):
    if a[i] < 400:
        hai = 1
    elif a[i] < 800:
        cha = 1
    elif a[i] < 1200:
        mid = 1
    elif a[i] < 1600:
        miz = 1
    elif a[i] < 2000:
        ao = 1
    elif a[i] < 2400:
        ki = 1
    elif a[i] < 2800:
        dai = 1
    elif a[i] < 3200:
        aka = 1
    else:
        zen += 1
Min = hai+cha+mid+miz+ao+ki+dai+aka
Max = Min+zen
if Max > 8:
    Max = 8
if Min+Max == 0:
    Min = 1
print(Min,Max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
hai,cha,mid,miz,ao,ki,dai,aka,zen = 0,0,0,0,0,0,0,0,0
for i in range(N):
    if a[i] < 400:
        hai = 1
    elif a[i] < 800:
        cha = 1
    elif a[i] < 1200:
        mid = 1
    elif a[i] < 1600:
        miz = 1
    elif a[i] < 2000:
        ao = 1
    elif a[i] < 2400:
        ki = 1
    elif a[i] < 2800:
        dai = 1
    elif a[i] < 3200:
        aka = 1
    else:
        zen += 1
Min = hai+cha+mid+miz+ao+ki+dai+aka
Max = Min+zen
if Max > 8:
    Max = 82
if Min+Max == 0:
    Min = 1
print(Min,Max)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
hai,cha,mid,miz,ao,ki,dai,aka,zen = 0,0,0,0,0,0,0,0,0
for i in range(N):
    if a[i] < 400:
        hai = 1
    elif a[i] < 800:
        cha = 1
    elif a[i] < 1200:
        mid = 1
    elif a[i] < 1600:
        miz = 1
    elif a[i] < 2000:
        ao = 1
    elif a[i] < 2400:
        ki = 1
    elif a[i] < 2800:
        dai = 1
    elif a[i] < 3200:
        aka = 1
    else:
        zen += 1
Min = hai+cha+mid+miz+ao+ki+dai+aka
Max = Min+zen
if Max > 8:
    Max = 82
print(Min,Max)