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())
nums=[int(i) for i in input().split()]
colors = []
noncolor = 0
for num in nums:
	if 1<=num and num<=399:
		colors.append(1)
	elif 400<=num and num<=799:
		colors.append(2)
	elif 800<=num and num<=1199:
		colors.append(3)
	elif 1200<=num and num<=1599:
		colors.append(4)
	elif 1600<=num and num<=1999:
		colors.append(5)
	elif 2000<=num and num<=2399:
		colors.append(6)
	elif 2400<=num and num<=2799:
		colors.append(7)
	elif 2800<=num and num<=3199:
		colors.append(8)
	else:
		noncolor+=1
colors = set(colors)
if len(colors) < noncolor and noncolor+len(colors)>=8:
    print("{} {}".format(noncolor,8))
elif len(colors) < noncolor and (noncolor+len(colors))<8:
    print("{} {}".format(noncolor,noncolor+len(colors)))
elif len(colors) >= noncolor and (noncolor+len(colors))<8:
	print("{} {}".format(len(colors),noncolor+len(colors)))
else:
    print("{} {}".format(len(colors),8))

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split());b=[s//400for s in a if s<3200];c=len(set(b))or 1;print(c,n-len(b)+c)

Submission status: Wrong Answer

Solution code:
n=int(input());b=[int(s)//400for s in input().split()if s<"3200"];c=len(set(b));print(c or 1,n-len(b)+c)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    colors = [0] * 9
    for i in range(N):
        c = min(A[i] // 400, 8)
        colors[c] += 1
    tmp = 0
    for i in range(8):
        if colors[i] >= 1:
            tmp += 1
    mx = min(tmp + colors[8], 8)
    mn = max(tmp, 1)
    print(mn, mx)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A

#B

#C
f = [0]
for i in range(1,400):
    f.append(0)
for i in range(400,800):
    f.append(1)
for i in range(800,1200):
    f.append(2)
for i in range(1200,1600):
    f.append(3)
for i in range(1600,2000):
    f.append(4)
for i in range(2000,2400):
    f.append(5)
for i in range(2400,2800):
    f.append(6)
for i in range(2800,3200):
    f.append(7)
for i in range(3200,4801):
    f.append(-1)
n = I()
a = LI()
k = [1 for i in range(8)]
s = 0
t = 0
for i in a:
    if f[i] >= 0:
        if k[f[i]]:
            k[f[i]] = 0
            s += 1
    else:
        t += 1
print(max(s,1),min(s+t,8))
#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Wrong Answer

Solution code:
def main():
    _ = int(input())
    a = [int(s) for s in input().split()]
    print(*solve(a))

def solve(a):
    s = set()
    t = 0
    f = 0

    for x in a:
        y = x // 400
        if x >= 3200:
            t += 1
            f = 1
        else:
            s.add(y)
    
    mi = max(len(s), f)
    ma = min(len(s) + t, 8)
    return mi, ma

main()

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

sum=0
b=[]
for a in A:
    a//=400
    if a<8:
        b.append(a)
    else:
        sum+=1
b=Counter(b).most_common()
m=len(b)
x=m
y=m+sum
print(x,y)

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

sum=0
b=[]
for a in A:
    a//=400
    if a<8:
        b.append(a)
    else:
        sum+=1
b=Counter(b).most_common()
m=len(b)
x=m
y=min(8,m+sum)
print(x,y)

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

sum=0
b=[]
for i in range(n):
    a[i]//=400
    if a[i]<8:
        b.append(a[i])
    else:
        sum+=1
b=Counter(b).most_common()
m=len(b)
x=m
y=min(8,m+sum)
print(x,y)

Submission status: Wrong Answer

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

d = [0 for _ in range(9)]
for x in a:
    p = x // 400
    if p >= 8:
        d[8] += 1
    else:
        d[p] = 1

print(sum(d) - d[8], sum(d))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
color=[0]*8
over=0
for i in range(n):
    if a[i]<=399:
        color[0]+=1
    elif a[i]<=799:
        color[1]+=1
    elif a[i]<=1199:
        color[2]+=1
    elif a[i]<=1599:
        color[3]+=1
    elif a[i]<=1999:
        color[4]+=1
    elif a[i]<=2399:
        color[5]+=1
    elif a[i]<=2799:
        color[6]+=1
    elif a[i]<=3199:
        color[7]+=1
    else:
        over+=1
mini=8-color.count(0) if (8-color.count(0))>0 else 1
maxi=8-color.count(0)+over if (8-color.count(0)+over)<8 else 8
print("{} {}".format(mini,maxi))

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
b=[0for i in range(9)]
for s in a:
    if s<3200:
        b[s//400]=1
    else:
        b[8]+=1
print(sum(b[:8]),sum(b))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n,*a=map(int,open(0).read().split())
c=defaultdict(int)
for s in a:
    c[s//400]+=1

ans=0
ans2=0
for t in sorted(list(c.items())):
    if t[0]<8:
        ans+=1
    else:
        ans2+=t[1]
print(ans,ans+ans2)

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
b=[s//400 for s in a if s<3200]
c=len(set(b))
print(c,n-len(b)+c)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))
r = []
R = []
for i in range(n):
    if A[i] >= 3200:
        R.append(A[i])
    else:
        r.append(A[i] // 400)
rs = len(set(r))
m = rs + len(R)
if m > 8:
    m = 8
print(rs,m)

Submission status: Wrong Answer

Solution code:
RATE_RANGE = 400
TOTAL_COLOR_NUM = 8
MAX_RATE = 3200
N = input()
a = map(int, raw_input().split())
# discretize rate (0 ~ 8)
rainbow_color_num = 0
kind_num = set()
for _a in a:
  if _a >= MAX_RATE:
    rainbow_color_num += 1
  else:
    kind_num.add(_a / RATE_RANGE)
print max(1, len(kind_num)), min(TOTAL_COLOR_NUM, len(kind_num) + rainbow_color_num)

Submission status: Wrong Answer

Solution code:
RATE_RANGE = 400
TOTAL_COLOR_NUM = 8
MAX_RATE = 3200
N = input()
a = map(int, raw_input().split())
# discretize rate (0 ~ 8)
rainbow_color_num = 0
kind_num = set()
for _a in a:
  if _a >= MAX_RATE:
    rainbow_color_num += 1
  else:
    kind_num.add(_a / RATE_RANGE)
print len(kind_num), min(TOTAL_COLOR_NUM, len(kind_num) + rainbow_color_num)

Submission status: Wrong Answer

Solution code:
RATE_RANGE = 400
TOTAL_COLOR_NUM = 8
MAX_RATE = 3200
N = input()
a = map(int, raw_input().split())
c = map(lambda x: x / RATE_RANGE if x < MAX_RATE else TOTAL_COLOR_NUM, a)

max_rate_num = len(filter(lambda x: x == TOTAL_COLOR_NUM, c))
uniq_c = set(c)
if TOTAL_COLOR_NUM in uniq_c:
  if len(uniq_c) == 1:
    print 1, 1
  elif len(uniq_c) == TOTAL_COLOR_NUM + 1:
    print TOTAL_COLOR_NUM, TOTAL_COLOR_NUM
  else:
    print len(uniq_c) - 1, min(TOTAL_COLOR_NUM, len(uniq_c) - 1 + max_rate_num)
else:
  print len(uniq_c), len(uniq_c)

Submission status: Wrong Answer

Solution code:
RATE_RANGE = 400
TOTAL_COLOR_NUM = 8
MAX_RATE = 3200
N = input()
a = map(int, raw_input().split())
a = map(lambda x: x / RATE_RANGE if x < MAX_RATE else TOTAL_COLOR_NUM, a)

uniq_a = set(a)
if TOTAL_COLOR_NUM in uniq_a:
  if len(uniq_a) <= 1:
    print len(uniq_a), len(uniq_a)
  elif len(uniq_a) == TOTAL_COLOR_NUM + 1:
    print len(uniq_a), len(uniq_a)
  else:
    print len(uniq_a) - 1, len(uniq_a) + 1
else:
  print len(uniq_a), len(uniq_a)

Submission status: Wrong Answer

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

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

from collections import defaultdict
from bisect import bisect_right

ans = 0
gold = 0
dic = defaultdict(int)
for i in range(N):
    r = bisect_right(co, A[i])
    dic[r] += 1
    
gold = dic[9]
del dic[9]
ans = len(dic.keys())

if ans == 0:
    print(1, min(gold, 8))
else:
    print( ans  , min(ans+gold, 8) )
# print(dic)

Submission status: Wrong Answer

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

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

from collections import defaultdict
from bisect import bisect_right

ans = 0
gold = 0
dic = defaultdict(int)
for i in range(N):
    r = bisect_right(co, A[i])
    dic[r] += 1
    
gold = dic[9]
del dic[9]
ans = len(dic.keys())

if ans == 0:
    print(1, min(ans+gold, 8))
else:
    print( ans  , min(ans+gold, 8) )
# print(dic)

Submission status: Wrong Answer

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

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

from collections import defaultdict
from bisect import bisect_right

ans = 0
gold = 0
dic = defaultdict(int)
for i in range(N):
    r = bisect_right(co, A[i])
    dic[r] += 1
    
gold = dic[9]
del dic[9]
ans = len(dic.keys())

print( ans  , min(ans+gold, 8) )

Submission status: Wrong Answer

Solution code:
N  = int(input())
using = [0 for _ in range(9)]
def color(i):
    i = int(i)
    if i < 400:
        return 0
    elif i< 800:
        return 1
    elif i<1200:
        return 2
    elif i<1600:
        return 3
    elif i<2000:
        return 4
    elif i<2400:
        return 5
    elif i<2800:
        return 6
    elif i<3200:
        return 7
    else:
        return 8
L = list(map(color, input().split()))
for x in L:
    using[x] += 1
val = using.pop(-1)
if list(filter(lambda x:x!=0,using)) == []:
    print(1,min(8,val))
    quit()
else:
    minimum = len(list(filter(lambda x:x!=0,using)))
    maximum = min (8, minimum + val)
    print(minimum,maximum)

Submission status: Wrong Answer

Solution code:
def rate(n):
    if n < 399:
        return "gray"
    elif n < 799:
        return "brown"
    elif n < 1199:
        return "green"
    elif n < 1599:
        return "water"
    elif n < 1999:
        return "blue"
    elif n < 2399:
        return "yellow"
    elif n < 2799:
        return "orange"
    elif n < 3199:
        return "red"
    else:
        return "pro"

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

for i in a:
    ans.append(rate(i))

pro = ans.count("pro")
ANS = set(ans)
ANS.discard("pro")
MIN = len(ANS)
MAX = MIN + pro

print(max(MIN, 1), MAX)

Submission status: Wrong Answer

Solution code:
def rate(n):
    if n < 399:
        return "gray"
    elif n < 799:
        return "brown"
    elif n < 1199:
        return "green"
    elif n < 1599:
        return "water"
    elif n < 1999:
        return "blue"
    elif n < 2399:
        return "yellow"
    elif n < 2799:
        return "orange"
    elif n < 3199:
        return "red"
    else:
        return "pro"

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

for i in a:
    ans.append(rate(i))

pro = ans.count("pro")
ANS = set(ans)
ANS.discard("pro")
MIN = len(ANS)
MAX = MIN + pro

print(MIN, MAX)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
if ' '.join([str(x) for x in l])=='800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990':
  exit()
c=0
l2=[0]*9
for i in l:
  if 1<=i and i<=399:
    if l2[0]==0:
      c+=1
      l2[0]=1
  elif 400<=i and i<=799:
    if l2[1]==0:
      c+=1
      l2[1]=1
  elif 800<=i and i<=1199:
    if l2[2]==0:
      c+=1
      l2[2]=1
  elif 1200<=i and i<=1599:
    if l2[3]==0:
      c+=1
      l2[3]=1
  elif 1600<=i and i<=1999:
    if l2[4]==0:
      c+=1
      l2[4]=1
  elif 2000<=i and i<=2399:
    if l2[5]==0:
      c+=1
      l2[5]=1
  elif 2400<=i and i<=2799:
    if l2[6]==0:
      c+=1
      l2[6]=1
  elif 2800<=i and i<=3199:
    if l2[7]==0:
      c+=1
      l2[7]=1
  else:
    c+=1
    l2[8]+=1
if c==9:
  print(8,8)
else:
  if l2[8]!=0:
    if l2[8]==c:
      print(1,min(c,8))
    else:
      print(c-l2[8],c)
  else:
    print(c,c)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
x = 0
if len([i for i in a if i <= 799])>0:
  x = x + 1
if len([i for i in a if (800<=i)&(i<=1199)])>0:
  x = x + 1
if len([i for i in a if (1200<=i)&(i<=1599)])>0:
  x = x + 1
if len([i for i in a if (1600<=i)&(i<=1999)])>0:
  x = x + 1
if len([i for i in a if (2000<=i)&(i<=2399)])>0:
  x = x + 1
if len([i for i in a if (2400<=i)&(i<=2799)])>0:
  x = x + 1
if len([i for i in a if (2800<=i)&(i<=3199)])>0:
  x = x + 1
y = x #最大値はy
if len([i for i in a if 3200<=i])>0:
  if x == 0:
    x = x + 1
  y = y + len([i for i in a if 3200<=i])
if y > 8:
  y = 8
print(x, y)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
x = 0
if len([i for i in a if i <= 799])>0:
  x = x + 1
if len([i for i in a if (800<=i)&(i<=1199)])>0:
  x = x + 1
if len([i for i in a if (1200<=i)&(i<=1599)])>0:
  x = x + 1
if len([i for i in a if (1600<=i)&(i<=1999)])>0:
  x = x + 1
if len([i for i in a if (2000<=i)&(i<=2399)])>0:
  x = x + 1
if len([i for i in a if (2400<=i)&(i<=2799)])>0:
  x = x + 1
if len([i for i in a if (2800<=i)&(i<=3199)])>0:
  x = x + 1
y = x #最大値はy
if len([i for i in a if 3200<=i])>0:
  if x == 0:
    x = x + 1
    y = y + 1
  else:
    y = y + len([i for i in a if 3200<=i])
if y > 8:
  y = 8
print(x, y)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
x = 0
if len([i for i in a if i <= 799])>0:
  x = x + 1
if len([i for i in a if (800<=i)&(i<=1199)])>0:
  x = x + 1
if len([i for i in a if (1200<=i)&(i<=1599)])>0:
  x = x + 1
if len([i for i in a if (1600<=i)&(i<=1999)])>0:
  x = x + 1
if len([i for i in a if (2000<=i)&(i<=2399)])>0:
  x = x + 1
if len([i for i in a if (2400<=i)&(i<=2799)])>0:
  x = x + 1
if len([i for i in a if (2800<=i)&(i<=3199)])>0:
  x = x + 1
y = x #最大値はy
if len([i for i in a if 3200<=i])>0:
  if x == 0:
    x = x + 1
  else:
    y = y + len([i for i in a if 3200<=i])
if y > 8:
  y = 8
print(x, y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
color = [0 for i in range(9)]

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

count = 8 - color[:8].count(0)
print(max(count,1), '', end='')
count += color[8]
if count > 8:
    print(8)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
color = [0 for i in range(9)]

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

count = 8 - color[:8].count(0)
print(count, '', end='')
count += color[8]
if count > 8:
    print(8)
else:
    print(count)

Submission status: Wrong Answer

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

dic = defaultdict(int)
for a in A:
    n = a//400
    if n > 7:
        dic[8] += 1
    else: dic[n] += 1

m = len(dic.keys())
if dic[8] > 0:
    m -= 1
    mi = max(1,m)
    ma = min(8,m+dic[8])
else:
    mi = ma = m
print(mi,ma)

Submission status: Wrong Answer

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

dic = defaultdict(int)
for a in A:
    n = a//400
    if n > 7:
        dic[8] += 1
    else: dic[n] += 1

print(dic)
m = len(dic.keys())
if dic[8] > 0:
    m -= 1
    mi = max(1,m)
    ma = min(8,m+dic[8])
else:
    mi = ma = m
print(mi,ma)

Submission status: Wrong Answer

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

dic = defaultdict(int)
for a in A:
    n = a//400
    if n > 7:
        dic[8] += 1
    else: dic[n] += 1

m = len(dic.keys())
if dic[8] > 0:
    m -= 1
    mi = m
    ma = min(8,m+dic[8])
else:
    mi = ma = m
if mi == 0: mi = 1
print(mi,ma)

Submission status: Wrong Answer

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

dic = defaultdict(int)
for a in A:
    n = a//400
    if n > 7:
        dic[8] += 1
    else: dic[n] += 1

m = len(dic.keys())
if dic[8] > 0:
    m -= 1
    mi = m
    ma = min(8,m+dic[8])
else:
    mi = ma = m
print(mi,ma)

Submission status: Wrong Answer

Solution code:
n=int(input())
a_s=list(map(int,input().split()))
color_list=[0]*8
god=0
point_split=[1,400,800,1200,1600,2000,2400,2800,3200]
for a in a_s:
    for i in range(8):
        if point_split[i]<=a<point_split[i+1]:
            color_list[i]+=1
    if a >=3200:
        god+=1

ans=0
for color in color_list:
    if color:
        ans+=1
#print(color_list,ans)
if (ans+god)>=8:
    max=8
else:
    max=ans+god
if ans==0:
    min=1
else:
    min=ans

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a_s=list(map(int,input().split()))
color_list=[0]*8
god=0
point_split=[1,400,800,1200,1600,2000,2400,2800,3200]
for a in a_s:
    for i in range(8):
        if point_split[i]<=a<point_split[i+1]:
            color_list[i]+=1
    if a >=3200:
        god+=1

ans=0
for color in color_list:
    if color:
        ans+=1
#print(color_list,ans)
if (ans+god)>=8:
    max=8
else:
    max=ans+god
if ans==0:
    min=1
else:
    min=ans

print(min,max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a_s=list(map(int,input().split()))
color_list=[0]*8
god=0
point_split=[1,400,800,1200,1600,2000,2400,2800,3200]
for a in a_s:
    for i in range(8):
        if point_split[i]<=a<point_split[i+1]:
            color_list[i]+=1
    if a >=3200:
        god+=1

ans=0
for color in color_list:
    if color>0:
        ans+=1

if (ans+god)>=9:
    max=8
else:
    max=ans+god
if ans>0:
    min=ans
else:
    min=1

print(min,max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a_s=list(map(int,input().split()))
color_list=[0]*8
god=0
point_split=[1,400,800,1200,1600,2000,2400,2800,3200]
for a in a_s:
    for i in range(8):
        if point_split[i]<=a<point_split[i+1]:
            color_list[i]+=1
    if a >=3200:
        god+=1
        
ans=0
for color in color_list:
    if color>0:
        ans+=1

if ans+god>=9:
    max=8
else:
    max=ans+god
if ans>0:
    min=ans
else:
    min=0

print(min,max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a_s=list(map(int,input().split()))
color_list=[0]*8
god=0
point_split=[1,400,800,1200,1600,2000,2400,2800,3200]
for a in a_s:
    for i in range(8):
        if point_split[i]<=a<point_split[i+1]:
            color_list[i]+=1
    if a >=3200:
        god+=1
print(color_list,god)

ans=0
for color in color_list:
    if color>0:
        ans+=1

if ans+god>=9:
    max=8
else:
    max=ans+god
if ans>0:
    min=ans
else:
    min=0

print(min,max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a_s=list(map(int,input().split()))
color_list=[0]*8
god=0
point_split=[1,400,800,1200,1600,2000,2400,2800,3200]
for a in a_s:
    for i in range(8):
        if point_split[i]<=a<point_split[i+1]:
            color_list[i]+=1
    if a >=3200:
        god+=1
ans=0
for color in color_list:
    if color>0:
        ans+=1

if ans+god>9:
    max=8
else:
    max=ans+god
if ans>0:
    min=ans
else:
    min=0

print(min,max)

Submission status: Wrong Answer

Solution code:
# え何 もしかして色って最大8色とはどこにもかいてありませ〜〜〜んとかいうオチ？
# > 4 人目が「紫色」を選び、5人目が「黒色」を選んだ時、色の種類数は5であり、これは最大値を取る一つの例である
# まじかよ...

n = int(input())
arr = list(map(int, input().split()))
over = 0
collection = [0 for _ in range(8)]
for a in arr:
    c = a // 400
    if c >= 8:
        over += 1
    elif c not in collection:
        collection[c] = 1

maximum = sum(collection) + over
minimum = max(1, sum(collection))
print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
# え何 もしかして色って最大8色とはどこにもかいてありませ〜〜〜んとかいうオチ？
# > 4 人目が「紫色」を選び、5人目が「黒色」を選んだ時、色の種類数は5であり、これは最大値を取る一つの例である
# まじかよ...

n = int(input())
arr = list(map(int, input().split()))
over = 0
collection = [0 for _ in range(8)]
for a in arr:
    c = a // 400
    if c >= 8:
        over += 1
    elif c not in collection:
        collection[c] = 1
# maximum = min(8, sum(collection) + over)
maximum = sum(collection) + over
minimum = 1 if sum(collection) == 0 else sum(collection)
print(min(8, minimum), maximum)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = list(map(int, input().split()))
over = 0
collection = [0 for _ in range(8)]
for a in arr:
    c = a // 400
    if c >= 8:
        over += 1
    elif c not in collection:
        collection[c] = 1
maximum = min(8, sum(collection) + over)
minimum = 1 if sum(collection) == 0 else sum(collection)
print(min(8, minimum), maximum)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400 if x<3200 else 8,A))
n_red=A.count(8)
red_exist=1 if n_red else 0
red_only=1 if red_exist and list(set(A))[0]==8 else 0
n_min=len(set(A)) if not red_exist else len(set(A))-1
print(1 if red_only else n_min,n_min+n_red)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400 if x<3200 else 8,A))
n_red=A.count(8)
n_min=len(set(A))
n_8=1 if n_red else 0
print(n_min-n_8 if all(A)!=8 else 1,n_min+n_red-n_8)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400 if x<3200 else 8,A))
n_red=A.count(8)
n_min=len(set(A))
n_8=1 if n_red else 0
print(n_min-n_8 if all(A)==8 else 1,n_min+n_red-n_8)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400 if x<3200 else 8,A))
n_red=A.count(8)
n_min=len(set(A))
n_8=1 if n_red else 0
print(n_min-n_8,n_min+n_red-n_8)

Submission status: Wrong Answer

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

ans = 0
for i in range(8):
  if rank_num[i]:
    ans = ans +1

min_ans = min(ans,1)
max_ans = ans +len(rank_num[8])
print(min_ans,max_ans)

Submission status: Wrong Answer

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

ans = 0
for i in range(8):
  if rank_num[i]:
    ans = ans +1

min_ans = ans
max_ans = ans +len(rank_num[8])
print(min_ans,max_ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
color=[0]*8
free=0
for a in A:
    if 1<=a<=399:color[0]=1
    elif 400<=a<=799:color[1]=1
    elif 800<=a<1199:color[2]=1
    elif 1200<=a<=1599:color[3]=1
    elif 1600<=a<=1999:color[4]=1
    elif 2000<=a<=2399:color[5]=1
    elif 2400<=a<=2799:color[6]=1
    elif 2800<=a<=3199:color[7]=1
    elif 3200<=a<=4800:free+=1
M=sum(color)+free
m=M if sum(color)==0 and free!=0 else sum(color)
print(m,M)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
c = [0]*8
d = 0
for ai in map(int,input().split()):
    if ai <400:
        c[0]=1
    elif 400<= ai <800:
        c[1]=1
    elif 800<= ai <1200:
        c[2]=1
    elif 1200<= ai <1600:
        c[3]=1
    elif 1600<= ai <2000:
        c[4]=1
    elif 2000<= ai <2400:
        c[5]=1
    elif 2400<= ai <2800:
        c[6]=1
    elif 2800<= ai <3200:
        c[7]=1
    elif 3200<= ai:
        d +=1

min_ans=0
for i in c:
    min_ans +=i

if min_ans + d <=8:
    max_ans = min_ans + d
else:
    max_ans = 8

if min_ans == 0:
    main_ans = 1

print(min_ans,max_ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
c = [0]*8
d = 0
for ai in map(int,input().split()):
    if ai <400:
        c[0]=1
    elif 400<= ai <800:
        c[1]=1
    elif 800<= ai <1200:
        c[2]=1
    elif 1200<= ai <1600:
        c[3]=1
    elif 1600<= ai <2000:
        c[4]=1
    elif 2000<= ai <2400:
        c[5]=1
    elif 2400<= ai <2800:
        c[6]=1
    elif 2800<= ai <3200:
        c[7]=1
    elif 3200<= ai:
        d +=1

min_ans=0
for i in c:
    min_ans +=i

if min_ans + d <=8:
    max_ans = min_ans + d
else:
    max_ans = 8

print(min_ans,max_ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
c = [0]*8
d = 0
for ai in map(int,input().split()):
    if ai <400:
        c[0]=1
    elif 400<= ai <800:
        c[1]=1
    elif 800<= ai <1200:
        c[2]=1
    elif 1200<= ai <1600:
        c[3]=1
    elif 1600<= ai <2000:
        c[4]=1
    elif 2000<= ai <2400:
        c[5]=1
    elif 2400<= ai <2800:
        c[6]=1
    elif 2800<= ai <3200:
        c[7]=1
    else:
        d +=1

min_ans=0
for i in c:
    min_ans +=i

if min_ans == 8:
    max_ans = min_ans
elif min_ans + d <=8:
    max_ans = min_ans + d
else:
    max_ans = 8

print(min_ans,max_ans)

Submission status: Wrong Answer

Solution code:
input()
rates = [int(x) for x in input().split(' ')]

colors = set()

for rate in rates:
    if rate in range(1, 400):
        colors.add('gray')
    elif rate in range(800):
        colors.add('brown')
    elif rate in range(1200):
        colors.add('green')
    elif rate in range(1600):
        colors.add('lightblue')
    elif rate in range(2000):
        colors.add('blue')
    elif rate in range(2400):
        colors.add('yellow')
    elif rate in range(2800):
        colors.add('orange')
    elif rate in range(3200):
        colors.add('red')

print(max(len(colors), 1), min(len(colors) + len([x for x in rates if x >= 3200]), 8))

Submission status: Wrong Answer

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

m = max(1, color[:8].count(True))
M = m + color[8]
print(m, M)