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:
num = int(input())
list = [int(x) for x in input().split()]

count = 0
any = 0

color = []

for i in range(num):
    if 1 <= list[i] < 400:
        color.append("gray")
    elif 400 <= list[i] < 800:
        color.append("brown")
    elif 800 <= list[i] < 1200:
        color.append("green")
    elif 1200 <= list[i] < 1600:
        color.append("sky")
    elif 1600 <= list[i] < 2000:
        color.append("blue")
    elif 2000 <= list[i] < 2400:
        color.append("yellow")
    elif 2400 <= list[i] < 2800:
        color.append("orange")
    elif 2800 <= list[i] < 3200:
        color.append("red")
    else:
        color.append("any")



if "gray" in color:
    count += 1
else:
    None


if "brown" in color:
    count += 1
else:
    None


if "green" in color:
    count += 1
else:
    None


if "sky" in color:
    count += 1
else:
    None


if "blue" in color:
    count += 1
else:
    None


if "yellow" in color:
    count += 1
else:
    None


if "orange" in color:
    count += 1
else:
    None


if "red" in color:
    count += 1
else:
    None


if "any" in color:
    any += 1
else:
    None



print(count,count+any)

Submission status: Wrong Answer

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

l = [False] * 8
top = 0
for i, val in enumerate(a):
    if 1 <= val <= 399:
        l[0] = True
    if 400 <= val <= 799:
        l[1] = True
    if 800 <= val <= 1199:
        l[2] = True
    if 1200 <= val <= 1599:
        l[3] = True
    if 1600 <= val <= 1999:
        l[4] = True
    if 2000 <= val <= 2399:
        l[5] = True
    if 2400 <= val <= 2799:
        l[6] = True
    if 2800 <= val <= 3199:
        l[7] = True
    if 3200 <= val:
        top += 1

mini = l.count(True)
ma = l.count(True) + top
print("{} {}".format(mini, ma))

Submission status: Wrong Answer

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

l = [False] * 8
top = 0
for i, val in enumerate(a):
    if 1 <= val < 399:
        l[0] = True
    if 400 <= val < 799:
        l[1] = True
    if 800 <= val < 1199:
        l[2] = True
    if 1200 <= val < 1599:
        l[3] = True
    if 1600 <= val < 1999:
        l[4] = True
    if 2000 <= val < 2399:
        l[5] = True
    if 2400 <= val < 2799:
        l[6] = True
    if 2800 <= val < 3199:
        l[7] = True
    if 3200 <= val:
        top += 1

mini = l.count(True)
ma = l.count(True) + top
print("{} {}".format(mini, ma))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(i) for i in input().split()]
col=[0 for i in range(8)]
fre=0
for a in A:
  if a<3200:
    col[a//400]+=1
  else:
    fre+=1
ans=0
# print(col)
for c in col:
  if c>0:
    ans+=1

if ans==0:
  MIN=1
else:
  MIN=ans

ans+=fre
if ans<=8:
  MAX=ans
else:
  MAX=8
print(MIN,MAX)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(i) for i in input().split()]
col=[0 for i in range(8)]
fre=0
for a in A:
  if a<3200:
    col[a//400]+=1
  else:
    fre+=1
ans=0
# print(col)
for c in col:
  if c>0:
    ans+=1
MIN=1 if ans==0 else ans
ans+=fre
MAX=ans if ans<=8 else 8
print(MIN,MAX)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(i) for i in input().split()]
col=[0 for i in range(8)]
fre=0
for a in A:
  if a<3200:
    col[a//400]+=1
  else:
    fre+=1
ans=0
# print(col)
for c in col:
  if c>0:
    ans+=1
ans+=fre
print(ans if ans<=8 else 8)

Submission status: Wrong Answer

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

rate_list = [0, 0, 0, 0, 0, 0, 0, 0]
perfect = 0

for i in range(n):
    rate = a[i]//400
    if rate < 8:
        if rate_list[rate] == 0:
            rate_list[rate] += 1
    else:
        perfect += 1

print('rate_list: ', rate_list)
mini = max(sum(rate_list), 1)
maxi = sum(rate_list)+perfect

print(mini, maxi)

Submission status: Wrong Answer

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

rate_list = [0, 0, 0, 0, 0, 0, 0, 0]
perfect = 0

for i in range(n):
    rate = a[i]//400
    if rate < 8:
        if rate_list[rate] == 0:
            rate_list[rate] += 1
    else:
        perfect += 1

mini = max(sum(rate_list), 1)
maxi = min(sum(rate_list)+perfect, 8)

print(mini, maxi)

Submission status: Wrong Answer

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

rate_list = [0, 0, 0, 0, 0, 0, 0, 0]
perfect = 0

for i in range(n):
    rate = int(a[i]/400)
    if rate < 8:
        if rate_list[rate] == 0:
            rate_list[rate] += 1
    else:
        perfect += 1

mini = max(sum(rate_list), 1)
maxi = min(sum(rate_list)+perfect, 7)

print(mini, maxi)

Submission status: Wrong Answer

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

rate_list = [0, 0, 0, 0, 0, 0, 0, 0]
perfect = 0

for i in range(n):
    rate = int(a[i]/400)
    if rate < 8:
        if rate_list[rate] == 0:
            rate_list[rate] += 1
    else:
        perfect += 1

mini = sum(rate_list)
maxi = min(sum(rate_list)+perfect, 7)

print(mini, maxi)

Submission status: Wrong Answer

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

colors = ["gray","brown","green","water","blue","yellow","orange","red","other"]
d = {x: 0 for x in colors}

if n == 1:
    print("1 1")
else:
    for x in a:
        rate = x // 400
        if rate == 0:
            d["gray"] += 1
        elif rate == 1:
            d["brown"] += 1 
        elif rate == 2:
            d["green"] += 1 
        elif rate == 3:
            d["water"] += 1 
        elif rate == 4:
            d["blue"] += 1 
        elif rate == 5:
            d["yellow"] += 1 
        elif rate == 6:
            d["orange"] += 1 
        elif rate == 7:
            d["red"] += 1 
        elif rate > 7:
            d["other"] += 1 

    num = 0
    for x in d:
        if d[x] > 0 and x != "other":
            num += 1

    print(num, num+d["other"])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(12):
    # print(1)
    if len([j for j in a if j > 400*i-1 and j < 400*(i+1)]) > 0:
       ans += 1 
    # if len([j for j in a if 400*i <= j and j < 400 * (i+1)] > 0:
    #     ans += 1
ans_min = ans - bool(len([i for i in a if 3200 <= i]))
ans_max = ans + len([i for i in a if 3200 <= i]) - bool(len([i for i in a if 3200 <= i]))
print(max(ans_min,1),max(ans_max,1))

Submission status: Wrong Answer

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

colors = ["gray","brown","green","water","blue","yellow","orange","red","other"]
d = {x: 0 for x in colors}

for x in a:
    rate = x // 400
    if rate == 0:
        d["gray"] += 1
    elif rate == 1:
        d["brown"] += 1 
    elif rate == 2:
        d["green"] += 1 
    elif rate == 3:
        d["water"] += 1 
    elif rate == 4:
        d["blue"] += 1 
    elif rate == 5:
        d["yellow"] += 1 
    elif rate == 6:
        d["orange"] += 1 
    elif rate == 7:
        d["red"] += 1 
    elif rate > 7:
        d["other"] += 1 

num = 0
for x in d:
    if d[x] > 0 and x != "other":
        num += 1

print(num, num+d["other"])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(12):
    # print(1)
    if len([j for j in a if j > 400*i-1 and j < 400*(i+1)]) > 0:
       ans += 1 
    # if len([j for j in a if 400*i <= j and j < 400 * (i+1)] > 0:
    #     ans += 1
ans_min = ans - bool(len([i for i in a if 3200 <= i]))
ans_max = ans + len([i for i in a if 3200 <= i]) - bool(len([i for i in a if 3200 <= i]))
print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
n, *A = map(int, open(0).read().split())
c = [0]*9
for a in A:
  c[min(8, a//400)] += 1

cl = 8-c[:-1].count(0)
cmin = max(1, cl)
cmax = min(8, cl+c[8])
print(cmin, cmax)

Submission status: Wrong Answer

Solution code:
n, *A = map(int, open(0).read().split())
c = [0]*9
for a in A:
  c[min(8, a//400)] += 1

print(8-c[:-1].count(0))
print(c[8])
cl = 8-c[:-1].count(0)
cmin = max(1, cl)
cmax = min(8, cl+c[8])
print(cmin, cmax)

Submission status: Wrong Answer

Solution code:
n, *A = map(int, open(0).read().split())
c = [0]*9
for a in A:
  c[min(8, a//400)] += 1

cmin = max(1, 8-c[:-1].count(0))
cmax = min(8, cmin+c[8])
print(cmin, cmax)

Submission status: Wrong Answer

Solution code:
n, *A = map(int, open(0).read().split())
c = [0]*9
for a in A:
  c[min(8, a//400)] += 1

print(c)
cmin = max(1, 8-c[::-1].count(0))
cmax = min(8, cmin+c[8])
print(cmin, cmax)

Submission status: Wrong Answer

Solution code:
n, *A = map(int, open(0).read().split())
c = [0]*9
for a in A:
  c[min(8, a//400)] += 1
cmin = max(1, 8-c.count(0))
cmax = min(8, cmin+c[8])
print(cmin, cmax)

Submission status: Wrong Answer

Solution code:
def rate(n:int) ->str:
    if 1 <= n <= 399:
        return 'hai'
    elif n <= 799:
        return 'cha'
    elif n <= 1199:
        return 'mido'
    elif n <= 1599:
        return 'mizu'
    elif n <= 1999:
        return 'ao'
    elif n <= 2399:
        return 'ki'
    elif n <= 2799:
        return 'dai'
    elif n <= 3199:
        return 'aka'
    else:
        return 'neutral'

def main():
    n = int(input())
    a = [int(x) for x in input().split()]
    d = {}
    d_n = {}
    n_count = 0
    for aa in a:
        buf = rate(aa)
        if buf == 'neutral':
            n_count += 1
            continue
        if buf not in d:
            d[buf] = 0
        d[buf] += 1
    if n_count >= 1:
        print(len(d.values()),len(d.values()) + n_count)
    else:
        print(len(d.values()),len(d.values()))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

color = [False for _ in range(8)]
wild = 0
for i in a:
    if i < 3200:
        color[i // 400] = True
    else:
        wild += 1

mini = 0
for i in color:
    if i:
        mini += 1
if mini == 0:
    mini = 1
    maxi = min(8, wild)
else:
    maxi = min(8, mini + wild)
print(mini, maxi)

Submission status: Wrong Answer

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

color = [False for _ in range(8)]
wild = 0
for i in a:
    if i < 3200:
        color[i // 400] = True
    else:
        wild += 1

mini = 0
for i in color:
    if i:
        mini += 1
if mini == 0:
    mini = 1
    maxi = wild
else:
    maxi = min(8, mini + wild)
print(mini, maxi)

Submission status: Wrong Answer

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

color = [False for _ in range(8)]
wild = 0
for i in a:
    if i < 3200:
        color[i // 400] = True
    else:
        wild += 1

mini = 0
for i in color:
    if i:
        mini += 1
if mini == 0:
    mini = 1
    maxi = 1
else:
    maxi = min(8, mini + wild)
print(mini, maxi)

Submission status: Wrong Answer

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

color = [False for _ in range(8)]
wild = 0
for i in a:
    if i < 3200:
        color[i // 400] = True
    else:
        wild += 1

mini = 0
for i in color:
    if i:
        mini += 1
maxi = min(8, mini + wild)
print(mini, maxi)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
color = [0]*8
v = 0
for a in A:
    if a <400:
        color[0] += 1
    elif a <800:
        color[1] += 1
    elif a <1200:
        color[2] += 1
    elif a <1600:
        color[3] += 1
    elif a <2000:
        color[4] += 1
    elif a <2400:
        color[5] += 1
    elif a <2800:
        color[6] += 1
    elif a <3200:
        color[7] += 1
    else:
        v += 1
s = 0
for c in color:
    if c:
        s += 1
if s == 0:
    m = v
else:
    m = s
print(m,  s+v) # vのみの時がある!

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
color = [0]*8
v = 0
for a in A:
    if a <400:
        color[0] += 1
    elif a <800:
        color[1] += 1
    elif a <1200:
        color[2] += 1
    elif a <1600:
        color[3] += 1
    elif a <2000:
        color[4] += 1
    elif a <2400:
        color[5] += 1
    elif a <2800:
        color[6] += 1
    elif a <3200:
        color[7] += 1
    else:
        v += 1
s = 0
for c in color:
    if c:
        s += 1
print(min(s,v),  s+v) # vのみの時がある!

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

color = {1:[],2:[], 3:[],4:[],5:[],6:[],7:[],8:[]}
suki = []
iroiro = 0
for i in range(n):
    if a[i] < 1600:
        if a[i] < 800:
            if a[i] < 400:
                color[1].append(a[i])
            else:
                color[2].append(a[i])
        else:
            if a[i] < 1200:
                color[3].append(a[i])
            else:
                color[4].append(a[i])
    else:
        if a[i] < 2400:
            if a[i] < 2000:
                color[5].append(a[i])
            else:
                color[6].append(a[i])
        else:
            if a[i] < 2800:
                color[7].append(a[i])
            elif 2800 <= a[i] < 3200:
                color[8].append(a[i])
            else:
                suki.append(a[i])

for k in color.keys():
    if len(color[k]) != 0:
        iroiro += 1
    else:
        pass
Co = len(suki)
ans = iroiro + Co
print(iroiro,ans)

Submission status: Wrong Answer

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

color = {1:[],2:[], 3:[],4:[],5:[],6:[],7:[],8:[]}
suki = []
iroiro = 0
for i in range(n):
    if a[i] < 1600:
        if a[i] < 800:
            if a[i] < 400:
                color[1].append(a[i])
            else:
                color[2].append(a[i])
        else:
            if a[i] < 1200:
                color[3].append(a[i])
            else:
                color[4].append(a[i])
    else:
        if a[i] < 2400:
            if a[i] < 2000:
                color[5].append(a[i])
            else:
                color[6].append(a[i])
        else:
            if a[i] < 2800:
                color[7].append(a[i])
            elif 2800 <= a[i] < 3200:
                color[8].append(a[i])
            else:
                suki.append(a[i])

for k in color.keys():
    if len(color[k]) != 0:
        iroiro += 1
    else:
        pass
Co = len(suki)
ans = iroiro + Co
print(iroiro,ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=[]
for i in range(n):
    if a[i]<=399:
        c.append('0')
    elif a[i]<=799:
        c.append('1') 
    elif a[i]<=1199:
        c.append('2')
    elif a[i]<=1599:
        c.append('3')
    elif a[i]<=1999:
        c.append('4')
    elif a[i]<=2399:
        c.append('5')
    elif  a[i]<=2799:
        c.append('6')
    elif  a[i]<=3199:
        c.append('7')
x=n-len(c)
#3200以上の人数
c=list(set(c))
k=len(c)+x
print(len(c),k)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=[]
for i in range(n):
    if a[i]<=399:
        c.append('gray')
    elif a[i]<=799:
        c.append('br') 
    elif a[i]<=1199:
        c.append('green')
    elif a[i]<=1599:
        c.append('pb')
    elif a[i]<=1999:
        c.append('bl')
    elif a[i]<=2399:
        c.append('y')
    elif  a[i]<=2799:
        c.append('o')
    elif  a[i]<=3199:
        c.append('r')
x=n-len(c)
#3200以上の人数
c=list(set(c))
k=min(8,len(c)+x)
print(len(c),k)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=[]
for i in range(n):
    if a[i]<=399:
        c.append('glay')
    elif a[i]<=799:
        c.append('brown') 
    elif a[i]<=1199:
        c.append('green')
    elif a[i]<=1599:
        c.append('pblue')
    elif a[i]<=1999:
        c.append('blue')
    elif a[i]<=2399:
        c.append('yellow')
    elif  a[i]<=2799:
        c.append('orange')
    elif  a[i]<=3199:
        c.append('red')
x=n-len(c)
c=list(set(c))
k=len(c)+min(5,x)
print(len(c),k)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x)for x in input().split()]
array=[0]*9
def wake(x):
    if x<3200:
        array[x//400]+=1
    else:
        array[8]+=1
    return
for i in A:
    wake(i)
ans1=sum(1 for x in array[:-1]if x>0)
ans=8-array.count(0)
if array[8]==0:
    ans+=1
else:
    ans+=array[8]
    if ans>8:
        ans=8
if ans1==0:
    ans1+=1

print(ans1,ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x)for x in input().split()]
array=[0]*9
def wake(x):
    if x<400:
        array[0]+=1
    elif x<800:
        array[1]+=1
    elif x<1200:
        array[2]+=1
    elif x<1600:
        array[3]+=1
    elif x<2000:
        array[4]+=1
    elif x<2400:
        array[5]+=1
    elif x<2800:
        array[6]+=1
    elif x<3200:
        array[7]+=1
    else:
        array[8]+=1
    return
for i in A:
    wake(i)
ans1=sum(1 for x in array[:-1]if x>0)
ans=8-array.count(0)
if array[8]==0:
    ans+=1
else:
    ans+=array[8]
    if ans>8:
        ans=8
if ans1==0:
    ans1+=1

print(ans1,ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x)for x in input().split()]
array=[0]*9
def wake(x):
    if x<400:
        array[0]+=1
    elif x<800:
        array[1]+=1
    elif x<1200:
        array[2]+=1
    elif x<1600:
        array[3]+=1
    elif x<2000:
        array[4]+=1
    elif x<2400:
        array[5]+=1
    elif x<2800:
        array[6]+=1
    elif x<3200:
        array[7]+=1
    else:
        array[8]+=1
    return
for i in A:
    wake(i)
ans1=sum(1 for x in array[:-1]if x>0)
ans=8-array.count(0)
if array[8]==0:
    ans+=1
    ans1+=1
else:
    ans+=array[8]
    if ans>8:
        ans=8
if ans1==0:
    ans1+=1

print(ans1,ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x)for x in input().split()]
array=[0]*9
def wake(x):
    if x<400:
        array[0]+=1
    elif x<800:
        array[1]+=1
    elif x<1200:
        array[2]+=1
    elif x<1600:
        array[3]+=1
    elif x<2000:
        array[4]+=1
    elif x<2400:
        array[5]+=1
    elif x<2800:
        array[6]+=1
    elif x<3200:
        array[7]+=1
    else:
        array[8]+=1
    return
for i in A:
    wake(i)
ans1=8-array.count(0)
ans=8-array.count(0)
if array[8]==0:
    ans+=1
    ans1+=1
else:
    ans+=array[8]
    if ans>8:
        ans=8
if ans1==0:
    ans1+=1

print(ans1,ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x)for x in input().split()]
array=[0]*9
def wake(x):
    if x<400:
        array[0]+=1
    elif x<800:
        array[1]+=1
    elif x<1200:
        array[2]+=1
    elif x<1600:
        array[3]+=1
    elif x<2000:
        array[4]+=1
    elif x<2400:
        array[5]+=1
    elif x<2800:
        array[6]+=1
    elif x<3200:
        array[7]+=1
    else:
        array[8]+=1
    return
for i in A:
    wake(i)
ans1=8-array.count(0)
ans=8-array.count(0)
if array[8]==0:
    ans+=1
    ans1+=1
else:
    for j in range(8):
        if array[j]==0:
            array[j]+=1
            array[8]-=1
            ans+=1
        if array[8]==0:
            break
if ans1==0:
    ans1+=1

print(ans1,ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x)for x in input().split()]
array=[0]*9
def wake(x):
    if x<400:
        array[0]+=1
    elif x<800:
        array[1]+=1
    elif x<1200:
        array[2]+=1
    elif x<1600:
        array[3]+=1
    elif x<2000:
        array[4]+=1
    elif x<2400:
        array[5]+=1
    elif x<2800:
        array[6]+=1
    elif x<3200:
        array[7]+=1
    else:
        array[8]+=1
    return
for i in A:
    wake(i)
ans1=8-array.count(0)
ans=8-array.count(0)
if array[8]==0:
    ans+=1
    ans1+=1
else:
    for j in range(8):
        if array[j]==0:
            array[j]+=1
            array[8]-=1
            ans+=1
        if array[8]==0:
            break


print(ans1,ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x)for x in input().split()]
array=[0]*9
def wake(x):
    if x<400:
        array[0]+=1
    elif x<800:
        array[1]+=1
    elif x<1200:
        array[2]+=1
    elif x<1600:
        array[3]+=1
    elif x<2000:
        array[4]+=1
    elif x<2400:
        array[5]+=1
    elif x<2800:
        array[6]+=1
    elif x<3200:
        array[7]+=1
    else:
        array[8]+=1
    return
for i in A:
    wake(i)
ans1=8-array.count(0)
ans=8-array.count(0)
if array[8]==0:
    ans+=1
    ans1+=1
while array[8]>0:
    for j in range(8):
        if array[8]==0:
            break
        if array[j]==0:
            array[j]+=1
            array[8]-=1
            ans+=1


print(ans1,ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x)for x in input().split()]
array=[0]*9
def wake(x):
    if x<400:
        array[0]+=1
    elif x<800:
        array[1]+=1
    elif x<1200:
        array[2]+=1
    elif x<1600:
        array[3]+=1
    elif x<2000:
        array[4]+=1
    elif x<2400:
        array[5]+=1
    elif x<2800:
        array[6]+=1
    elif x<3200:
        array[7]+=1
    else:
        array[8]+=1
    return
for i in A:
    wake(i)
ans1=8-array.count(0)
ans=8-array.count(0)
if array[8]==0:
    ans+=1
    ans1+=1
while array[8]>0:
    for j in range(8):
        if array[8]==0:
            break
        if array[j]==0:
            print(j)
            array[j]+=1
            array[8]-=1
            ans+=1


print(ans1,ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
scorelist = list(map(int, input().split(" ")))
color1 = len(list([int(i/400) for i in scorelist if i < 3200]))
color2 = len([i for i in scorelist if i >= 3200])
ans_min = max(1, color1)
ans_max = color1 + color2
print("{} {}".format(ans_min, ans_max))

Submission status: Wrong Answer

Solution code:
N=int(input())
rates=list(map(int,input().split()))
colors=[]
over3200=0
for n in range(0,N):
    color=rates[n]//400
    if color<8:
        if not color in colors:
            colors.append(color)
    else:
        over3200+=1
if len(colors)==0:
    Min=1
else:
    Min=len(colors)
if len(colors)+over3200>8:
    Max=8
else:
    Max=len(colors)+over3200
print(Min,Max)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
chk = []
ans = [0]*2
if a[0] >= 3200:
  print('1 1')
else:
  for i in range(n):
    if a[i] < 400:
      chk.append('hai')
    elif 399 < a[i] < 800:
      chk.append('cha')
    elif 799 < a[i] < 1200:
      chk.append('mi')
    elif 1199 < a[i] < 1600:
      chk.append('miz')
    elif 1599 < a[i] < 2000:
      chk.append('ao')
    elif 1999 < a[i] < 2400:
      chk.append('ki')
    elif 2399 < a[i] < 2800:
      chk.append('dai')
    elif 2799 < a[i] < 3200:
      chk.append('aka')
    else:
      ans[1] += 1
  if 'hai' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'cha' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'mi' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'miz' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'ao' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'ki' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'aka' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'dai' in chk:
    ans[0] += 1
    ans[1] += 1
  print(' '.join(map(str,ans)))

Submission status: Wrong Answer

Solution code:
L = [0] * 8
n = int(input())
A = list(map(int, input().split()))
t = 0


for i in A:
    if i < 3200:
        a = i//400
        L[a] += 1
    else:
        t += 1
 
c = 0
for i in L:
    if i!= 0:
        c += 1
max_num = max(c, 1)
min_num = c
print(max_num,min_num)

Submission status: Wrong Answer

Solution code:
L = [0] * 8
n = int(input())
A = list(map(int, input().split()))
t = 0


for i in A:
    if i < 3200:
        a = i//400
        L[a] += 1
    else:
        t += 1
 
c = 0
for i in L:
    if i!= 0:
        c += 1
max_num = max(c, 1)
min_num = c+1
print(max_num,min_num)

Submission status: Wrong Answer

Solution code:
n = int(input())

def convert_color(rate):
    if rate >= 1 and rate <= 399:
        return 0
    if rate >= 400 and rate <= 799:
        return 1
    if rate >= 800 and rate <= 1199:
        return 2
    if rate >= 1200 and rate <= 1599:
        return 3
    if rate >= 1600 and rate <= 1999:
        return 4
    if rate >= 2000 and rate <= 2399:
        return 5
    if rate >= 2400 and rate <= 2799:
        return 6
    if rate >= 2800 and rate <= 3199:
        return 7
    if rate >= 3200:
        return 100


a_L = list(map(int,input().split()))
a_L = sorted(a_L)

flag = False
ans = []

ov = 0
for i in a_L:
    if i>= 3200:
        ov += 1
        continue
    ans.append(convert_color(i))

num = len(set(ans))
max_num =  num
if ov != 0:
    for _ in range(ov):
        if max_num <= 7:
            max_num += 1

min_num = num
print(min_num,max_num)

Submission status: Wrong Answer

Solution code:
n = int(input())

def convert_color(rate):
    if rate >= 1 and rate <= 399:
        return 0
    if rate >= 400 and rate <= 799:
        return 1
    if rate >= 800 and rate <= 1199:
        return 2
    if rate >= 1200 and rate <= 1599:
        return 3
    if rate >= 1600 and rate <= 1999:
        return 4
    if rate >= 2000 and rate <= 2399:
        return 5
    if rate >= 2400 and rate <= 2799:
        return 6
    if rate >= 2800 and rate <= 3199:
        return 6
    if rate >= 3200:
        return 100


a_L = list(map(int,input().split()))
a_L = sorted(a_L)

flag = False
ans = []

ov = 0
for i in a_L:
    if i>= 3200:
        ov += 1
        continue
    ans.append(convert_color(i))

num = len(set(ans))
#print("ov",ov)
max_num =  num
if ov != 0:
    for _ in range(ov):
        if max_num <= 8:
            max_num += 1

min_num = num
print(min_num,max_num)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x:x//400,A))
#print(A)
C = [0]*9
for a in A:
  if a>=8:
    C[8] +=1
  elif C[a]==0:
    C[a] = 1
#print(C[:-1])
mi = sum(C[:-1])
mini = mi
if mi == 0:
  mini = min(1,C[-1])
ma = min(8,mi+C[-1])
print(mini,ma)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x:x//400,A))
C = [0]*9
for a in A:
  if a>=8:
    C[8] +=1
  elif C[a]==0:
    C[a] = 1
mi = sum(C[:-1])
ma = min(8,mi+C[-1])
print(mi,ma)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
c = [0] * 9
for i in a:
    if i < 3200:
        c[i // 400] += 1
    else:
        c[8] += 1
ans = 0
for i in range(8):
    if c[i] != 0:
        ans += 1
print(ans, ans + c[8])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# Problem C - Colorful Leaderboard

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

# initialization
kanmuri_count = {
    "king": 0
}

# count process
for a in a_list:
    if a<400 and not "gray" in kanmuri_count:
        kanmuri_count["gray"] = 1
    elif a>=400 and a<800 and not "brown" in kanmuri_count:
        kanmuri_count["brown"] = 1
    elif a>=800 and a<1200 and not "green" in kanmuri_count:
        kanmuri_count["green"] = 1
    elif a>=1200 and a<1600 and not "cyan" in kanmuri_count:
        kanmuri_count["cyan"] = 1
    elif a>=1600 and a<2000 and not "blue" in kanmuri_count:
        kanmuri_count["blue"] = 1
    elif a>=2000 and a<2400 and not "yellow" in kanmuri_count:
        kanmuri_count["yellow"] = 1
    elif a>=2400 and a<2800 and not "orange" in kanmuri_count:
        kanmuri_count["orange"] = 1
    elif a>=2800 and a<3200 and not "red" in kanmuri_count:
        kanmuri_count["red"] = 1
    elif a>=3200:
        kanmuri_count["king"] += 1

# output process
cur_clount = len(kanmuri_count) - 1
ans = cur_clount + kanmuri_count["king"]
print("%d %d"%(cur_clount, ans))

Submission status: Wrong Answer

Solution code:
B = [0] * 8
n = int(input())
A = list(map(int, input().split()))
t = 0
for i in A:
    if i < 3200:
        a = i//400
        B[a] += 1
    else:
        t += 1

c = 0
for i in B:
    if i!= 0:
        c += 1

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

Submission status: Wrong Answer

Solution code:
B = [0] * 9
n = int(input())
A = list(map(int, input().split()))
t = 0
for i in A:
    if i < 3200:
        a = i//400
        B[a] += 1
    else:
        t += 1

c = 0
for i in B:
    if i!= 0:
        c += 1

print(c, min(c+t, 8))