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()))
C0 = [min(8,a//400) for a in A]
C1 = [c for c in C0 if c!=8]
C2 = [c for c in C0 if c==8]
print(len(set(C1)),min(7,len(set(C1))+len(C2)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
reet = [(1,399),(400,799),(800,1199),(1200,1599),
        (1600,1999),(2000,2399),(2400,2799),(2800,3199)]
n = int(input())
alist = list(map(int, input().split()))
 
dorei = []
osama = 0
for a in alist:
    osamaflag = True
    for i in range(len(reet)):
       	bottom, top = reet[i]
        if (bottom <= a < top):
            dorei.append(i)
            osamaflag = False
            break
    if osamaflag:
        osama += 1

min_ = len(set(dorei))
if min_ == 0:
    min_ = 1
max_ = len(set(dorei)) + osama
print(min_, max_)

Submission status: Wrong Answer

Solution code:
reet = [(1,399),(400,799),(800,1199),(1200,1599),
        (1600,1999),(2000,2399),(2400,2799),(2800,3199)]
n = int(input())
alist = list(map(int, input().split()))
 
dorei = []
osama = 0
for a in alist:
    for i in range(len(reet)):
        osamaflag = True
       	bottom , top = reet[i]
        if (bottom <= a < top):
            dorei.append(i)
            osamaflag = False
            break
    if osamaflag:
        osama += 1

min_ = len(set(dorei))
max_ = len(set(dorei)) + osama
print(min_, max_)

Submission status: Wrong Answer

Solution code:
reet = [1,399,400,799,800,1199,1200,1599,1600,1999,2000,2399,2400,2799,2800,3199]
n = int(input())
alist = list(map(int, input().split()))

dorei = []
osama = []
for a in alist:
    for i in range(len(reet)-1):
        osamaflag = True
        if (reet[i] <= a < reet[i+1]):
            dorei.append(i)
            osamaflag = False
            break
    if osamaflag:
        osama.append(50)

max_ = len(set(dorei))
while len(osama) != 0:
    max_ += 1
    osama.pop()

min_ = len(set(dorei))
print(min_, max_)

Submission status: Wrong Answer

Solution code:
reet = [1,399,400,799,800,1199,1200,1599,1600,1999,2000,2399,2400,2799,2800,3199]
n = int(input())
alist = list(map(int, input().split()))

dorei = []
osama = []
for a in alist:
    for i in range(len(reet)-1):
        osamaflag = True
        if (reet[i] <= a < reet[i+1]):
            dorei.append(i)
            osamaflag = False
            break
    if osamaflag:
        osama.append(50)

max_ = len(set(dorei))
while (max_ < 8) and (len(osama) != 0):
    max_ += 1
    osama.pop()

min_ = len(set(dorei))
print(min_, max_)

Submission status: Wrong Answer

Solution code:
from collections import Counter as C
n=int(input())
A=sorted(C(list(map(lambda x:min(x//400,8),list(map(int,input().split()))))+[8]).most_common())
print(len(A)+A[-1][1]-2)
print(len(A)-1 if A[0][0]!=8 else 1,len(A)+A[-1][1]-2)

Submission status: Wrong Answer

Solution code:
from collections import Counter as C
n=int(input())
A=sorted(C(list(map(lambda x:min(x//400,8),list(map(int,input().split()))))+[8]).most_common())
print(len(A)-1 if A[0][0]!=8 else 1,min(8,len(A)+A[-1][1]-2))

Submission status: Wrong Answer

Solution code:
from collections import Counter as C
n=int(input())
A=sorted(C(list(map(lambda x:x//400,list(map(int,input().split()))))+[8]).most_common())
print(len(A)-1 if A[0][0]!=8 else 1,min(8,len(A)+A[-1][1]-2))

Submission status: Wrong Answer

Solution code:
from collections import Counter as C
n=int(input())
A=sorted(C(list(map(lambda x:x//400,list(map(int,input().split()))))+[8]).most_common())
print(len(A)-1,min(8,len(A)+A[-1][1]-2))

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = [0] * 9
for a in [int(x) for x in input().split()]:
  rate[min(a, 3200) // 400] += 1

ret = 0
for r in rate[:-1]:
  if r:
    ret += 1

print(min(ret, 1), ret + rate[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = [0] * 9
for a in [int(x) for x in input().split()]:
  rate[min(a, 3200) // 400] += 1

ret = 0
for r in rate[:-1]:
  if r:
    ret += 1

print(ret, ret + rate[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
rate = [0] * 9
for a in [int(x) for x in input().split()]:
  rate[(a // 400) % 8] += 1

ret = 0
for r in rate[:-1]:
  if r:
    ret += 1

print(ret, ret + rate[-1])

Submission status: Wrong Answer

Solution code:
N,*A=map(int,open(0).read().split());l=[0]*9
for a in A:l[min(8,a//400)]+=1
m=sum([0<l[i]for i in range(8)]);print(min(m,1),m+l[8])

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
d = {}
for i in range(n):
  if 1<=l[i]<=399:
    a = 0
  elif 400<=l[i]<=799:
    a = 1
  elif 800<=l[i]<=1199:
    a = 2
  elif 1200<=l[i]<=1599:
    a = 3
  elif 1600<=l[i]<=1999:
    a = 4
  elif 2000<=l[i]<=2399:
    a = 5
  elif 2400<=l[i]<=2799:
    a = 6
  elif 2800<=l[i]<=3199:
    a = 7
  else:
    a = 8
  if a in d:
    d[a] += 1
  else:
    d[a] = 1
if not(8 in d):
  d[8] = 0
#print(d)
print(len(d.keys())-1, len(d.keys())-1+d[8])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
flg = [0 for _ in range(9)]

for i in range(N):
	tmp = A[i] // 400
	if tmp >= 9:
		tmp = 8
	flg[tmp] += 1

if flg[8] == 0:
	n = 9-flg.count(0)
	print(n, end = " ")
	print(n)
else:
	n = max(1,8-flg.count(0))
	print(n, end = " ")
	print(n+flg[8])

Submission status: Wrong Answer

Solution code:
def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    over3200 = len([ai for ai in a if ai >= 3200])
    c = set([ai // 400 for ai in a if ai < 3200])
    print(max(1, len(c)), min(len(c) + over3200, 8))


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
flg = [0 for _ in range(9)]

for i in range(N):
	tmp = A[i] // 400
	if tmp >= 9:
		tmp = 8
	flg[tmp] += 1

if flg[8] == 0:
	n = 9-flg.count(0)
	print(n, end = " ")
	print(n)
else:
	n = 8-flg.count(0)
	print(n, end = " ")
	print(n+flg[8])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
flg = [0 for _ in range(9)]

for i in range(N):
	tmp = A[i] // 400
	if tmp >= 9:
		tmp = 8
	flg[tmp] += 1

if flg[8] == 0:
	n = 9-flg.count(0)
	print(n, end = " ")
	print(n)
else:
	n = 8-flg.count(0)
	print(n, end = " ")
	print(min(n+flg[8], 8))

Submission status: Wrong Answer

Solution code:
def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    over3200 = len([ai for ai in a if ai >= 3200])
    c = set([ai // 400 for ai in a if ai < 3200])
    print(len(c), min(len(c) + over3200, 8))


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


n = I()
L = LI()
cnt = 0
s = set()
for i in L:
    if i >= 3200:
        cnt += 1
    else:
        s.add(i // 400)


print(max(1, len(s)), min(len(s) + cnt, 8))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


n = I()
L = LI()
cnt = 0
s = set()
for i in L:
    if i >= 3200:
        cnt += 1
    else:
        s.add(i // 400)


print(len(s), min(len(s) + cnt, 8))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


n = I()
L = LI()
cnt = 0
s = set()
for i in L:
    if i >= 3200:
        cnt += 1
    else:
        s.add(i // 400)


print(min(len(s) + cnt, 8), len(s))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
c = []
s = 0
for i in range(N):
  c.append(min(a[i]//400, 8))
import collections
colors = collections.Counter(c)
for i in range(8):
  if colors.get(i, 0) != 0:
    s += 1
ss = colors.get(i, 0)

print(max(s, 1), s+ss)

Submission status: Wrong Answer

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

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

    rank = [400*(i+1) for i in range(8)] + [10000]
    count = [0] * len(rank)

    for i in range(N):
        for j in range(len(rank)):
            if a[i] < rank[j]:
                count[j] += 1
                break
    ans = 0
    for i in range(len(count)- 1):
        if count[i] > 0:
            ans += 1
    print(ans, ans+count[-1])


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
gray=0
brown=0
green=0
light=0
blue=0
yellow=0
orange=0
red=0
god=0
for a in A:
  if 1<=a and a<=399 and gray==0:
    gray=1
  elif 400<=a and a<=799 and brown==0:
    brown=1
  elif 800<=a and a<=1199 and green==0:
    green=1
  elif 1200<=a and a<=1599 and light==0:
    light=1
  elif 1600<=a and a<=1999 and blue==0:
    blue=1
  elif 2000<=a and a<=2399 and yellow==0:
    yellow=1
  elif 2400<=a and a<=2799 and orange==0:
    orange=1
  elif 2800<=a and a<=3199 and red==0:
    red=1
  elif a>=3200:
    god+=1
mi=max(1,gray+brown+green+light+blue+yellow+orange+red)
ma=mi+god
print(mi,ma)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
gray=0
brown=0
green=0
light=0
blue=0
yellow=0
orange=0
red=0
god=0
for a in A:
  if 1<=a and a<=399 and gray==0:
    gray=1
  elif 400<=a and a<=799 and brown==0:
    brown=1
  elif 800<=a and a<=1199 and green==0:
    green=1
  elif 1200<=a and a<=1599 and light==0:
    light=1
  elif 1600<=a and a<=1999 and blue==0:
    blue=1
  elif 2000<=a and a<=2399 and yellow==0:
    yellow=1
  elif 2400<=a and a<=2799 and orange==0:
    orange=1
  elif 2800<=a and a<=3199 and red==0:
    red=1
  elif a>=3200:
    god+=1
mi=gray+brown+green+light+blue+yellow+orange+red
ma=mi+god
print(mi,ma)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
gray=0
brown=0
green=0
light=0
blue=0
yellow=0
orange=0
red=0
god=0
for a in A:
  if 1<=a and a<=399 and gray==0:
    gray=1
  elif 400<=a and a<=799 and brown==0:
    brown=1
  elif 800<=a and a<=1199 and green==0:
    green=1
  elif 1200<=a and a<=1599 and light==0:
    light=1
  elif 1600<=a and a<=1999 and blue==0:
    blue=1
  elif 2000<=a and a<=2399 and yellow==0:
    yellow=1
  elif 2400<=a and a<=2799 and orange==0:
    orange=1
  elif 2800<=a and a<=3199 and red==0:
    red=1
  elif a<=3200:
    god+=1
mi=gray+brown+green+light+blue+yellow+orange+red
ma=mi+god
print(mi,ma)

Submission status: Wrong Answer

Solution code:
aList = [0] * 8
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    if a[i] >= 2800:
        aList[7] += 1
    else:
        aList[a[i]//400] += 1
aMin = 8 - aList.count(0)
aMax = aMin

if aList[7] > 1:
    aMax = 8
    if aList.count(0) > aList[7]:
        aMax = 7 - aList.count(0) + aList[7]
print(aMin, aMax)

Submission status: Wrong Answer

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

cnt_list =[0]*9

cnt_sum=0
num_min=0
num_max=0


for i in a:
    j=int(i/400)
    if j>=8:j=8
    if j!=8:cnt_list[j]=1
    else:cnt_list[j]+=1

      
cnt_sum = sum(cnt_list)-cnt_list[8]
if cnt_list[8]>0:
    if cnt_sum==0:
        num_min=1
    else:num_min=cnt_sum
      
    if (len(cnt_list)-1-cnt_sum)> cnt_list[8]:num_max=cnt_sum+cnt_list[8]
    else:num_max=8
else:
    num_min=cnt_sum
    num_max=cnt_sum

print(num_min, num_max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
dic={}
check8=0
for i in a:
    check=i//400
    if check not in dic and check <8:
        dic[check]=1
    if check>=8:
        check8+=1

mi=max(1,len(dic))
ma=min(8,len(dic)+check8)
print(mi,ma)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
dic={}
check8=0
for i in a:
    check=i//400
    if check not in dic and check <8:
        dic[check]=1
    if check>=8:
        check8+=1

mi=len(dic)
ma=min(8,len(dic)+check8)
print(mi,ma)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
color = {}
f = 0
for a in A:
    if 1 <= a <= 399:
        color['g'] = 1
    elif 400 <= a <= 799:
        color['br'] = 1
    elif 800 <= a <= 1199:
        color['gr'] = 1
    elif 1200 <= a <= 1599:
        color['m'] = 1
    elif 1600 <= a <= 1999:
        color['b'] = 1
    elif 2000 <= a <= 2399:
        color['y'] = 1
    elif 2400 <= a <= 2799:
        color['o'] = 1
    elif 2800 <= a <= 3199:
        color['r'] = 1
    else:
        f += 1
print(max(1, len(color)), min(8, len(color)+f))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
s = set()
free = 0
for ai in a:
    rank = ai // 400
    if rank > 7:
        free += 1
    else:
        s.add(rank)
print(len(s), len(s) + free)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))
rate_dict = defaultdict(int)
for a in A:
    if 1 <= a <= 399:
        rate_dict["gray"] += 1
    elif 400 <= a <= 799:
        rate_dict["brown"] += 1
    elif 800 <= a <= 1199:
        rate_dict["green"] += 1
    elif 1200 <= a <= 1599:
        rate_dict["light_blue"] += 1
    elif 1600 <= a <= 1999:
        rate_dict["blue"] += 1
    elif 2000 <= a <= 2399:
        rate_dict["yellow"] += 1
    elif 2400 <= a <= 2799:
        rate_dict["orange"] += 1
    elif 2800 <= a <= 3199:
        rate_dict["red"] += 1
    elif 3200 <= a:
        rate_dict["free"] += 1
rate_dict = dict(rate_dict)
ans = sum([1 if x in rate_dict else 0
           for x in ["gray", "brown", "green", "light_blue", "blue", "yellow", "orange", "red"]])
min_ans = ans
if "free" in rate_dict:
    max_ans = ans + rate_dict["free"]
else:
    max_ans = min_ans
print("{} {}".format(min_ans, max_ans))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))
rate_dict = defaultdict(int)
for a in A:
    if 1 <= a <= 399:
        rate_dict["gray"] += 1
    elif 400 <= a <= 799:
        rate_dict["brown"] += 1
    elif 800 <= a <= 1199:
        rate_dict["green"] += 1
    elif 1200 <= a <= 1599:
        rate_dict["light_blue"] += 1
    elif 1600 <= a <= 1999:
        rate_dict["blue"] += 1
    elif 2000 <= a <= 2399:
        rate_dict["yellow"] += 1
    elif 2400 <= a <= 2799:
        rate_dict["orange"] += 1
    elif 2800 <= a <= 3199:
        rate_dict["red"] += 1
    elif 3200 <= a:
        rate_dict["free"] += 1
rate_dict = dict(rate_dict)
ans = sum([1 if x in rate_dict else 0
           for x in ["gray", "brown", "green", "light_blue", "blue", "yellow", "orange", "red"]])
min_ans = ans
if "free" in rate_dict:
    max_ans = ans + min(8 - ans, rate_dict["free"])
else:
    max_ans = min_ans
print("{} {}".format(min_ans, max_ans))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))
rate_dict = defaultdict(int)
for a in A:
    if 1 <= a <= 399:
        rate_dict["gray"] += 1
    elif 400 <= a <= 799:
        rate_dict["brown"] += 1
    elif 800 <= a <= 1199:
        rate_dict["green"] += 1
    elif 1200 <= a <= 1599:
        rate_dict["light_blue"] += 1
    elif 1600 <= a <= 1999:
        rate_dict["blue"] += 1
    elif 2000 <= a <= 2399:
        rate_dict["yellow"] += 1
    elif 2400 <= a <= 2799:
        rate_dict["orange"] += 1
    elif 2800 <= a <= 3199:
        rate_dict["red"] += 1
    elif 3200 <= a:
        rate_dict["free"] += 1
ans = sum([1 if x in rate_dict else 0
           for x in ["gray", "brown", "green", "light_blue", "blue", "yellow", "orange", "red"]])
min_ans = ans
if "free" in rate_dict:
    max_ans = ans + min(8 - ans, rate_dict["free"])
else:
    max_ans = min_ans
print("{} {}".format(min_ans, max_ans))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))
rate_dict = defaultdict(int)
for a in A:
    if 1 <= a <= 399:
        rate_dict["gray"] += 1
    elif 400 <= a <= 799:
        rate_dict["brown"] += 1
    elif 800 <= a <= 1199:
        rate_dict["green"] += 1
    elif 1200 <= a <= 1599:
        rate_dict["light_blue"] += 1
    elif 1600 <= a <= 1999:
        rate_dict["blue"] += 1
    elif 2000 <= a <= 2399:
        rate_dict["yellow"] += 1
    elif 2400 <= a <= 2799:
        rate_dict["orange"] += 1
    elif 2800 <= a <= 3199:
        rate_dict["red"] += 1
    elif 3200 <= a:
        rate_dict["free"] += 1
ans = sum([1 if x in rate_dict else 0
           for x in ["gray", "brown", "green", "light_blue", "blue", "yellow", "orange", "red"]])
min_ans = ans
if "free" in rate_dict:
    max_ans = ans + min(9 - len(set(list(rate_dict.keys()))), rate_dict["free"])
else:
    max_ans = min_ans
print("{} {}".format(min_ans, max_ans))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))
rate_dict = defaultdict(int)
for a in A:
    if 1 <= a <= 399:
        rate_dict["gray"] += 1
    elif 400 <= a <= 799:
        rate_dict["brown"] += 1
    elif 800 <= a <= 1199:
        rate_dict["green"] += 1
    elif 1200 <= a <= 1599:
        rate_dict["light_blue"] += 1
    elif 1600 <= a <= 1999:
        rate_dict["blue"] += 1
    elif 2000 <= a <= 2399:
        rate_dict["yellow"] += 1
    elif 2400 <= a <= 2799:
        rate_dict["orange"] += 1
    elif 2800 <= a <= 3199:
        rate_dict["red"] += 1
    elif 3200 <= a:
        rate_dict["free"] += 1
ans = sum([1 if x in rate_dict else 0
           for x in ["gray", "brown", "green", "light_blue", "blue", "yellow", "orange", "red"]])
min_ans = ans
if "free" in rate_dict:
    max_ans = ans + min(8 - len(list(rate_dict.keys())) - 1, rate_dict["free"])
else:
    max_ans = min_ans
print("{} {}".format(min_ans, max_ans))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))
rate_dict = defaultdict(int)
for a in A:
    if 1 <= a <= 399:
        rate_dict["gray"] += 1
    elif 400 <= a <= 799:
        rate_dict["brown"] += 1
    elif 800 <= a <= 1199:
        rate_dict["green"] += 1
    elif 1200 <= a <= 1599:
        rate_dict["light_blue"] += 1
    elif 1600 <= a <= 1999:
        rate_dict["blue"] += 1
    elif 2000 <= a <= 2399:
        rate_dict["yellow"] += 1
    elif 2400 <= a <= 2799:
        rate_dict["orange"] += 1
    elif 2800 <= a <= 3199:
        rate_dict["red"] += 1
    elif 3200 <= a:
        rate_dict["free"] += 1
ans = sum([1 if x in rate_dict else 0
           for x in ["gray", "brown", "green", "light_blue", "blue", "yellow", "orange", "red"]])
if "free" in rate_dict:
    free_val = rate_dict["free"]
    min_ans = ans + max(free_val - len(list(rate_dict.keys())) - 1, 0)
    max_ans = ans + min(len(list(rate_dict.keys())) - 1, free_val)
else:
    min_ans = ans
    max_ans = min_ans
print("{} {}".format(min_ans, max_ans))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))
rate_dict = defaultdict(int)
for a in A:
    if 1 <= a <= 399:
        rate_dict["gray"] += 1
    elif 400 <= a <= 799:
        rate_dict["brown"] += 1
    elif 800 <= a <= 1199:
        rate_dict["green"] += 1
    elif 1200 <= a <= 1599:
        rate_dict["light_blue"] += 1
    elif 1600 <= a <= 1999:
        rate_dict["blue"] += 1
    elif 2000 <= a <= 2399:
        rate_dict["yellow"] += 1
    elif 2400 <= a <= 2799:
        rate_dict["orange"] += 1
    elif 2800 <= a <= 3199:
        rate_dict["red"] += 1
    elif 3200 <= a:
        rate_dict["free"] += 1
ans = sum([1 if x in rate_dict else 0
           for x in ["gray", "brown", "green", "light_blue", "blue", "yellow", "orange", "red"]])
if "free" in rate_dict:
    free_val = rate_dict["free"]
    min_ans = ans + max(free_val - len(list(rate_dict.keys())) - 1, 0)
    max_ans = ans + min(8 - len(list(rate_dict.keys())), free_val)
else:
    min_ans = ans
    max_ans = min_ans
print("{} {}".format(min_ans, max_ans))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

rate = defaultdict(int)

for a in A:
    if 1 <= a <= 399:
        rate[1] += 1
    if 400 <= a <= 799:
        rate[2] += 1
    if 800 <= a <= 1199:
        rate[3] += 1
    if 1200 <= a <= 1599:
        rate[4] += 1
    if 1600 <= a <= 1999:
        rate[5] += 1
    if 2000 <= a <= 2399:
        rate[6] += 1
    if 2400 <= a <= 2799:
        rate[7] += 1
    if 2800 <= a <= 3199:
        rate[8] += 1
    if a >= 3200:
        rate[9] += 1

valiable = len(rate.keys())
redcoder = rate[9]

if redcoder:
    if valiable == 1:
        print(1, min(redcoder, 9))
    else:
        print(valiable - 1, min(valiable + redcoder - 1, 9))
else:
    print(valiable, valiable)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

rate = defaultdict(int)

for a in A:
    if 1 <= a <= 399:
        rate[1] += 1
    if 400 <= a <= 799:
        rate[2] += 1
    if 800 <= a <= 1199:
        rate[3] += 1
    if 1200 <= a <= 1599:
        rate[4] += 1
    if 1600 <= a <= 1999:
        rate[5] += 1
    if 2000 <= a <= 2399:
        rate[6] += 1
    if 2400 <= a <= 2799:
        rate[7] += 1
    if 2800 <= a <= 3199:
        rate[8] += 1
    if a >= 3200:
        rate[9] += 1

valiable = len(rate.keys())
redcoder = rate[9]

if redcoder:
    if valiable == 1:
        print(1, 1)
    else:
        print(valiable - 1, min(valiable + redcoder - 1, 9))
else:
    print(valiable, valiable)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

rate = defaultdict(int)

for a in A:
    if 1 <= a <= 399:
        rate[1] += 1
    if 400 <= a <= 799:
        rate[2] += 1
    if 800 <= a <= 1199:
        rate[3] += 1
    if 1200 <= a <= 1599:
        rate[4] += 1
    if 1600 <= a <= 1999:
        rate[5] += 1
    if 2000 <= a <= 2399:
        rate[6] += 1
    if 2400 <= a <= 2799:
        rate[7] += 1
    if 2800 <= a <= 3199:
        rate[8] += 1
    if a >= 3200:
        rate[9] += 1

all = len(rate.keys())
red = rate[9]
nored = all
if red:
    nored -= 1

if red:
    if all == 1:
        print(1, 1)
    else:
        print(nored, min(all + red - 1, 9))
else:
    print(all, all)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

rate = defaultdict(int)

for a in A:
    if 1 <= a <= 399:
        rate[1] += 1
    if 400 <= a <= 799:
        rate[2] += 1
    if 800 <= a <= 1199:
        rate[3] += 1
    if 1200 <= a <= 1599:
        rate[4] += 1
    if 1600 <= a <= 1999:
        rate[5] += 1
    if 2000 <= a <= 2399:
        rate[6] += 1
    if 2400 <= a <= 2799:
        rate[7] += 1
    if 2800 <= a <= 3199:
        rate[8] += 1
    if a >= 3200:
        rate[9] += 1

v = len(rate.keys())

red = rate[9]
nored = N - red

if red:
    if v == 1:
        print(1, 1)
    else:
        print(nored, min(v + red - 1, 9))
else:
    print(v, v)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

rate = defaultdict(int)

for a in A:
    if 1 <= a <= 399:
        rate[1] += 1
    if 499 <= a <= 799:
        rate[2] += 1
    if 800 <= a <= 1199:
        rate[3] += 1
    if 1200 <= a <= 1599:
        rate[4] += 1
    if 1600 <= a <= 1999:
        rate[5] += 1
    if 2000 <= a <= 2399:
        rate[6] += 1
    if 2400 <= a <= 2799:
        rate[7] += 1
    if 2800 <= a <= 3199:
        rate[8] += 1
    if a >= 3200:
        rate[9] += 1

v = len(rate.keys())

red = rate[9]
nored = N - red

if red:
    if v == 1:
        print(1, 1)
    else:
        print(nored, min(v + red - 1, 9))
else:
    print(v, v)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

rate = defaultdict(int)

for a in A:
    if 1 <= a <= 399:
        rate[1] += 1
    if 499 <= a <= 799:
        rate[2] += 1
    if 800 <= a <= 1199:
        rate[3] += 1
    if 1200 <= a <= 1599:
        rate[4] += 1
    if 1600 <= a <= 1999:
        rate[5] += 1
    if 2000 <= a <= 2399:
        rate[6] += 1
    if 2400 <= a <= 2799:
        rate[7] += 1
    if 2800 <= a <= 3199:
        rate[8] += 1
    if a >= 3200:
        rate[9] += 1

v = len(rate.keys())

red = rate[9]

if red:
    if v == 1:
        print(v, v)
    else:
        print(v, min(v + red - 1, 9))
else:
    print(v, v)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

rate = defaultdict(int)

for a in A:
    if 1 <= a <= 399:
        rate[1] += 1
    if 499 <= a <= 799:
        rate[2] += 1
    if 800 <= a <= 1199:
        rate[3] += 1
    if 1200 <= a <= 1599:
        rate[4] += 1
    if 1600 <= a <= 1999:
        rate[5] += 1
    if 2000 <= a <= 2399:
        rate[6] += 1
    if 2400 <= a <= 2799:
        rate[7] += 1
    if 2800 <= a <= 3199:
        rate[8] += 1
    if a >= 3200:
        rate[9] += 1

v = len(rate.keys())

red = rate[9]

if red:
    if v == 1:
        print(v, v)
    else:
        print(v - 1, min(v + red - 1, 9))
else:
    print(v, v)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

rate = defaultdict(int)

for a in A:
    if 1 <= a <= 399:
        rate[1] += 1
    if 499 <= a <= 799:
        rate[2] += 1
    if 800 <= a <= 1199:
        rate[3] += 1
    if 1200 <= a <= 1599:
        rate[4] += 1
    if 1600 <= a <= 1999:
        rate[5] += 1
    if 2000 <= a <= 2399:
        rate[6] += 1
    if 2400 <= a <= 2799:
        rate[7] += 1
    if 2800 <= a <= 3199:
        rate[8] += 1
    if a >= 3200:
        rate[9] += 1

v = len(rate.keys())

red = rate[9]

if red:
    print(max(v - 1, 1), min(v + red - 1, 9))
else:
    print(v, v)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
colors = [0]*9
for i in a:
    idx = i//400
    if(idx > 8):
        idx = 8
    colors[idx] += 1
ans = 0
for i in colors[0:8]:
    if i != 0:
        ans += 1
print(ans, ans+colors[8])

Submission status: Wrong Answer

Solution code:
N, A = int(input()), list(map(int, input().split()))
C = [a // 400 for a in A]
mini = sum([1 for c in range(8) if c in C])
print(max(mini, 1), mini + sum([1 for c in C if c == 8]))

Submission status: Wrong Answer

Solution code:
bound = [3200, 2800, 2400, 2000, 1600, 1200, 800, 400, 1]
d = {b: 0 for b in bound}

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

for a in A:
    for b in bound:
        if b <= a:
            d[b] += 1
            break

mini = 0
for b in bound[1:]:
    if d[b] > 0:
        mini += 1

print(mini, mini + d[3200])