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())
rate=[0]*8
tourist=0
a=list(map(int,input().split()))
for i in a:
  if 1<=i<399:
    rate[0]+=1
  elif 400<=i<=799:
    rate[1]+=1
  elif 800<=i<=1199:
    rate[2]+=1
  elif 1200<=i<=1599:
    rate[3]+=1
  elif 1600<=i<=1999:
    rate[4]+=1
  elif 2000<=i<=2399:
    rate[5]+=1
  elif 2400<=i<=2799:
    rate[6]+=1
  elif 2800<=i<=3199:
    rate[7]+=1
  elif i<=3200:
    tourist+=1
print(max(8-rate.count(0),1),max(1,8-rate.count(0)+tourist))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
rate=[0]*8
tourist=0
a=list(map(int,input().split()))
for i in range(N):
  if 1<=i<399:
    rate[0]+=1
  elif 400<=i<=799:
    rate[1]+=1
  elif 800<=i<=1199:
    rate[2]+=1
  elif 1200<=i<=1599:
    rate[3]+=1
  elif 1600<=i<=1999:
    rate[4]+=1
  elif 2000<=i<=2399:
    rate[5]+=1
  elif 2400<=i<=2799:
    rate[6]+=1
  elif 2800<=i<=3199:
    rate[7]+=1
  elif i<=3200:
    tourist+=1
print(max(8-rate.count(0),1),min(8-rate.count(0)+tourist,8))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

color = [0,0,0,0,0,0,0,0,0]

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


min_col = color[:]
min_cnt = 0
del min_col[-1]
for i in range(len(min_col)):
    if min_col[i] != 0:
        min_cnt += 1

max_cnt = min(min_cnt + color[8],8)
min_cnt = max(1,min_cnt)

print(min_cnt, max_cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

color = [0,0,0,0,0,0,0,0,0]

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


min_col = color[:]
min_cnt = 0
del min_col[-1]
for i in range(len(min_col)):
    if min_col[i] != 0:
        min_cnt += 1
min_cnt = max(1,min_cnt)

max_cnt = min(min_cnt + color[8],8)

print(min_cnt, max_cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

color = [0,0,0,0,0,0,0,0,0]

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


min_col = color[:]
min_cnt = 0
del min_col[-1]
for i in range(len(min_col)):
    if min_col[i] != 0:
        min_cnt += 1

max_cnt = min(min_cnt + color[8],8)

print(min_cnt, max_cnt)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
dic, c = {}, 0
for i in range(N):
    b = min(a[i] // 400, 8)
    if b not in dic:
        dic[b] = 1
    if b == 8:
        c += 1
m, M = len(dic.keys()), len(dic.keys())
if c > 0:
    m -= 1
    M += c - 1
print(m, M)

Submission status: Wrong Answer

Solution code:
def f(x):
    if x < 400:
        return 0
    elif x < 800:
        return 1
    elif x < 1200:
        return 2
    elif x < 1600:
        return 3
    elif x < 2000:
        return 4
    elif x < 2400:
        return 5
    elif x < 2800:
        return 6
    elif x < 3200:
        return 7
    else:
        return 8

import sys
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
dic, c = {}, 0
for i in range(N):
    b = f(a[i])
    if b not in dic:
        dic[b] = 1
    if b == 8:
        c += 1
m, M = len(dic.keys()), len(dic.keys())
if 8 in dic:
    m -= 1
    M += dic[8]
print(m, M)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int, input().split()))
counter=[0]*9

for a in A:
  cls=min(a//400, 8)
  #print(a, cls)
  if cls>=8:
    counter[8]+=1
  else:
    counter[cls]=1
#print(counter)

#min
print(max(1, sum(counter[0:8])), min(8, sum(counter[0:8])+counter[8]))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
ls = [0]*9
b = [1,400,800,1200,1600,2000,2400,2800,3200,4801]
for i in range(N):
    for j, (x, y) in enumerate(zip(b, b[1:])):
        if x <= a[i] and a[i] < y:
            ls[j] += 1
l = 8 - ls[:-1].count(0)
if l == 0:
    print(1, min(8, ls[-1]))
else:
    print(l, min(8, l+ls[-1]))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
ls = [0]*9
b = [1,400,800,1200,1600,2000,2400,2800,3200,4801]
for i in range(N):
    for j, (x, y) in enumerate(zip(b, b[1:])):
        if x <= a[i] and a[i] < y:
            ls[j] += 1
l = 8 - ls[:-1].count(0)
if l == 0:
    if ls[-1] >= 8:
        print(1, 8)
    else:
        print(1, ls[-1])
else:
    if l+ls[-1] >= 8:
        print(l, 8)
    else:
        print(l, l+ls[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
ls = [0]*9
b = [1,400,800,1200,1600,2000,2400,2800,3200,4801]
for i in range(N):
    for j, (x, y) in enumerate(zip(b, b[1:])):
        if x <= a[i] and a[i] < y:
            ls[j] += 1
l = 8 - ls[:-1].count(0)
if l == 0:
    if ls[-1] >= 8:
        print(1, 8)
    else:
        print(1, ls[-1])
else:
    if ls[-1] >= ls[:-1].count(0):
        print(l, 8)
    else:
        print(l, l+ls[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
ls = [0]*9
b = [1,400,800,1200,1600,2000,2400,2800,3200,4801]
for i in range(N):
    for j, (x, y) in enumerate(zip(b, b[1:])):
        if x <= a[i] and a[i] < y:
            ls[j] += 1
l = 8 - ls[:-1].count(0)
h = l + min(ls[:-1].count(0), ls[-1])
print(l, h)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
a = list(map(int, input().split()))
late = Counter(list(map(lambda a: a//400, a)))

count = 0
for key in [0,1,2,3,4,5,6,7]:
    if late[key] == 0:
        count += 1

max_a = min_a = 8-count
n = late[8] + late[9] + late[10] + late[11] + late[12]
if n and not min_a:
    min_a = 1

if n:
    max_a = min(max_a+n, 8)

print(min_a, max_a)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
a = list(map(int, input().split()))
late = Counter(list(map(lambda a: a//400, a)))

count = 0
for key in [0,1,2,3,4,5,6,7]:
    if late[key] == 0:
        count += 1

max_a = min_a = 8-count
if late[8] and not min_a:
    min_a = 1

if late[8]:
    max_a = min(max_a+late[8], 8)

print(min_a, max_a)

Submission status: Wrong Answer

Solution code:
def colorful_leaderboard(N: int, A: list)->tuple:
    rates = {
        '0001-0399': False,
        '0400-0799': False,
        '0800-1199': False,
        '1200-1599': False,
        '1600-1999': False,
        '2000-2399': False,
        '2400-2799': False,
        '2800-3199': False,
    }
    wildcard = 0

    for a in A:
        if a < 400:
            rates['0001-0399'] = True
        elif a < 800:
            rates['0400-0799'] = True
        elif a < 1200:
            rates['0800-1199'] = True
        elif a < 1600:
            rates['1200-1599'] = True
        elif a < 2000:
            rates['1600-1999'] = True
        elif a < 2400:
            rates['2000-2399'] = True
        elif a < 2800:
            rates['2400-2799'] = True
        elif a < 3200:
            rates['2800-3299'] = True
        else:
            wildcard += 1

    return sum(rates.values()), sum(rates.values()) + wildcard


if __name__ == "__main__":
    N = int(input())
    A = [int(s) for s in input().split()]
    min_c, max_c = colorful_leaderboard(N, A)
    print(min_c, max_c)

Submission status: Wrong Answer

Solution code:
def colorful_leaderboard(N: int, A: list)->tuple:
    rates = {
        '0001-0399': False,
        '0400-0799': False,
        '0800-1199': False,
        '1200-1599': False,
        '1600-1999': False,
        '2000-2399': False,
        '2400-2799': False,
        '2800-3199': False,
    }
    wildcard = 0

    for a in A:
        if a < 400:
            rates['0001-0399'] = True
        elif a < 800:
            rates['0400-0799'] = True
        elif a < 1200:
            rates['0800-1199'] = True
        elif a < 1600:
            rates['1200-1599'] = True
        elif a < 2000:
            rates['1600-1999'] = True
        elif a < 2400:
            rates['2000-2399'] = True
        elif a < 2800:
            rates['2400-2799'] = True
        elif a < 3200:
            rates['2800-3299'] = True
        else:
            wildcard += 1

    return sum(rates.values()), min(sum(rates.values()) + wildcard, 8)


if __name__ == "__main__":
    N = int(input())
    A = [int(s) for s in input().split()]
    min_c, max_c = colorful_leaderboard(N, A)
    print(min_c, max_c)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a_list = list(map(int, input().split()))
class_list = []
free_list = []
for a in a_list:  
  if a < 3200:
    amod = a // 400
    class_list.append(amod)
  
  else:
    free_list.append(a)

set_list = list(set(class_list))

print(len(set_list), len(set_list) + len(free_list))

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a_list = list(map(int, input().split()))
class_list = []
free_list = []
for a in a_list:  
  if a < 3200:
    amod = a // 400
    class_list.append(amod)
  
  else:
    free_list.append(a)

print(class_list)
print(free_list)

set_list = list(set(class_list))

print(len(set_list), len(set_list) + len(free_list))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
rate = [0]*8
red = 0
for i in range(n) :
  if(a[i] == 0) :
    continue
  elif(a[i] >= 3200) :
    red += 1
  elif(rate[a[i]//400] == 0) : 
    rate[a[i]//400] += 1
print("{} {}".format(sum(rate), sum(rate)+red))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
rate = [0]*8
red = 0
for i in range(n) :
  if(a[i] >= 3200) :
    red += 1
  elif(rate[a[i]//400] == 0) : 
    rate[a[i]//400] += 1
print("{} {}".format(sum(rate), sum(rate)+red))

Submission status: Wrong Answer

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

array1 = [0] * 8
over3200 = 0

for i in range(N):
  if 0 < a[i] < 400:
    array1[0] = 1
  elif 400 <= a[i] < 800:
    array1[1] = 1
  elif 800 <= a[i] < 1200:
    array1[2] = 1
  elif 1200 <= a[i] < 1600:
    array1[3] = 1
  elif 1600 <= a[i] < 2000:
    array1[4] = 1
  elif 2000 <= a[i] < 2400:
    array1[5] = 1
  elif 2400 <= a[i] < 2800:
    array1[6] = 1
  elif 2800 <= a[i] < 3200:
    array1[7] = 1
  else:
    over3200 += 1
A = array1.count(1)
B = array1.count(0)

ansmax = A + min(over3200, B)
ansmin = max(A, 1)
    
print(ansmin, ansmax)

Submission status: Wrong Answer

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

array1 = [0] * 8
over3200 = 0

for i in range(N):
  if 0 < a[i] < 400:
    array1[0] = 1
  elif 400 <= a[i] < 800:
    array1[1] = 1
  elif 800 <= a[i] < 1200:
    array1[2] = 1
  elif 1200 <= a[i] < 1600:
    array1[3] = 1
  elif 1600 <= a[i] < 2000:
    array1[4] = 1
  elif 2000 <= a[i] < 2400:
    array1[5] = 1
  elif 2400 <= a[i] < 2800:
    array1[6] = 1
  elif 2800 <= a[i] < 3200:
    array1[7] = 1
  else:
    over3200 += 1
A = array1.count(1)
B = array1.count(0)

ansmax = A + min(over3200, B)
if 1 <= A:
  ansmin = A
else:
  ansmin = 1
    
print(ansmin, ansmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
tourist = 0
human = [0 for i in range(8)]
for i in range(N):
    if a[i] >= 3200:
        tourist += 1
        continue
    else: human[a[i]//400] += 1
color = sum([1 for i in human if i > 0])
print(str(color)+' '+str(color+tourist))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
tourist = 0
human = [0 for i in range(8)]
for i in range(N):
    if a[i] >= 3200:
        tourist += 1
        continue
    else: human[a[i]//400] += 1
color = sum([1 for i in human if i > 0])
print(str(color)+' '+str(min(color+tourist,8)))

Submission status: Wrong Answer

Solution code:
n=int(input())

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

ov=0
res=0
C=[0]*8

for i in A:
    if 1<=i and i<400:
        C[0]+=1
    elif 400<=i and i<800:
        C[1]+=1
    elif 800<=i and i<1200:
        C[2]+=1
    elif 1200<=i and i<1600:
        C[3]+=1
    elif 1600<=i and i<2000:
        C[4]+=1
    elif 2000<=i and i<2400:
        C[5]+=1        
    elif 2400<=i and i<2800:
        C[6]+=1
    elif 2800<=i and i<3200:
        C[7]+=1
    else:
        ov+=1

for j in C:
    if j!=0:
        res+=1

print(str(res)+' '+str(res+ov))

Submission status: Wrong Answer

Solution code:
n=int(input())

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

ov=0
res=0
C=[0]*8

for i in A:
    if 1<=i and i<400:
        C[0]+=1
    elif 400<=i and i<800:
        C[1]+=1
    elif 800<=i and i<1200:
        C[2]+=1
    elif 1200<=i and i<1600:
        C[3]+=1
    elif 1600<=i and i<2000:
        C[4]+=1
    elif 2000<=i and i<2400:
        C[5]+=1        
    elif 2400<=i and i<2800:
        C[6]+=1
    elif 2800<=i and i<3200:
        C[7]+=1
    else:
        ov+=1

for j in C:
    if j!=0:
        res+=1

if res+ov>8:
    print(str(res)+' '+str(8))
else:
    print(str(res)+' '+str(res+ov))

Submission status: Wrong Answer

Solution code:
n=int(input())

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

ov=0
res=0
C=[0]*8

for i in A:
    if 1<=i and i<400:
        C[0]+=1
    elif 400<=i and i<800:
        C[1]+=1
    elif 800<=i and i<1200:
        C[2]+=1
    elif 1200<=i and i<1600:
        C[3]+=1
    elif 1600<=i and i<2000:
        C[4]+=1
    elif 2000<=i and i<2400:
        C[5]+=1        
    elif 2400<=i and i<2800:
        C[6]+=1
    elif 2800<=i and i<3200:
        C[7]+=1
    else:
        ov+=1

for j in C:
    if j!=0:
        res+=1

if res+ov>8:
    print(8)
else:
    print(res+ov)

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
a = [x // 400 for x in map(int, input().split())]
c = []
ans = 0
for i in a:
    if i > 7:
        ans += 1
    else:
        c.append(i)
print(len(Counter(c)), ans + len(Counter(c)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
rate=[0]*10;cnt=0
lena=[0]*10
for i in range(n):
    if 1<=a[i]<=399:
        rate[0]=1
        lena[0]=1
    elif 400<=a[i]<=799:
        rate[1]=1
        lena[1]=1
    elif 800<=a[i]<=1199:
        rate[2]=1
        lena[2]=1
    elif 1200<=a[i]<=1599:
        rate[3]=1
        lena[3]=1
    elif 1600<=a[i]<=1999:
        rate[4]=1
        lena[4]=1
    elif 2000<=a[i]<=2399:
        rate[5]=1
        lena[5]=1
    elif 2400<=a[i]<=2799:
        rate[6]=1
        lena[6]=1
    elif 2800<=a[i]<=3199:
        rate[7]=1
        lena[7]=1
    else:
        cnt+=1
m=sum(rate)
if m==0:
    m=1
print(m,m+cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
rate=[0]*10;cnt=0
lena=[0]*10
for i in range(n):
    if 1<=a[i]<=399:
        rate[0]=1
        lena[0]=1
    elif 400<=a[i]<=799:
        rate[1]=1
        lena[1]=1
    elif 800<=a[i]<=1199:
        rate[2]=1
        lena[2]=1
    elif 1200<=a[i]<=1599:
        rate[3]=1
        lena[3]=1
    elif 1600<=a[i]<=1999:
        rate[4]=1
        lena[4]=1
    elif 2000<=a[i]<=2399:
        rate[5]=1
        lena[5]=1
    elif 2400<=a[i]<=2799:
        rate[6]=1
        lena[6]=1
    elif 2800<=a[i]<=3199:
        rate[7]=1
        lena[7]=1
    else:
        cnt+=1
m=sum(rate)
print(m,m+cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
rate=[0]*8;cnt=0
lena=[0]*8
for i in range(n):
    if 1<=a[i]<=399:
        rate[0]=1
        lena[0]=1
    elif 400<=a[i]<=799:
        rate[1]=1
        lena[1]=1
    elif 800<=a[i]<=1199:
        rate[2]=1
        lena[2]=1
    elif 1200<=a[i]<=1599:
        rate[3]=1
        lena[3]=1
    elif 1600<=a[i]<=1999:
        rate[4]=1
        lena[4]=1
    elif 2000<=a[i]<=2399:
        rate[5]=1
        lena[5]=1
    elif 2400<=a[i]<=2799:
        rate[6]=1
        lena[6]=1
    else:
        cnt+=1
m=sum(rate)
print(m,m+cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
rate=[0]*10;cnt=0
lena=[0]*10
for i in range(n):
    if 1<=a[i]<=399:
        rate[0]=1
        lena[0]=1
    elif 400<=a[i]<=799:
        rate[1]=1
        lena[1]=1
    elif 800<=a[i]<=1199:
        rate[2]=1
        lena[2]=1
    elif 1200<=a[i]<=1599:
        rate[3]=1
        lena[3]=1
    elif 1600<=a[i]<=1999:
        rate[4]=1
        lena[4]=1
    elif 2000<=a[i]<=2399:
        rate[5]=1
        lena[5]=1
    elif 2400<=a[i]<=2799:
        rate[6]=1
        lena[6]=1
    elif 2800<=a[i]<=3199:
        rate[7]=1
        lena[7]=1
    else:
        cnt+=1
m=sum(rate)
print(m,min(m+cnt,8))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
rate=[0]*8;cnt=0
lena=[0]*8
for i in range(n):
    if 1<=a[i]<=399:
        rate[0]=1
        lena[0]=1
    elif 400<=a[i]<=799:
        rate[1]=1
        lena[1]=1
    elif 800<=a[i]<=1199:
        rate[2]=1
        lena[2]=1
    elif 1200<=a[i]<=1599:
        rate[3]=1
        lena[3]=1
    elif 1600<=a[i]<=1999:
        rate[4]=1
        lena[4]=1
    elif 2000<=a[i]<=2399:
        rate[5]=1
        lena[5]=1
    elif 2400<=a[i]<=2799:
        rate[6]=1
        lena[6]=1
    else:
        cnt+=1
m=sum(rate)
print(m,min(m+cnt,8))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400,A))
target=A.count(8)
total=len(set(A))
min=total-1 if 8 in A else total
print(min if min!=0 else 1,min+target)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400,A))
target=A.count(8)
total=len(set(A))
min=total-1 if 8 in A else total
print(min,min+target)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(_) for _ in input().split()]
color = [False]*8
overnum = 0

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

print(min(1, color.count(True)), color.count(True)+overnum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(_) for _ in input().split()]
color = [False]*8
overnum = 0

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

print(color.count(True), color.count(True)+overnum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
colors = [0 for i in range(9)]
for r in a:
    if r < 3200:
        colors[r // 400] += 1
    else:
        colors[8] += 1

num = 0
diff = colors[8]
for i in range(8):
    if colors[i]:
        num += 1
print(num, num + diff)

Submission status: Wrong Answer

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

L = [0 for i in range(9)] 

for i in A:
    if 1 <= i <= 399:
        L[0] += 1
    if 400 <= i <= 799:
        L[1] += 1
    if 800 <= i <= 1199:
        L[2] += 1
    if 1200 <= i <= 1599:
        L[3] += 1
    if 1600 <= i <= 1999:
        L[4] += 1
    if 2000 <= i <= 2399:
        L[5] += 1
    if 2400 <= i <= 2799:
        L[6] += 1
    if 2800 <= i <= 3199:
        L[7] += 1
    if 3200 <= i:
        L[8] += 1
        
count_0 = L[0:8].count(0)
count_not_0 = 8 - count_0
count_strong = L[8]

ans_max = min(8, count_not_0 + min(count_strong, count_0)) 
if count_0 == 0:
    if count_strong >= 1:
        ans_min = 1
    else:
        ans_min = 0
else:
    ans_min = count_not_0
    
    
print(ans_min, ans_max)

Submission status: Wrong Answer

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

L = [0 for i in range(9)] 

for i in A:
    if 1 <= i <= 399:
        L[0] += 1
    if 400 <= i <= 799:
        L[1] += 1
    if 800 <= i <= 1199:
        L[2] += 1
    if 1200 <= i <= 1599:
        L[3] += 1
    if 1600 <= i <= 1999:
        L[4] += 1
    if 2000 <= i <= 2399:
        L[5] += 1
    if 2400 <= i <= 2799:
        L[6] += 1
    if 2800 <= i <= 3199:
        L[7] += 1
    if 3200 <= i:
        L[8] += 1
        
count_0 = L[0:8].count(0)
count_not_0 = 8 - count_0
count_strong = L[8]

if count_not_0 == 0:
    if count_strong >= 1:
        print(1, min(count_strong, 8))
    else:
        print(0, 0)
else:
    if count_strong == 0:
        print(count_not_0, count_not_0)
    else:
        print(count_not_0, min(8, count_not_0 + min(count_0, count_strong)))

Submission status: Wrong Answer

Solution code:
N = int(input())

A = [int(i) for i in input().split()]

L = [0 for i in range(9)] 

for i in A:
    if 1 <= i <= 399:
        L[0] += 1
    if 400 <= i <= 799:
        L[1] += 1
    if 800 <= i <= 1199:
        L[2] += 1
    if 1200 <= i <= 1599:
        L[3] += 1
    if 1600 <= i <= 1999:
        L[4] += 1
    if 2000 <= i <= 2399:
        L[5] += 1
    if 2400 <= i <= 2799:
        L[6] += 1
    if 2800 <= i <= 3199:
        L[7] += 1
    if 3200 <= i:
        L[8] += 1
        
count_0 = L[0:8].count(0)
count_not_0 = 8 - count_0
count_strong = L[8]

if count_not_0 == 0:
    if count_strong >= 1:
        print(1, min(count_strong, 8))
    else:
        print(0, 0)
else:
    if count_strong == 0:
        print(count_not_0, count_not_0)
    else:
        print(count_not_0, min(8, count_not_0 + min(count_not_0, count_strong)))

Submission status: Wrong Answer

Solution code:
N = int(input())

A = [int(i) for i in input().split()]

L = [0 for i in range(9)] 

for i in A:
    if 1 <= i <= 399:
        L[0] += 1
    if 400 <= i <= 799:
        L[1] += 1
    if 800 <= i <= 1199:
        L[2] += 1
    if 1200 <= i <= 1599:
        L[3] += 1
    if 1600 <= i <= 1999:
        L[4] += 1
    if 2000 <= i <= 2399:
        L[5] += 1
    if 2400 <= i <= 2799:
        L[6] += 1
    if 2800 <= i <= 3199:
        L[7] += 1
    if 3200 <= i:
        L[8] += 1
        
count_0 = L[0:8].count(0)
count_not_0 = 8 - count_0
count_strong = L[8]

if count_strong == 0:
    print(count_not_0, count_not_0)
else:
    print(count_not_0, count_not_0 + min(2, min(count_not_0, count_strong)))

Submission status: Wrong Answer

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

L = [0 for i in range(9)] 

for i in A:
    if 1 <= i <= 399:
        L[0] += 1
    if 400 <= i <= 799:
        L[1] += 1
    if 800 <= i <= 1199:
        L[2] += 1
    if 1200 <= i <= 1599:
        L[3] += 1
    if 1600 <= i <= 1999:
        L[4] += 1
    if 2000 <= i <= 2399:
        L[5] += 1
    if 2400 <= i <= 2799:
        L[6] += 1
    if 28001 <= i <= 3199:
        L[7] += 1
    if 3200 <= i:
        L[8] += 1
        
count_0 = L[0:8].count(0)
count_strong = L[8]
if count_strong >= 1:
    print(8-count_0, 8-count_0+min(2, max(count_strong, count_0)))
else:
    print(8-count_0, 8-count_0)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
color=set()
free=0
for a in A:
    if a<3200:
        color|={a//400}
    else:
        free+=1
print(str(max(1,len(color)))+' '+str(min(8,len(color)+free)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
gray=[]
brown=[]
green=[]
skyblue=[]
blue=[]
yellow=[]
orange=[]
red=[]
for i in range(1,3200):
    if 0<i<400:
        gray.append(i)
    elif 399<i<800:
        brown.append(i)
    elif 799<i<1200:
        green.append(i)
    elif 1299<i<1600:
        skyblue.append(i)
    elif 1599<i<2000:
        blue.append(i)
    elif 1999<i<2400:
        yellow.append(i)
    elif 2399<i<2800:
        orange.append(i)
    else:
        red.append(i)
collor=[gray,brown,green,skyblue,blue,yellow,orange,red]
ans0=0
for i in range(len(collor)):
    if len(set(collor[i])&set(a))!=0:
        ans0+=1
cnt=0
for x in a:
    if x>=3200:
        cnt+=1
print(ans0,ans0+cnt)

Submission status: Wrong Answer

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

count = 0
for i in range(8):
    if len(list(filter(lambda x:i*400<=x and x<400*(i+1), a))) > 0:
        count+=1

x = len(list(filter(lambda x:3200<=x, a)))
if count==0:
    count=1
    x-=1

print("{} {}".format(count,min(8,count+x)))

Submission status: Wrong Answer

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

x = []
f = 0
for a in A:
    if a//400 < 8:
        x.append(a//400)
    else:
        f += 1
x = set(x)
l = len(x)
print(l,l+f)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))
A = [a//400 for a in A]
eight = A.count(8)
A = set(A)
l = len(A)
if 8 in A:
    print(l-1,l+eight-1)
else:
    print(l,l)

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)
maxnum = 0
minnim = 0
if (len(colors)+noncolor)>8:
    maxnum = 8
if (len(colors)+noncolor)<=8:
    maxnum = len(colors)+noncolor
if len(colors)>=1:
    minnim = len(colors)
if len(colors)==0:
    minnim = 1
print("{} {}".format(minnim,maxnum))

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)
maxnum = 0
minnim = 0
if (len(colors)+noncolor)>=8:
    maxnum = 8
if (len(colors)+noncolor)<8:
    maxnum = len(colors)+noncolor
if len(colors)>=1:
    minnim = len(colors)
if len(colors)==0:
    minnim = 1
print("{} {}".format(minnim,maxnum))