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()))
A.sort()
dict = [0 for _ in range(8)]
B = []
for a in A:
    if 3200 <= a:
        B.append(a)
        continue
    for i in range(8):
        if i*400 <= a and a < (i+1)*400:
            dict[i]+=1
            break
ds = 8-dict.count(0)
maxNum = ds
minNum = ds
if len(B) > 0:
    maxNum += len(B)
print(minNum,maxNum)

Submission status: Wrong Answer

Solution code:

n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400
    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]
    
if ans == 0:
    print(1, min(dp[-1], 8))
else:    
    print(min(ans, 8), min(sum(dp), 8))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400
    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]

if ans == 0:
    ans += 1
    dp[-1] -= 1
print(min(ans, 8), min(ans + dp[-1], 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400
    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]
if ans == 0:
    ans += 1
    dp[-1] = 0
print(min(ans, 8), min(ans + dp[-1], 8))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400
    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]

print(min(ans, 8), min(ans + dp[-1], 8))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400
    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]

print(min(ans, 8), max(ans, min(ans + dp[-1], 8)))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400

    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]

print(str(min(ans, 8)) + " " + str(max(ans, min(ans + dp[-1], 8))))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400
    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]

print(str(min(ans, 8)) + " " + str(max(ans, min(ans + dp[-1], 8))))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400
    
    print(s)
    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]

print(str(min(ans, 8)) + " " + str(max(ans, min(ans + dp[-1], 8))))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400
    
    print(s)
    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]

print(min(ans, 8), max(ans, min(ans + dp[-1], 8)))

Submission status: Wrong Answer

Solution code:
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

N = intinp()
a = mapint_inp()

def get_color(x):
    c = None
    if 399 >= x: c = "Gray"
    elif 799 >= x: c = "Blown"
    elif 1199 >= x: c = "Green"
    elif 1599 >= x: c = "Sky"
    elif 1999 >= x: c = "Blue"
    elif 2399 >= x: c = "Yellow"
    elif 2799 >= x: c = "Orange"
    elif 3199 >= x: c = "red"
    else:
        c = "Any"
    return c

color_set = set()
any_num = 0

for a_i in a:
    c_i = get_color(a_i)
    if c_i == "Any":
        any_num += 1
        continue
    if c_i not in color_set:
        color_set.add(c_i)

color_num = len(color_set)
rest_color = 8 - color_num
if rest_color <= 0:
    print(color_num, color_num)
else:
    if any_num <= 0:
        print(color_num, color_num)
    else:
        if rest_color <= any_num:
            print(color_num, color_num+rest_color)
        else:
            print(color_num, color_num+any_num)

Submission status: Wrong Answer

Solution code:
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

N = intinp()
a = mapint_inp()

def get_color(x):
    c = None
    if 399 >= x: c = "Gray"
    elif 799 >= x: c = "Blown"
    elif 1199 >= x: c = "Green"
    elif 1599 >= x: c = "Sky"
    elif 1999 >= x: c = "Blue"
    elif 2399 >= x: c = "Yellow"
    elif 2799 >= x: c = "Orange"
    elif 3199 >= x: c = "red"
    else:
        c = "Any"
    return c

color_set = set()
any_num = 0

for a_i in a:
    c_i = get_color(a_i)
    if c_i == "Any":
        any_num += 1
        continue
    if c_i not in color_set:
        color_set.add(c_i)

base_num = len(color_set)

if any_num == 0:
    print(base_num, base_num)
else:
    rest_color = 8 - base_num
    if rest_color <=  0:
        print(base_num, base_num)
    elif rest_color >= any_num:
        print(base_num, base_num+any_num)
    else:
        print(base_num, base_num+rest_color)

Submission status: Wrong Answer

Solution code:
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

N = intinp()
a = mapint_inp()

def get_color(x):
    c = None
    if 399 >= x: c = "Gray"
    elif 799 >= x: c = "Blown"
    elif 1199 >= x: c = "Green"
    elif 1599 >= x: c = "Sky"
    elif 1999 >= x: c = "Blue"
    elif 2399 >= x: c = "Yellow"
    elif 2799 >= x: c = "Orange"
    elif 3199 >= x: c = "red"
    else:
        c = "Any"
    return c

color_set = set()
any_num = 0

for a_i in a:
    c_i = get_color(a_i)
    if c_i == "Any":
        any_num += 1
        continue
    if c_i not in color_set:
        color_set.add(c_i)

base_num = len(color_set)

if any_num == 0:
    print(base_num, base_num)
else:
    rest_color = 8 - base_num
    if rest_color <  0:
        print(base_num, base_num)
    elif rest_color >= any_num:
        print(base_num, base_num+any_num)
    else:
        print(base_num, base_num+rest_color)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
f1 = f2 = 0
for k in c.keys():
    if k >= 8:
        f1 += 1
        f2 += c[k]
if f1 == 0:
    min_ = max_ = len(c.keys())

else:
    min_ = len(c.keys()) -f1
    max_ = len(c.keys()) -f1 +f2
if max_ >8:
    max_ = 8
if min_ <1:
    min_ = 1
print(min_, max_)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
f1 = f2 = 0
for k in c.keys():
    if k >= 8:
        f1 += 1
        f2 += c[k]
if f1 == 0:
    min_ = max_ = len(c.keys())

else:
    min_ = len(c.keys()) -f1
    max_ = len(c.keys()) -f1 +f2
if max_ >8:
    max_ = 8
if min_ <0:
    min_ = 1
print(min_, max_)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
f1 = f2 = 0
for k in c.keys():
    if k >= 8:
        f1 += 1
        f2 += c[k]
if f1 == 0:
    min_ = max_ = len(c.keys())

else:
    min_ = len(c.keys()) -f1
    max_ = len(c.keys()) -f1 +f2
if max_ >8:
    max_ = 8
print(min_, max_)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
f1 = f2 = 0
for k in c.keys():
    if k >= 8:
        f1 += 1
        f2 += c[k]
if f1 == 0:
    min_ = max_ = len(c.keys())

else:
    min_ = len(c.keys()) -f1
    max_ = len(c.keys()) -f1 +f2
if max_ >8:
    max_ = 8
print(min_, ' ', max_)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
f = 0
for k in c.keys():
    if k >= 8:
        f = 1
if f == 0:
    print(len(c.keys()), ' ', len(c.keys()))
else:
    if len(c.keys()) == 1:
        print(1, ' ', c[8])
    else:
        if len(c.keys()) -1 + c[8] <= 8:
            print(len(c.keys()) -1, ' ', len(c.keys()) -1 + c[8])
        else:
            print(len(c.keys()) -1, ' ', 8)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
if not 8 in c.keys():
    print(len(c.keys()), ' ', len(c.keys()))
else:
    if len(c.keys()) == 1:
        print(1, ' ', c[8])
    else:
        if len(c.keys()) -1 + c[8] <= 8:
            print(len(c.keys()) -1, ' ', len(c.keys()) -1 + c[8])
        else:
            print(len(c.keys()) -1, ' ', 8)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
if not 8 in c.keys():
    print(len(c.keys()), ' ', len(c.keys()))
else:
    if len(c.keys()) == 1:
        print(1, ' ', c[8])
    else:
        print(len(c.keys()) -1, ' ', len(c.keys()) -1 + c[8])

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
if not 8 in c.keys():
    print(len(c.keys()), ' ', len(c.keys()))
else:
    print(len(c.keys()) -1, ' ', len(c.keys()) -1 + c[8])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int,input().split())
s = set()
g = 0
c = 0
for ai in a:
    x = ai//400
    if x<8:
        c+=1
        s.add(x)
    else:
        g+=1
if g>=7:
    g-=7
    ma=len(s)+g
else:
    ma=len(s)+g
if c>=1:
    mi=len(s)
else:
    mi=1
print(mi,ma)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int,input().split())
s = set()
g = 0
for ai in a:
    x = ai//400
    if x<8:
        s.add(x)
    else:
        g+=1
if g>=7:
    g-=7
    print(len(s),len(s)+g)
else:
    print(len(s),len(s)+g)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int,input().split())
s = set()
g = 0
for ai in a:
    x = ai//400
    if x<8:
        s.add(x)
    else:
        g+=1
print(len(s),len(s)+g)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int,input().split())
a = [8 if i>=3200 else i//400 for i in a]
g = sum([i>=8 for i in a])
l = len(set(a))
if g:
    print(l-1,l-1+g)
else:
    print(l,l)

Submission status: Wrong Answer

Solution code:
def resolve():
    import collections
    N = int(input())
    A = list(map(int, input().split()))
    d = collections.OrderedDict([
        (400, 0),
        (800, 0),
        (1200, 0),
        (1600, 0),
        (2000, 0),
        (2400, 0),
        (2800, 0),
        (3200, 0)
    ])
    other = 0
    for a in A:
        for th in d:
            if a < th:
                d[th] += 1
                break
        else:
            other += 1
    mincolor = 0
    for th in d:
        if d[th] > 0:
            mincolor += 1
    maxcolor = mincolor+other if other != N else 1
    print("{} {}".format(mincolor, maxcolor))
    

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    import collections
    N = int(input())
    A = list(map(int, input().split()))
    d = collections.OrderedDict([
        (400, 0),
        (800, 0),
        (1200, 0),
        (1600, 0),
        (2000, 0),
        (2400, 0),
        (2800, 0),
        (3200, 0)
    ])
    other = 0
    for a in A:
        for th in d:
            if a < th:
                d[th] += 1
                break
        else:
            other += 1
    mincolor = 0
    for th in d:
        if d[th] > 0:
            mincolor += 1
    maxcolor = mincolor+other
    print("{} {}".format(mincolor, maxcolor))
    

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    import collections
    N = int(input())
    A = list(map(int, input().split()))
    d = collections.OrderedDict([
        (400, 0),
        (800, 0),
        (1200, 0),
        (1600, 0),
        (2000, 0),
        (2400, 0),
        (2800, 0),
        (3200, 0),
        ("other", 0)
    ])
    for a in A:
        for th in d:
            if th != "other" and a < th:
                d[th] += 1
                break
        else:
            d["other"] += 1
    mincolor = 0
    for th in d:
        if th == "other":
            continue
        if d[th] > 0:
            mincolor += 1
    maxcolor = mincolor+d["other"]
    print("{} {}".format(mincolor, maxcolor))
    

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    d = {
        400: 0,
        800: 0,
        1200: 0,
        1600: 0,
        2000: 0,
        2400: 0,
        2800: 0,
        3200: 0,
        -1: 0
    }
    for a in A:
        for th in d:
            if a < th:
                d[th] += 1
                break
        else:
            d[-1] += 1
    mincolor = 0
    for th in d:
        if th == -1:
            continue
        if d[th] > 0:
            mincolor += 1
    maxcolor = mincolor+d[-1]
    print("{} {}".format(mincolor, maxcolor))
    

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    d = {
        400: 0,
        800: 0,
        1200: 0,
        1600: 0,
        2000: 0,
        2400: 0,
        2800: 0,
        3200: 0,
        -1: 0
    }
    for a in A:
        for th in d:
            if a < th:
                d[th] += 1
                break
        else:
            d[-1] += 1
    mincolor = 0
    for th in d:
        if th == -1:
            continue
        if d[th] > 0:
            mincolor += 1
    maxcolor = mincolor+d[-1]
    print(mincolor, maxcolor)
    

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    d = {
        400: 0,
        800: 0,
        1200: 0,
        1600: 0,
        2000: 0,
        2400: 0,
        2800: 0,
        3200: 0,
        -1: 0
    }
    for a in A:
        for th in d:
            if a < th:
                d[th] += 1
                break
        else:
            d[-1] += 1
    mincolor = 0
    for th in d:
        if th == -1:
            continue
        if d[th] > 0:
            mincolor += 1
    maxcolor = min(8, mincolor+d[-1])
    print(mincolor, maxcolor)
    

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

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

rainbow=0
rate=[]

for i in A:
    if (i>=3200):
        rainbow+=1
    else:
        rate.append(i//400)
#print(rate)
cnt=len(set(rate))
print(cnt,cnt+rainbow)

Submission status: Wrong Answer

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

rainbow=0
rate=[]

for i in A:
    if (i>=3200):
        rainbow+=1
    else:
        rate.append(i//400)
#print(rate)
cnt=len(set(rate))
print(cnt,min(cnt+rainbow,8))

Submission status: Wrong Answer

Solution code:
def main():
    from collections import Counter

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

    a = map(lambda x: min(8, x // 400), a)

    ctr = Counter(a)

    len_ = len(ctr.keys())
    free = ctr[8]
    if free:
        ma = len_ - 1 + free
        mi = len_ - 1
        ans = mi, ma
    else:
        ans = len_, len_
    print(*ans)


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

Submission status: Wrong Answer

Solution code:
def main():
    from collections import Counter

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

    a = map(lambda x: x // 400, a)

    ctr = Counter(a)

    len_ = len(ctr.keys())
    free = ctr[8]
    if free:
        ma = len_ - 1 + free
        mi = len_ - 1
        ans = mi, ma
    else:
        ans = len_, len_
    print(*ans)


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=[]
C=[]
for i in A:
    if i<=399:
        B.append(1)
    elif i<=799:
        B.append(2)
    elif i<=1199:
        B.append(3)
    elif i<=1599:
        B.append(4)
    elif i<=1999:
        B.append(5)
    elif i<=2399:
        B.append(6)
    elif i<=2799:
        B.append(7)
    elif i<=3199:
        B.append(8)
    else:
        C.append(1)

D=set(B)
minans=len(D)
if C:
    if len(C)+minans<=8:
        maxans=len(C)+minans
    else:
        maxans=8
else:
    maxans=minans
    
print(max(minans,1), maxans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=[]
C=[]
for i in A:
    if i<=399:
        B.append(1)
    elif i<=799:
        B.append(2)
    elif i<=1199:
        B.append(3)
    elif i<=1599:
        B.append(4)
    elif i<=1999:
        B.append(5)
    elif i<=2399:
        B.append(6)
    elif i<=2799:
        B.append(7)
    elif i<=3199:
        B.append(8)
    else:
        C.append(1)

D=set(B)
minans=len(D)
if C:
    if len(C)+minans<=8:
        maxans=len(C)+minans
    else:
        maxans=8
else:
    maxans=minans
    
print(minans, maxans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int, input().split()))
master=False
if max(A)>=3200:
  master=True
  
def judge(n):
  return n//400

rate=[0]*8
masters=0
for a in A:
  if judge(a)<8:
    rate[judge(a)]+=1
  else:
    masters+=1
  
count=0
for r in rate:
  if r!=0:
    count+=1
if master:
  MAX=min(count+masters, 8)
else:
  MAX=count

print(max(1,count),MAX)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int, input().split()))
master=False
if max(A)>=3200:
  master=True
  
def judge(n):
  return n//400

rate=[0]*8
masters=0
for a in A:
  if judge(a)<8:
    rate[judge(a)]+=1
  else:
    masters+=1
  
count=0
for r in rate:
  if r!=0:
    count+=1
if master:
  MAX=min(count+masters, 8)
else:
  MAX=count

print(count,MAX)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int, input().split()))
master=False
if max(A)>=3200:
  master=True
  
def judge(n):
  return n//400

rate=[0]*8
for a in A:
  if judge(a)<8:
    rate[judge(a)]+=1
  
count=0
for r in rate:
  if r!=0:
    count+=1
if master:
  MAX=min(count+1, 8)
else:
  MAX=count

print(count,MAX)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int, input().split()))
if max(A)>=3200:
  print(8)
  exit()
  
def judge(n):
  return n//400

rate=[0]*8
for a in A:
  rate[judge(a)]+=1
  
count=0
for r in rate:
  if r!=0:
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())

gray=0
brown=0
green=0
water=0
blue=0
yellow=0
orange=0
red=0
overred=0

for i in a:
  if 1<=i<400:
    gray=1
  elif 400<=i<800:
    brown=1
  elif 800<=i<1200:
    green=1
  elif 1200<=i<1600:
    water=1
  elif 1600<=i<2000:
    blue=1
  elif 2000<=i<2400:
    yellow=1
  elif 2400<=i<2800:
    orange=1
  elif 2800<=i<3200:
    red=1
  else:
    overred+=1
    
ans=gray+brown+green+water+blue+yellow+orange+red

print(ans,ans+overred)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
color = []
super = 0
for b in a:
    if b >= 3200:
        super += 1
    else:
        color.append(sum([b > int(x) for x in [399, 799, 1199, 1599, 1999, 2399, 2799]]))
min_color = len(set(color))
print(min_color, min(min_color + super, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
l = []
red = 0
for i in a:
    if i<400:
        l.append("hai")
    elif i<800:
        l.append("tya")
    elif i<1200:
        l.append("midori")
    elif i<1600:
        l.append("mizu")
    elif i<2000:
        l.append("ao")
    elif i<2400:
        l.append("ki")
    elif i<2800:
        l.append("dai")
    elif i<3200:
        l.append("aka")
    else:
        red+=1
        l.append("aka")
x = len(set(l))
print(x,x+red)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
l = []
red = 0
for i in a:
    if i<400:
        if not "hai" in l:
            l.append("hai")
    elif i<800:
        if not "tya" in l:
            l.append("tya")
    elif i<1200:
        if not "midori" in l:
            l.append("midori")
    elif i<1600:
        if not "mizu" in l:
            l.append("mizu")
    elif i<2000:
        if not "ao" in l:
            l.append("ao")
    elif i<2400:
        if not "ki" in l:
            l.append("ki")
    elif i<2800:
        if not "dai" in l:
            l.append("dai")
    elif i<3200:
        if not "aka" in l:
            l.append("aka")
    else:
        red+=1
        if not "aka" in l:
            l.append("aka")
x = len(l)
print(x,x+red)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline

def atc(atc):
    result=["1","2","3","4","5","6","7","8","9","9","9","9","9","9","9","9","9"][atc//400]
    return result
num=0
L1=[]
n=int(input())
L=list(map(int,input().split()))
for i in L:
    a=atc(i)
    if a=="9":
        num+=1
    else:L1.append(a)
b=len(set(L1))
c=b+num
print(b,c)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline

def atc(atc):
    result=["1","2","3","4","5","6","7","8","9","9","9","9","9","9","9","9","9"][atc//400]
    return result
num=0
L1=[]
n=int(input())
L=list(map(int,input().split()))
for i in L:
    a=atc(i)
    if a=="9":
        num+=1
    else:L1.append(a)
b=len(set(L1))
c=b+num
if c>9:
    c=9
else:c
print(b,c)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline

def atc(atc):
    result=["1","2","3","4","5","6","7","8","9","9","9","9","9","9","9","9","9"][atc//400]
    return result
num=0
L1=[]
n=int(input())
L=list(map(int,input().split()))
for i in L:
    a=atc(i)
    if a=="9":
        num+=1
    else:L1.append(a)
b=len(set(L1))
print(b,b+num)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
l = []
red = 0
for i in a:
    if i<400:
        if not "hai" in l:
            l.append("hai")
    elif i<800:
        if not "tya" in l:
            l.append("tya")
    elif i<1200:
        if not "midori" in l:
            l.append("midori")
    elif i<1600:
        if not "mizu" in l:
            l.append("mizu")
    elif i<2000:
        if not "ao" in l:
            l.append("ao")
    elif i<2400:
        if not "ki" in l:
            l.append("ki")
    elif i<2800:
        if not "dai" in l:
            l.append("dai")
    elif i>=2800:
        if i>=3200:
            red+=1
        if not "aka" in l:
            l.append("aka")
x = len(l)
print(x,x+red)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
l = []
red = 0
for i in a:
    if i<400:
        if not "hai" in l:
            l.append("hai")
    elif i<800:
        if not "tya" in l:
            l.append("tya")
    elif i<1200:
        if not "midori" in l:
            l.append("midori")
    elif i<1600:
        if not "mizu" in l:
            l.append("mizu")
    elif i<2000:
        if not "ao" in l:
            l.append("ao")
    elif i<2400:
        if not "ki" in l:
            l.append("ki")
    elif i<2800:
        if not "dai" in l:
            l.append("dai")
    elif i>2800:
        red+=1
        if not "aka" in l:
            l.append("aka")
x = len(l)
print(x,x+red)

Submission status: Wrong Answer

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

l = [0]*9
mn = 0
for i in A:
    t = min(i // 400, 8)
    l[t] += 1
for i in range(8):
    if l[i] != 0:
        mn+=1
if mn==0:
    mn = 1

print(mn, mn+l[8])

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
import sys
input = sys.stdin.readline


def main():
    n = int(input())
    A = list(map(int, input().split()))
    color = defaultdict(int)
    god = 0
    for i in A:
        if i < 400:
            color['gray'] = 1
        elif i < 800:
            color['brown'] = 1
        elif i < 1200:
            color['green'] = 1
        elif i < 1600:
            color['light_blue'] = 1
        elif i < 2000:
            color['blue'] = 1
        elif i < 2400:
            color['yellow'] = 1
        elif i < 2800:
            color['orange'] = 1
        elif i < 3200:
            color['red'] = 1
        else:
            god += 1
    print(min(1, len(color)), len(color) + god)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
import sys
input = sys.stdin.readline


def main():
    n = int(input())
    A = list(map(int, input().split()))
    color = defaultdict(int)
    god = 0
    for i in A:
        if i < 400:
            color['gray'] = 1
        elif i < 800:
            color['brown'] = 1
        elif i < 1200:
            color['green'] = 1
        elif i < 1600:
            color['light_blue'] = 1
        elif i < 2000:
            color['blue'] = 1
        elif i < 2400:
            color['yellow'] = 1
        elif i < 2800:
            color['orange'] = 1
        elif i < 3200:
            color['red'] = 1
        else:
            god += 1
    print(len(color), len(color) + god)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))

d = defaultdict(int)
strong = 0

for a in A:
    if a >= 3200:
        strong += 1
        continue
    d[a // 400] += 1

Cmin = len(d)
Cmax = len(d) + strong
print(Cmin, Cmax)

Submission status: Wrong Answer

Solution code:
N=int(input())
m=list(map(int,input().split()))
ans=0
rainbow=0
table=[0,0,0,0,0,0,0,0]
for i in m:
  if i>3199:
    rainbow+=1
  else:
    if table[i//400]==0:
      ans=ans+1
      table[i//400]=1
print(table)
print(max(1,sum(table)),sum(table)+rainbow)

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()
ans = 0
yowa = 0
tuyo = 0
dic = defaultdict(int)
d = [0] * 8
for a in A:
    if a < 3200:
        if 1 <= a <= 399:
            d[0] = 1
        elif 400 <= a <= 799:
            d[1] = 1
        elif 800 <= a <= 1199:
            d[2] = 1
        elif 1200 <= a <= 1599:
            d[3] = 1
        elif 1600 <= a <= 1999:
            d[4] = 1
        elif 2000 <= a <= 2399:
            d[5] = 1
        elif 2400 <= a <= 2799:
            d[6] = 1
        elif 2800 <= a <= 3199:
            d[7] = 1
    else:
        tuyo += 1

al = sum(d)

if tuyo >= 1:
    if al >= 1:
        mi = al
    else:
        mi = 1
else:
    mi = al
ma = 0
if tuyo >= 1:
    zero_num = 7 - al
    if tuyo >= zero_num:
        ma = 7
    else:
        zero_nokori = (zero_num - tuyo)
        ma = 7- zero_nokori

else:
    ma = al

print(mi, ma)
exit()
if tuyo == 0:
    mi = al
elif tuyo >= 1:
    if al >= 1:
        mi = al
    else:
        mi = 1
# no zero in d
zero = 7 - al    

mx = min(7, 7-(zero-tuyo))
print(mi, mx)

Submission status: Wrong Answer

Solution code:
N=int(input())
m=list(map(int,input().split()))
ans=0
rainbow=0
table=[0,0,0,0,0,0,0,0]
for i in m:
  if i>3199:
    rainbow+=1
  else:
    if table[i//400]==0:
      ans=ans+1
      table[i//400]=1
print(table)
print(max(1,sum(table)),sum(table)+rainbow)