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()))
colors = [0] * 9
for i in range(N):
    if 1 <= a[i] and a[i] <= 399:
        colors[0] = 1
    elif 400 <= a[i] and a[i] <= 799:
        colors[1] = 1
    elif 800 <= a[i] and a[i] <= 1199:
        colors[2] = 1
    elif 1200 <= a[i] and a[i] <= 1599:
        colors[3] = 1
    elif 1600 <= a[i] and a[i] <= 1999:
        colors[4] = 1
    elif 2000 <= a[i] and a[i] <= 2399:
        colors[5] = 1
    elif 2400 <= a[i] and a[i] <= 2799:
        colors[6] = 1
    elif 2800 <= a[i] and a[i] <= 3199:
        colors[7] = 1
    else:
        colors[8] += 1

MIN = sum(colors[0:8])
MAX = sum(colors)

print(MIN, MAX)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
rates = [int(i) for i in input().split()]

color_nums = defaultdict(int)

for rate in rates:
    if rate <= 399:
        color_nums['灰'] += 1
    elif rate <= 799:
        color_nums['茶'] += 1
    elif rate <= 1199:
        color_nums['緑'] += 1
    elif rate <= 1599:
        color_nums['水'] += 1
    elif rate <= 1999:
        color_nums['青'] += 1
    elif rate <= 2399:
        color_nums['黄'] += 1
    elif rate <= 2799:
        color_nums['橙'] += 1
    elif rate <= 3199:
        color_nums['赤'] += 1
    else:
        color_nums['自由'] += 1

free_num = color_nums['自由']
if free_num == 0:
    # 自由に変えられる人がいない場合
    # -1 は free_num = color_nums['自由']で増えてしまったので...
    print(len(color_nums)-1, len(color_nums)-1)
elif free_num == N:
    # 自由に変えられる人しかいない場合
    print(1, free_num)
elif free_num != N:
    # 自由な人と混在
    tmp = dict(color_nums)  # コピーを作る
    tmp.pop('自由')
    l_tmp = len(tmp)
    min_num = l_tmp
    max_num = min(8, l_tmp + free_num)
    print(min_num, max_num)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
rates = [int(i) for i in input().split()]

color_nums = defaultdict(int)

for rate in rates:
    if rate <= 399:
        color_nums['灰'] += 1
    elif rate <= 799:
        color_nums['茶'] += 1
    elif rate <= 1199:
        color_nums['緑'] += 1
    elif rate <= 1599:
        color_nums['水'] += 1
    elif rate <= 1999:
        color_nums['青'] += 1
    elif rate <= 2399:
        color_nums['黄'] += 1
    elif rate <= 2799:
        color_nums['橙'] += 1
    elif rate <= 3199:
        color_nums['赤'] += 1
    else:
        color_nums['自由'] += 1

free_num = color_nums['自由']
if free_num == 0:
    # 自由に変えられる人がいない場合
    # -1 は free_num = color_nums['自由']で増えてしまったので...
    print(len(color_nums)-1, len(color_nums)-1)
elif free_num == N:
    # 自由に変えられる人しかいない場合
    print(1, min(free_num, 8))
elif free_num != N:
    # 自由な人と混在
    tmp = dict(color_nums)  # コピーを作る
    tmp.pop('自由')
    l_tmp = len(tmp)
    min_num = l_tmp
    max_num = min(8, l_tmp + free_num)
    print(min_num, max_num)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
rates = [int(i) for i in input().split()]

color_nums = defaultdict(int)

for rate in rates:
    if rate <= 399:
        color_nums['灰'] += 1
    elif rate <= 799:
        color_nums['茶'] += 1
    elif rate <= 1199:
        color_nums['緑'] += 1
    elif rate <= 1599:
        color_nums['水'] += 1
    elif rate <= 1999:
        color_nums['青'] += 1
    elif rate <= 2399:
        color_nums['黄'] += 1
    elif rate <= 2799:
        color_nums['橙'] += 1
    elif rate <= 3199:
        color_nums['赤'] += 1
    else:
        color_nums['自由'] += 1

free_num = color_nums['自由']
if free_num == 0:
    # 自由に変えられる人がいない場合
    # -1 は free_num = color_nums['自由']で増えてしまったので...
    print(len(color_nums)-1, len(color_nums)-1)
elif free_num == N:
    # 自由に変えられる人しかいない場合
    print(1, min(N, 8))
elif free_num != N:
    # 自由な人と混在
    tmp = dict(color_nums)  # コピーを作る
    tmp.pop('自由')
    l_tmp = len(tmp)
    min_num = l_tmp
    max_num = min(8, l_tmp + free_num)
    print(min_num, max_num)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i)//400 for i in input().split() if int(i)<3200]
x = len(set(a)) 
y = n-len(a) 

if y == 0:
    print(x,x)
elif x == 0:
    print(1,min(8,y))
else:
    print(x,min(8,x+y))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i)//400 for i in input().split() if int(i)<3200]
x = len(set(a))
y = n-len(a)

if x == 0:
    print(1,min(8,n))
else:
    print(x,min(8,x+y))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i)//400 for i in input().split() if int(i)<3200]
x = len(set(a))
y = n-len(a)

if x == 0:
    print(1,min(8,y))
else:
    print(x,min(8,x+y))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i)//400 for i in input().split() if int(i)<3200]
l = len(set(a))

if l == 8:
    m = 8
    M = 8
else:
    m = l
    M = min(8,l+n-len(a))

print(m,M)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
col=[False]*8
ans=0
for i in a:
    if 1<=i<=399:
        col[0]=True
    elif i<=799:
        col[1]=True
    elif i<=1199:
        col[2]=True
    elif i<=1599:
        col[3]=True
    elif i<=1999:
        col[4]=True
    elif i<=2399:
        col[5]=True
    elif i<=2799:
        col[6]=True
    elif i<=3199:
        col[7]=True
    else:
        ans+=1
ans1=0
for i in col:
    if i:
        ans1+=1
print(ans1,ans1+ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
col=[False]*8
ans=0
for i in a:
    if 1<=i<=399:
        col[0]=True
    elif i<=799:
        col[1]=True
    elif i<=1199:
        col[2]=True
    elif i<=1599:
        col[3]=True
    elif i<=1999:
        col[4]=True
    elif i<=2399:
        col[5]=True
    elif i<=2799:
        col[6]=True
    elif i<=3199:
        col[7]=True
    else:
        ans+=1
ans1=0
for i in col:
    if i:
        ans1+=1
print(max(ans1,ans),ans1+ans)

Submission status: Wrong Answer

Solution code:
import sys, re
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 fractions import gcd
from bisect import bisect
from heapq import heappush, heappop

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
a = LIST()

dic = defaultdict(int)

for x in a:
    if 1 <= x <= 399:
        dic["灰"] += 1
    if 400 <= x <= 799:
        dic["茶"] += 1
    if 800 <= x <= 1199:
        dic["緑"] += 1
    if 1200 <= x <= 1599:
        dic["水"] += 1
    if 1600 <= x <= 1999:
        dic["青"] += 1
    if 2000 <= x <= 2399:
        dic["黃"] += 1
    if 2400 <= x <= 2799:
        dic["橙"] += 1
    if 2800 <= x <= 3199:
        dic["赤"] += 1
    if 3200 <= x:
        dic["強い"] += 1
kind = len(dic.keys())
print(kind - bool(dic["強い"]), kind - bool(dic["強い"]) + dic["強い"])

Submission status: Wrong Answer

Solution code:
r = list()
r.append((1, 399))
r.append((400, 799))
r.append((800, 1199))
r.append((1200, 1599))
r.append((1600, 1999))
r.append((2000, 2399))
r.append((2400, 2799))
r.append((2800, 3199))

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

count = [0 for i in range(0, len(r) + 1)]
for ai in a:
    add = False
    for i in range(0, len(r)):
        if r[i][0] <= ai <= r[i][1]:
            count[i] += 1
            add = True
    if not add:
        count[len(count) - 1] += 1

ans_min = 0
for c in range(0, len(count) - 1):
    if count[c] > 0:
        ans_min += 1

if ans_min > 0:
    ans_max = ans_min + count[len(count) - 1]
elif count[len(count) - 1] > 0:
    ans_max = 1
else:
    ans_max = 0

print("%d %d" % (ans_min, ans_max))

Submission status: Wrong Answer

Solution code:
r = list()
r.append((1, 399))
r.append((400, 799))
r.append((800, 1199))
r.append((1200, 1599))
r.append((1600, 1999))
r.append((2000, 2399))
r.append((2400, 2799))
r.append((2800, 3199))

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

count = [0 for i in range(0, len(r) + 1)]
for ai in a:
    add = False
    for i in range(0, len(r)):
        if r[i][0] <= ai <= r[i][1]:
            count[i] += 1
            add = True
    if not add:
        count[len(count) - 1] += 1

ans_min = 0
for c in range(0, len(count) - 1):
    if count[c] > 0:
        ans_min += 1

ans_max = ans_min + count[len(count) - 1]
if ans_max == 0:
    ans_max = 1

print("%d %d" % (ans_min, ans_max))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
var = [0]*8
clown = 0
for i in a:
  if i >= 3200:
    clown += 1
  else:
    var[i//400] = 1
print(sum(var), sum(var)+clown)

Submission status: Wrong Answer

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

n=int(input())
a=list(map(int,input().split()))
b={}
cnt=0
for i in a:
    if i<3200:
        b[i//400]=1
    else:
        cnt+=1
if sum(b.values())==0:
    print(1,cnt)
print(sum(b.values()),sum(b.values())+cnt)

Submission status: Wrong Answer

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

n=int(input())
a=list(map(int,input().split()))
b={}
cnt=0
for i in range(n):
    if a[i]<3200:
        b[a[i]//400]=1
    else:
        cnt+=1
print(sum(b.values()),sum(b.values())+cnt)

Submission status: Wrong Answer

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

n=int(input())
a=list(map(int,input().split()))
b=[0]*10
cnt=0
for i in range(n):
    if a[i]<3200:
        b[a[i]//400]=1
    else:
        cnt+=1
if n==1:
    if a[0]>=3200:
        print(1,1)
        exit()
print(sum(b),sum(b)+cnt)

Submission status: Wrong Answer

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

n=int(input())
a=list(map(int,input().split()))
b=[0]*10
cnt=0
for i in range(n):
    if a[i]<3200:
        b[a[i]//400]=1
    else:
        cnt+=1
print(sum(b),sum(b)+cnt)

Submission status: Wrong Answer

Solution code:


import numpy as np
import fractions as fra


input()
s=set()
c=0
for y in input().split():
    x=int(y)//400
    if(x>=8):
        c+=1
    else:
        s.add(x)

#print(s)
ls=len(s)
print(ls,end=" ")
print(ls+c)

Submission status: Wrong Answer

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

scr = [400,800,1200,1600,2000,2400,2800,3200,5000]
li = [0,0,0,0,0,0,0,0,0]

for i in range(n):
    for j in range(len(scr)):
        if a[i] < scr[j]:
            li[j] += 1
            break

ans = 0
for i in range(len(li)-1):
    if li[i]>0:
        ans += 1

if li[8]:
    ans_M = min(ans+li[8],8)
    ans_m = max(ans,1)
else:
    ans_M = ans
    ans_m = ans

print(ans_m,ans_M)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
A = [e//400 for e in A]
from collections import Counter
D = Counter(A)
ans = 0
add = 0
for key,value in D.items():
    if key >= 8:
        add += value
    else:
        if value > 0:
            ans += 1
print(ans,ans+add)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
A = [e//400 for e in A]
from collections import Counter
D = Counter(A)
ans = 0
add = 0
for key,value in D.items():
    if key == 8:
        add = value
    else:
        if value > 0:
            ans += 1
print(ans,ans+add)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
from collections import defaultdict
D = defaultdict(int)
for e in A: 
    D[e//400] += 1
ans = 0
for i in range(8):
    if D[i]:
        ans += 1
add = D[8]
print(ans,ans+add)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
division = {str(i):0 for i in range(9)}
for i in a:
    x = i // 400
    if x > 8:
        x = 8
    division[str(x)] += 1
ans = 0
check = 1
for i in range(8):
    if division[str(i)] != 0:
        ans += 1
        check = 0
min_ans = ans + check
max_ans = ans + check + division['8']
print(min_ans,max_ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
division = {str(i):0 for i in range(9)}
for i in a:
    x = i // 400
    if x > 8:
        x = 8
    division[str(x)] += 1
ans = 0
check = 0
for i in range(8):
    if division[str(i)] != 0:
        ans += 1
        check = 0
min_ans = ans + check
max_ans = ans + check + division['8']
print(min_ans,max_ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
col = [0]*9
for i in range(N):
    if a[i] <=399:
        col[0] = 1
    elif a[i] <= 799:
        col[1] = 1
    elif a[i] <= 1199:
        col[2] = 1
    elif a[i] <= 1599:
        col[3] = 1
    elif a[i] <= 1999:
        col[4] = 1
    elif a[i] <= 2399:
        col[5] = 1
    elif a[i] <= 2799:
        col[6] = 1
    elif a[i] <= 3199:
        col[7] = 1
    else: col[8] += 1
ansmax = min(sum(col),8)
if col[8]>0:
    ansmin = max(sum(col[:8]),1)
else: ansmin = sum(col[:8])
print(ansmin, ansmax)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))
C=[0]*8
num_god=0
for a in A:
    if a//400<8:
        C[a//400]+=1
    else:
        num_god+=1
ans=0
for a in C:
    if a!=0:
        ans+=1
Min=ans
Max=ans+num_god
print(Min,Max)

Submission status: Wrong Answer

Solution code:
x=[0]*9
n=int(input())
a=[int(i) for i in input().split()]
for i in range(n):
    for j in range(8):
        if a[i]<400*(j+1):
            x[j]=1
            break
    else:
        x[8]+=1

print(x[:-1].count(1),end=" ")
print(x[:-1].count(1)+x[-1])

Submission status: Wrong Answer

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

tmp=[gray,brown,green,water,blue,yellow,orange,red]
variety=sum(x>0 for x in tmp)

minimum=variety
maximum=variety+other
if maximum>8:
    maximum=8
if minimum==0:
    minimum=1
print(str(minimum)+' '+str(maximum))

Submission status: Wrong Answer

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

tmp=[gray,brown,green,water,blue,yellow,orange,red]
variety=sum(x>0 for x in tmp)

minimum=variety
maximum=variety+other
if maximum>8:
    maximum=8
if minimum==0:
    minimum==1
print(str(minimum)+' '+str(maximum))

Submission status: Wrong Answer

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

tmp=[gray,brown,green,water,blue,yellow,orange,red]
variety=sum(x>0 for x in tmp)

minimum=variety
maximum=variety+other
if maximum>8:
    maximum=8

print(str(minimum)+' '+str(maximum))

Submission status: Wrong Answer

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

ans = [False] * 8
tmp = 0
for i in a:
    if i > 3199:
        tmp += 1
    else:
        ans[i//400] = True
print(min(sum(ans),1),sum(ans)+tmp)

Submission status: Wrong Answer

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

ans = [False] * 9
tmp = 0
for i in a:
    if i > 3199:
        ans[8] = True
        tmp += 1
    else:
        ans[i//400] = True
print(sum(ans),sum(ans)+tmp)

Submission status: Wrong Answer

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

ans = [False] * 8
tmp = 0
for i in a:
    if i > 3199:
        tmp += 1
    else:
        ans[i//400] = True
print(sum(ans),sum(ans)+tmp)

Submission status: Wrong Answer

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

ans = [0] * 9

for i in range(n):
	if 1 <= ls[i] <= 399:
		ans[0] += 1
	elif 400 <= ls[i] <= 799:
		ans[1] += 1
	elif 800 <= ls[i] <= 1199:
		ans[2] += 1
	elif 1200 <= ls[i] <= 1599:
		ans[3] += 1
	elif 1600 <= ls[i] <= 1999:
		ans[4] += 1
	elif 2000 <= ls[i] <= 2399:
		ans[5] += 1
	elif 2400 <= ls[i] <= 2799:
		ans[6] += 1
	elif 2800 <= ls[i] <= 3199:
		ans[7] += 1
	elif ls[i] >= 3200:
		ans[8] += 1

cnt = 0

for j in range(8):
	if ans[j] != 0:
		cnt += 1
		
print(cnt, cnt + ans[8])

Submission status: Wrong Answer

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

rate = []
anycol = 0
for i in As : 
  if i >= 3200 : 
    anycol += 1 
  else : 
     rate.append( i // 400 )
 
count = len( set(rate) )
 
print( max(count, 1), min(count+anycol, 8) )

Submission status: Wrong Answer

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

rainbow = 0
color = [0 for i in range(8)]

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:
        rainbow += 1
        
ans = 0
for i in range(len(color)):
    if color[i] == 1:
        ans += 1

if ans == 0:
    print(1, min(ans+rainbow, 8))
else:
    print(ans ,min(ans+rainbow, 8))

Submission status: Wrong Answer

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

rainbow = 0
color = [0 for i in range(8)]

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:
        rainbow += 1
        
ans = 0
for i in range(len(color)):
    if color[i] == 1:
        ans += 1

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

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
res=set()
free=0
for i in range(len(a)):
  if a[i]<400:
    res.add("gray")
  elif a[i]<800:
    res.add("brown")
  elif a[i]<1200:
    res.add("green")
  elif a[i]<1600:
    res.add("water")
  elif a[i]<2000:
    res.add("blue")
  elif a[i]<2400:
    res.add("yellow")
  elif a[i]<2800:
    res.add("orange")
  elif a[i]<3200:
    res.add("red")
  else:
    free+=1

col=len(res)
print(col,col+free)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int, input().split()))
c=[0]*9
for i in range(N):
  c[min(a[i]//400, 8)]+=1
  
temp=[1 for i in range(8) if c[i]>0]
x=len(temp)
y=min(8, x+c[8])

print(max(x, 1), y)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc064/tasks/abc064_c

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

rate_count_list = [0] * 8   # 各色の人数
count_over_red = 0          # 赤色以上の人数

for a in a_list:

    # aの色を判定
    # 赤色以上の場合
    if a >= 3200:
        count_over_red += 1

    # 灰色から順に見ていく
    else:
        for i in range(8):
            if i == 0:
                min_in_rate = 1
            else:
                min_in_rate = 400 * i

            max_in_rate = 400 * (i + 1)

            if min_in_rate <= a < max_in_rate:
                rate_count_list[i] = 1
                break

ans_min = sum(rate_count_list)

ans_max = ans_min + count_over_red

if ans_max <= 8:
    print(str(max(ans_min, 1)) + ' ' + str(ans_max))
else:
    print(str(ans_min) + ' ' + str(8))

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc064/tasks/abc064_c

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

rate_count_list = [0] * 8   # 各色の人数
count_over_red = 0          # 赤色以上の人数

for a in a_list:

    # aの色を判定
    # 赤色以上の場合
    if a >= 3200:
        count_over_red += 1

    # 灰色から順に見ていく
    else:
        for i in range(8):
            if i == 0:
                min_in_rate = 1
            else:
                min_in_rate = 400 * i

            max_in_rate = 400 * (i + 1)

            if min_in_rate <= a < max_in_rate:
                rate_count_list[i] += 1
                break

# 0ではない要素の数を数える
ans_min = 0
for i in rate_count_list:
    if i != 0:
        ans_min += 1

ans_max = ans_min + count_over_red

if ans_max <= 8:
    print(str(ans_min) + ' ' + str(ans_max))
else:
    print(str(ans_min) + ' ' + str(8))

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc064/tasks/abc064_c

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

rate_count_list = [0] * 8   # 各色の人数
count_over_red = 0          # 赤色以上の人数

for a in a_list:

    # aの色を判定
    # 赤色以上の場合
    if a >= 3200:
        count_over_red += 1

    # 灰色から順に見ていく
    else:
        for i in range(8):
            if i == 0:
                min_in_rate = 1
            else:
                min_in_rate = 400 * i

            max_in_rate = 400 * (i + 1)

            if min_in_rate <= a < max_in_rate:
                rate_count_list[i] += 1

# 0ではない要素の数を数える
ans_min = sum(x != 0 for x in rate_count_list)
ans_max = ans_min + count_over_red

if ans_max <= 8:
    print(str(ans_min) + ' ' + str(ans_max))
else:
    print(str(ans_min) + ' ' + str(8))

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc064/tasks/abc064_c

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

rate_count_list = [0] * 8   # 各色の人数
count_over_red = 0          # 赤色以上の人数

for a in a_list:

    # aの色を判定
    # 赤色以上の場合
    if a >= 3200:
        count_over_red += 1

    # 灰色から順に見ていく
    else:
        for i in range(8):
            if i == 0:
                min_in_rate = 1
            else:
                min_in_rate = 400 * i

            max_in_rate = 400 * (i + 1)

            if min_in_rate <= a < max_in_rate:
                rate_count_list[i] += 1

# 0ではない要素の数を数える
ans_min = sum(x != 0 for x in rate_count_list)
ans_max = ans_min + count_over_red

if ans_max <= 8:
    print(str(ans_min) + ' ' + str(ans_max))
else:
    print(str(ans_min) + ' ' + '8')

Submission status: Wrong Answer

Solution code:
N = int(input())
array = [int(i) for i in input().split()]
ans_array = [0]*8
upper_num = 0

for i in array:
  if 1 <= i <= 399:
    ans_array[0] =  1
  elif 400 <= i <= 799:
    ans_array[1] =  1
  elif 800 <= i <= 1199:
    ans_array[2] =  1
  elif 1200 <= i <= 1599:
    ans_array[3] =  1
  elif 1600 <= i <= 1999:
    ans_array[4] =  1
  elif 2000 <= i <= 2399:
    ans_array[5] =  1
  elif 2400 <= i <= 2799:
    ans_array[6] =  1
  elif 2800 <= i <= 3199:
    ans_array[7] =  1
  else:
    upper_num += 1
    
min_num = sum(ans_array)
max_num = sum(ans_array) + upper_num

if max_num > 8:
  max_num = 8

print(min_num, max_num)

Submission status: Wrong Answer

Solution code:
N = int(input())
array = [int(i) for i in input().split()]
ans_array = [0]*8
upper_num = 0

for i in array:
  if 1 <= i <= 399:
    ans_array[0] =  1
  elif 400 <= i <= 799:
    ans_array[1] =  1
  elif 800 <= i <= 1199:
    ans_array[2] =  1
  elif 1200 <= i <= 1599:
    ans_array[3] =  1
  elif 1600 <= i <= 1999:
    ans_array[4] =  1
  elif 2000 <= i <= 2399:
    ans_array[5] =  1
  elif 2400 <= i <= 2799:
    ans_array[6] =  1
  elif 2800 <= i <= 3199:
    ans_array[7] =  1
  else:
    upper_num += 1
    
min_num = sum(ans_array)
max_num = sum(ans_array) + upper_num

print(min_num, max_num)

Submission status: Wrong Answer

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

red = 0
rate = []

for a in A:
    if(a>=3200):
        red += 1
    else:
        rate.append(min(a//400,7))

cnt = len(set(rate))

print(max(1,cnt),min(cnt+red,8))

Submission status: Wrong Answer

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

red = 0
rate = []

for a in A:
    if(a>=3200):
        red += 1
    rate.append(min(a//400,7))

cnt = len(set(rate))

print(cnt,min(cnt+red,8))

Submission status: Wrong Answer

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

conds = [400*i for i in range(1,9)]
colors = set()
frees = 0
for i in range(N):
    for c in conds:
        if A[i] < c:
            colors.add(c)
            break
    else:
        frees += 1
clen = len(colors)
print(clen, clen+frees)

Submission status: Wrong Answer

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

conds = [400*i for i in range(1,9)]
colors = set()
frees = 0
for i in range(N):
    for c in conds:
        if A[i] < c:
            colors.add(c)
            break
    else:
        frees += 1
clen = len(colors)
print(max(clen, frees), clen+frees)

Submission status: Wrong Answer

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

conds = [400*i-1 for i in range(1,9)]
colors = set()
frees = 0
for i in range(N):
    for c in conds:
        if A[i] <= c:
            colors.add(c)
            break
    else:
        frees += 1
minv = len(colors)
print(minv, minv+frees)

Submission status: Wrong Answer

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

conds = [400*i for i in range(1,9)]
colors = set()
frees = 0
for i in range(N):
    for c in conds:
        if A[i] < c:
            colors.add(c)
            break
    else:
        frees += 1
minv = len(colors)
print(minv, minv+frees)

Submission status: Wrong Answer

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

conds = [400*i-1 for i in range(1,9)]
colors = set()
reds = 0
for i in range(N):
    for c in conds:
        if A[i] < c:
            colors.add(c)
            break
    else:
        reds += 1
minv = len(colors)
print(minv, minv+reds)

Submission status: Wrong Answer

Solution code:
#レート
#1-399：灰色
#400-799：茶色
#800-1199：緑色
#1200-1599：水色
#1600-1999：青色
#2000-2399：黄色 
#2400-2799：橙色
#2800-3199：赤色

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

colors = []
color = ""
another = 0

for point in scores:
  if point <= 399:
    color = "gray"
    if color not in colors:
      colors.append(color)
  elif point <= 799:
    color = "brown"
    if color not in colors:
      colors.append(color)
  elif point <= 1199:
    color = "sky"
    if color not in colors:
      colors.append(color)
  elif point <= 1999:
    color = "blue"
    if color not in colors:
      colors.append(color)
  elif point <= 2399:
    color = "yellow"
    if color not in colors:
      colors.append(color)
  elif point <= 2799:
    color = "orange"
    if color not in colors:
      colors.append(color)
  elif point <= 3199:
    color = "red"
    if color not in colors:
      colors.append(color)
  elif point > 3199:
    another += 1
    
ans = len(colors)
if ans == 0:
  print(1,another)
else:
  print(ans,ans + another)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x) for x in input().split()]
B=[0]*9
for i in range(N):
  R=A[i]//400
  if R>8:
    R=8
  B[R] +=1
answer_min=0
for i in range(8):
  if not B[i]==0:
    answer_min +=1
answer_max=answer_min+B[8]
if answer_max>8:
  answer_max=8
if answer_min==0:
  answer_min=1
print(answer_min,answer_max)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x) for x in input().split()]
B=[0]*9
for i in range(N):
  R=A[i]//400
  if R>8:
    R=8
  B[R] +=1
answer_min=0
for i in range(8):
  if not B[i]==0:
    answer_min +=1
answer_max=answer_min+B[8]
if answer_max>8:
  answer_max=8
print(answer_min,answer_max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[0]*9
for i in a:
    if i>=3200:
        l[-1]+=1
    for j in range(8):
        if 400*j<=i<400*(j+1):
            l[j]=1

if sum(l)>=8:
    max_=8
else:
    max_=sum(l)
    
if sum(l[:-1])==0:
    min_=1
else:
    min_=sum(l[:-1])
    
print(min_,max_)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[0]*9
for i in a:
    for j in range(8):
        if 400*j<=i<400*(j+1):
            l[j]=1
        if i>=3200:
            l[-1]+=1
            break

if sum(l)>=8:
    max_=8
else:
    max_=sum(l)
    
if sum(l[:-1])==0:
    min_=1
else:
    min_=sum(l[:-1])
    
print(min_,max_)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[0]*9
for i in a:
    for j in range(8):
        if 400*j<=i<400*(j+1):
            l[j]=1
        if i>=3200:
            l[-1]+=1

max_=sum(l)
    
if sum(l[:-1])==0:
    min_=1
else:
    min_=sum(l[:-1])
    
print(min_,max_)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[0]*9
for i in a:
    for j in range(8):
        if 400*j<=i<400*(j+1):
            l[j]=1
        if i>=3200:
            l[-1]+=1

if sum(l)>=8:
    max_=8
else:
    max_=sum(l)
    
if sum(l[:-1])==0:
    min_=1
else:
    min_=sum(l[:-1])
    
print(min_,max_)