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:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(8)]
red = 0
for i in range(n):
    if a[i] < 400:
        color[0] = True
    elif 400<=a[i]<800:
        color[1] = True
    elif 800<=a[i]<1200:
        color[2] = True
    elif 1200<=a[i]<1600:
        color[3] = True
    elif 1600<=a[i]<2000:
        color[4] = True
    elif 2000<=a[i]<2400:
        color[5] = True
    elif 2400<=a[i]<2800:
        color[6] = True
    elif 2800<=a[i]<3200:
        color[7] = True
    else:
        red += 1
        
    c = color.count(True)
    if red + c <= 9:
        ma = red + c
        mi = c
    else:
        ma = 9
        mi = c
        
print(ma,mi)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = list(map(int,input().split()))
ans = [0]*8
x = 0

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

x += 8-ans.count(0)
if x > 8:
    x = 8
print(8-ans.count(0), x)

Submission status: Wrong Answer

Solution code:
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
arrA = np.array(input().split(),dtype=np.int64)
bins = np.array([400,800,1200,1600,2000,2400,2800,3200,4801])
arr = np.digitize(arrA,bins)
ans = np.bincount(arr,minlength=9)
ans1 = len(ans[:-1][ans[:-1]>0])
ans2 = min(ans1 + ans[-1],8)
if ans1 == 0:
    ans1 = 1
print(ans1,ans2)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Wrong Answer

Solution code:
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
arrA = np.array(input().split(),dtype=np.int64)
bins = np.array([1,400,800,1200,1600,2000,2400,2800,3200,4801])
arr = np.digitize(arrA,bins)
ans = np.bincount(arr,minlength=9)
ans1 = len(ans[:-1][ans[:-1]>0])
ans2 = min(ans1 + ans[-1],8)
if ans1 == 0 and ans[-1]>0:
    ans1 = 1
print(ans1,ans2)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Wrong Answer

Solution code:
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
arrA = np.array(input().split(),dtype=np.int64)
bins = np.array([1,400,800,1200,1600,2000,2400,2800,3200,4801])
arr = np.digitize(arrA,bins)
ans = np.bincount(arr,minlength=9)
ans1 = len(ans[:-1][ans[:-1]>0])
ans2 = min(ans1 + ans[-1],8)
print(ans1,ans2)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
ans = 0
cnt_free = sum(x >= 3200 for x in a)
for i in range(8):
    if sum(x >= 400 * i and x < 400 * (i + 1) for x in a) >= 1:
        ans += 1
print(max(1, ans))
print(min(8, ans + cnt_free))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
ans = 0
cnt_free = sum(x >= 3200 for x in a)
for i in range(8):
    if sum(x >= 400 * i and x < 400 * (i + 1) for x in a) >= 1:
        ans += 1
print(ans)
print(min(8, ans + cnt_free))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
rate_cnt = defaultdict(int)
for i in range(n):
    if a[i] >= 3200:
        rate_cnt["free"] += 1
    elif a[i] >= 2800:
        rate_cnt["red"] += 1
    elif a[i] >= 2400:
        rate_cnt["orange"] += 1
    elif a[i] >= 2000:
        rate_cnt["yellow"] += 1
    elif a[i] >= 1600:
        rate_cnt["blue"] += 1
    elif a[i] >= 1200:
        rate_cnt["l_blue"] += 1
    elif a[i] >= 800:
        rate_cnt["green"] += 1
    elif a[i] >= 400:
        rate_cnt["blown"] += 1
    else:
        rate_cnt["ash"] += 1

color_cnt = len(rate_cnt)
if "free" in rate_cnt:
    color_cnt -= 1
print(color_cnt)
print(min(color_cnt + rate_cnt["free"], 8))

Submission status: Wrong Answer

Solution code:
def myAnswer(N:int,A:list) -> int:
   counter = 0
   free = 0
   rate = [0 for _ in range(8)]
   for a in A:
      if(a <= 399):
         rate[0] += 1
      elif(a <= 799):
         rate [1] += 1
      elif(a <= 1199):
         rate[2] += 1
      elif(a <= 1599):
         rate[3] += 1
      elif(a <= 1999):
         rate[4] += 1
      elif(a <= 2399):
         rate[5] += 1
      elif(a <= 2799):
         rate[6] += 1
      elif(a <= 3199):
         rate[7] += 1
      else:
         free += 1
   for r in rate:
      if(r > 0):
         counter += 1
   if(counter == 0 and free > 0):
      MIN = 1
   else:
      MIN = counter

   print(MIN,min(counter+free,8))


def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   myAnswer(N,A[:])
if __name__ == '__main__':
   main()

Submission status: Wrong Answer

Solution code:

def myAnswer(N:int,A:list) -> int:
   counter = 0
   free = 0
   rate = [0 for _ in range(8)]
   for a in A:
      if(a <= 399):
         rate[0] += 1
      elif(a <= 799):
         rate [1] += 1
      elif(a <= 1199):
         rate[2] += 1
      elif(a <= 1599):
         rate[3] += 1
      elif(a <= 1999):
         rate[4] += 1
      elif(a <= 2399):
         rate[5] += 1
      elif(a <= 2799):
         rate[6] += 1
      elif(a <= 3199):
         rate[7] += 1
      else:
         free += 1
   for r in rate:
      if(r > 0):
         counter += 1
   print(counter,min(counter+free,8))


def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   myAnswer(N,A[:])
if __name__ == '__main__':
   main()

Submission status: Wrong Answer

Solution code:
def GetColor(point):
   color = point//400
   if color>=8:
      color = -1
   return color

N = int(input())
A = map(int,input().split())
Nc = [0 for i in range(9)]
for ai in A:
   Nc[GetColor(ai)]+=1

Nf = Nc[-1]
Ans = 0
for ic in range(len(Nc)-1):
   if Nc[ic]>0:
      Ans+=1
maxNc = min(Ans+Nf, 8)
minNc = max(1,Ans)
print("%d %d"%(minNc,maxNc))

Submission status: Wrong Answer

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()

l = [0]*9
for i in A:
    l[min(i//400,8)] += 1

lf = l[:-1]
ans = 8-lf.count(0)
print(ans,ans+l[8])

Submission status: Wrong Answer

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

def main():
    N = int(readline())
    A = list(map(int, readline().rstrip().split()))
    cnt = {k: 0 for k in ['gray', 'brown', 'green', 'light_blue', 'blue', 'yellow', 'orange', 'red', 'free']}
    for a in A:
        if a < 400:
            cnt['gray'] += 1
        elif a < 800:
            cnt['brown'] += 1
        elif a < 1200:
            cnt['green'] += 1
        elif a < 1600:
            cnt['light_blue'] += 1
        elif a < 2000:
            cnt['blue'] += 1
        elif a < 2400:
            cnt['yellow'] += 1
        elif a < 2800:
            cnt['orange'] += 1
        elif a < 3200:
            cnt['gray'] += 1
        else:
            cnt['free'] += 1

    mi = 0
    for k, v in zip(cnt.keys(), cnt.values()):
        if k == 'free':
            continue
        if v:
            mi += 1
    ma = mi + cnt['free']
    print(max(1, mi), ma)    


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def main():
    N = int(readline())
    A = list(map(int, readline().rstrip().split()))
    cnt = {k: 0 for k in ['gray', 'brown', 'green', 'light_blue', 'blue', 'yellow', 'orange', 'red', 'free']}
    for a in A:
        if a < 400:
            cnt['gray'] += 1
        elif a < 800:
            cnt['brown'] += 1
        elif a < 1200:
            cnt['green'] += 1
        elif a < 1600:
            cnt['light_blue'] += 1
        elif a < 2000:
            cnt['blue'] += 1
        elif a < 2400:
            cnt['yellow'] += 1
        elif a < 2800:
            cnt['orange'] += 1
        elif a < 3200:
            cnt['gray'] += 1
        else:
            cnt['free'] += 1

    mi = 0
    for k, v in zip(cnt.keys(), cnt.values()):
        if k == 'free':
            continue
        if v:
            mi += 1
    ma = mi + cnt['free']
    print(mi, ma)    


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np
rate = [400 * i for i in range(0, 10)]

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

cnt = np.array([0] * (9))
for i in range(n):
  for j in range(9):
    if rate[j] <= a[i] and a[i] < rate[j+1]:
      cnt[j] += 1

orig = (cnt[:8] > 0).sum()
mins = min(1, orig) if orig == 0 else orig
maxs = orig + cnt[-1]
print(mins, maxs)

Submission status: Wrong Answer

Solution code:
import numpy as np
rate = [400 * i for i in range(0, 10)]

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

cnt = np.array([0] * (9))
for i in range(n):
  for j in range(9):
    if rate[j] <= a[i] and a[i] < rate[j+1]:
      cnt[j] += 1

orig = (cnt[:8] > 0).sum()
mins = 1 if  orig == 0 and cnt[-1] != 0 else orig
maxs = min(8,orig + cnt[-1])
print(mins, maxs)

Submission status: Wrong Answer

Solution code:
import numpy as np
rate = [400 * i for i in range(0, 10)]

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

cnt = np.array([0] * (9))
for i in range(n):
  for j in range(9):
    if rate[j] <= a[i] and a[i] < rate[j+1]:
      cnt[j] += 1

orig = (cnt[:8] > 0).sum()
mins = 1 if  orig == 0 and cnt[-1] != 0 else orig
maxs = max(8,orig + cnt[-1])
print(mins, maxs)

Submission status: Wrong Answer

Solution code:
import numpy as np
rate = [400 * i for i in range(0, 10)]

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

cnt = np.array([0] * (9))
for i in range(n):
  for j in range(9):
    if rate[j] <= a[i] and a[i] < rate[j+1]:
      cnt[j] += 1

orig = (cnt[:8] > 0).sum()
mins = 1 if  orig == 0 and cnt[-1] != 0 else orig
maxs = orig + cnt[-1]
print(mins, maxs)

Submission status: Wrong Answer

Solution code:
n, *a = map(lambda x: int(x)//400, open(0).read().split())
k = len(set(a+[8])) - 1
print(k or 1, a.count(8) + k)

Submission status: Wrong Answer

Solution code:
flag = [0 for i in range(8)]
cnt = 0
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
    if A[i] >= 3200:
        cnt += 1
    elif A[i] >= 2800:
        flag[0] = 1
    elif A[i] >= 2400:
        flag[1] = 1
    elif A[i] >= 2000:
        flag[2] = 1
    elif A[i] >= 1600:
        flag[3] = 1
    elif A[i] >= 1200:
        flag[4] = 1
    elif A[i] >= 800:
        flag[5] = 1
    elif A[i] >= 400:
        flag[6] = 1
    else:
        flag[7] = 1
SUM = sum(flag)
print(*[max(SUM, 1), min(SUM + cnt, 8)])

Submission status: Wrong Answer

Solution code:
flag = [0 for i in range(8)]
cnt = 0
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
    if A[i] >= 3200:
        cnt += 1
    elif A[i] >= 2800:
        flag[0] = 1
    elif A[i] >= 2400:
        flag[1] = 1
    elif A[i] >= 2000:
        flag[2] = 1
    elif A[i] >= 1600:
        flag[3] = 1
    elif A[i] >= 1200:
        flag[4] = 1
    elif A[i] >= 800:
        flag[5] = 1
    elif A[i] >= 400:
        flag[6] = 1
    else:
        flag[7] = 1
print(*[sum(flag), min(sum(flag) + cnt, 8)])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

boundary = []
for i in range(8):
    boundary.append(400*(i+1))

colors = set()
free_choice = 0
for i in range(n):
    if a_l[i] < boundary[0]:
        colors.add('gray')
    elif boundary[0] <= a_l[i] < boundary[1]:
        colors.add('brown')
    elif boundary[1] <= a_l[i] < boundary[2]:
        colors.add('green')
    elif boundary[2] <= a_l[i] < boundary[3]:
        colors.add('lblue')
    elif boundary[3] <= a_l[i] < boundary[4]:
        colors.add('blue')
    elif boundary[4] <= a_l[i] < boundary[5]:
        colors.add('yellow')
    elif boundary[5] <= a_l[i] < boundary[6]:
        colors.add('orange')
    elif boundary[6] <= a_l[i] < boundary[7]:
        colors.add('red')
    else:
        free_choice += 1

ans = len(colors)
print(ans, ans+free_choice)

Submission status: Wrong Answer

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

boundary = []
for i in range(8):
    boundary.append(400*(i+1))

colors = set()
free_choice = 0
for i in range(n):
    if a_l[i] < boundary[0]:
        colors.add('gray')
    elif boundary[0] <= a_l[i] < boundary[1]:
        colors.add('brown')
    elif boundary[1] <= a_l[i] < boundary[2]:
        colors.add('green')
    elif boundary[2] <= a_l[i] < boundary[3]:
        colors.add('lblue')
    elif boundary[3] <= a_l[i] < boundary[4]:
        colors.add('blue')
    elif boundary[4] <= a_l[i] < boundary[5]:
        colors.add('yellow')
    elif boundary[5] <= a_l[i] < boundary[6]:
        colors.add('orange')
    elif boundary[6] <= a_l[i] < boundary[7]:
        colors.add('red')
    else:
        free_choice += 1

ans = len(colors)
print(ans, ans+free_choice)

Submission status: Wrong Answer

Solution code:
def resolve():
    '''
    code here
    '''
    import collections

    N = int(input())
    A_list = [int(item)//400 for item in input().split()]

    cnt_dict = collections.Counter(A_list)

    res_low = 0
    res_high = 0
    for i in range(4800//400 + 1):
        if i <= 7:
            if cnt_dict[i] >= 1:
                res_low += 1
        else:
            res_high += cnt_dict[i]

    print(res_low, res_low + res_high)

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[False]*8+[0]
for i in a:
    if i<400:
        l[0]=True
    elif i<800:
        l[1]=True
    elif i<1200:
        l[2]=True
    elif i<1600:
        l[3]=True
    elif i<2000:
        l[4]=True
    elif i<2400:
        l[5]=True
    elif i<2800:
        l[6]=True
    elif i<3200:
        l[7]=True
    else:
        l[8]+=1
print(sum(l[:8]),sum(l[:8])+l[8])#https://yukicoder.me/run/08454c2883ca1

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[False]*7+[0]
for i in a:
    if i<400:
        l[0]=True
    elif i<800:
        l[1]=True
    elif i<1200:
        l[2]=True
    elif i<1600:
        l[3]=True
    elif i<2000:
        l[4]=True
    elif i<2400:
        l[5]=True
    elif i<2800:
        l[6]=True
    else:
        l[7]+=1
print(sum(l[:7])+bool(l[7]),sum(l[:7])+l[7])#https://yukicoder.me/run/f8089b4d83c81

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[False]*7+[0]
for i in a:
    if i<400:
        l[0]=True
    elif i<800:
        l[1]=True
    elif i<1200:
        l[2]=True
    elif i<1600:
        l[3]=True
    elif i<2000:
        l[4]=True
    elif i<2400:
        l[5]=True
    elif i<2800:
        l[6]=True
    else:
        l[7]+=1
print(sum(l[:7]),sum(l[:7])+l[7])#https://yukicoder.me/run/f8089b4d83c81

Submission status: Wrong Answer

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

c = [0 for _ in range(9)]
for ai in a:
  for i in range(8):
    if ai <= i*400+399:
      c[i] += 1
      break
  if ai >= 3200:
    c[8] += 1
mn = 0
for i in range(8):
  if c[i] > 0:
    mn += 1
mx = min(mn+c[8],8)
if mn == 0:
  mn = 1
print(mn,mx)

Submission status: Wrong Answer

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

c = [0 for _ in range(9)]
for ai in a:
  for i in range(8):
    if ai <= i*400+399:
      c[i] += 1
      break
  if ai >= 3200:
    c[8] += 1
mn = 0
for i in range(8):
  if c[i] > 0:
    mn += 1
mx = min(mn+c[8],8)
print(mn,mx)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
normal = set()
choku = 0

for i in range(N):
  if a[i] // 400  >= 8:
    choku += 1
  else:
    normal.add(a[i]//400)
    
if len(normal) == 0:
  print(1, min(8,choku))
else:
  print(len(normal), min(8,len(normal)+choku))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
normal = set()
choku = 0

for i in range(N):
  if a[i] // 400  >= 8:
    choku += 1
  else:
    normal.add(a[i]//400)
    
if normal == 0:
  print(1, min(8,choku))
else:
  print(len(normal), min(8,len(normal)+choku))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
normal = set()
choku = 0

for i in range(N):
  if a[i] // 400  >= 8:
    choku += 1
  else:
    normal.add(a[i]//400)
print(len(normal) + (choku > 0), min(8,len(normal)+choku))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
normal = set()
choku = 0

for i in range(N):
  if a[i] // 400  >= 8:
    choku += 1
  else:
    normal.add(a[i]//400)
print(len(normal), min(8,len(normal)+choku))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
r=set()
r2=0

for i in a:
    if i>=3200:
        r2+=1
    else:
        r.add(i//400)

if len(r)==0:
    mi=1
else:
    mi=len(r)

if len(r)+r2>=8:
    ma=8
else:
    ma=len(r)+r2

print(mi,ma)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
r=[0]*9

for i in a:
    for j in range(1,9):
        if i<400*j:
            r[j-1]+=1
            break
    else:
        r[8]+=1
        
ma=(8-(r[0:8].count(0)))+r[8]
if ma>=8:
    ma=8

mi=8-(r[0:8].count(0))

if mi==0:
    mi=1

print(mi,ma)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
r=[0]*9

for i in a:
    for j in range(1,9):
        if i<400*j:
            r[j-1]+=1
            break
    else:
        r[8]+=1

ma=(8-(r[0:8].count(0)))+r[8]
if ma>8:
    ma=8

mi=8-(r[0:8].count(0))

if mi==8:
    mi=1

print(mi,ma)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
r=[0]*9

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

mi=(r[0:8].count(0))
if mi==8:
    if r[8]>8:
        print("1","8")
        exit()
    else:
        print("1",r[8])
        exit()
else:
    mi=8-mi

ma=mi+r[8]

if ma>8:
    ma=8

print(mi,ma)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
r=[0]*9

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

mi=(r[0:8].count(0))
if mi==8:
    print("1",r[8])
    exit()
else:
    mi=8-mi

ma=mi+r[8]

if ma>8:
    ma=8

print(mi,ma)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
r=[0]*9

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

mi=8-(r[0:8].count(0))
ma=mi+r[8]

if ma>8:
    ma=8

print(mi,ma)

Submission status: Wrong Answer

Solution code:
def main():
  N = int(input())
  A = [int(_)//400 for _ in input().split()]
  U = [a for a in A if a < 8]
  O = N - len(U)
  print(len(set(U)), len(set(U)) + O)
  return

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

dict = {}
ans = 0
count = 0
for i in range(N):
    if not( a[i]//400 in dict.keys() ):
        dict[a[i]//400] = 1
    else:
        dict[a[i]//400] += 1
for key in dict.keys():
    if key < 8:
        ans += 1
    else:
        count += dict[key]
if ans == 0:
    print(count, count)
else:
    print(ans, ans+count)

Submission status: Wrong Answer

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

dict = {}
ans = 0
count = 0
for i in range(N):
    if not( a[i]//400 in dict.keys() ):
        dict[a[i]//400] = 1
    else:
        dict[a[i]//400] += 1
for key in dict.keys():
    if key < 8:
        ans += 1
    else:
        count += dict[key]

print(ans, ans+count)

Submission status: Wrong Answer

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

dict = {}
ans = 0
for i in range(N):
    if not( a[i]//400 in dict.keys() ):
        dict[a[i]//400] = 1
    else:
        dict[a[i]//400] += 1
for key in dict.keys():
    if key < 8:
        ans += 1
#print(dict[8])
ans1 = ans
for i in range(8,13):
    if i in dict.keys():
        ans1 += dict[i]

print(ans, ans1)

Submission status: Wrong Answer

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

dict = {}
ans = 0
for i in range(N):
    if not( a[i]//400 in dict.keys() ):
        dict[a[i]//400] = 1
    else:
        dict[a[i]//400] += 1
for key in dict.keys():
    if key < 8:
        ans += 1
#print(dict[8])
ans1 = ans
for i in range(8,13):
    if i in dict.keys():
        ans1 = ans+dict[i]

print(ans, ans1)

Submission status: Wrong Answer

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

dict = {}
ans = 0
for i in range(N):
    if not( a[i]//400 in dict.keys() ):
        dict[a[i]//400] = 1
    else:
        dict[a[i]//400] += 1
for key in dict.keys():
    if key != 8:
        ans += 1
#print(dict[8])
if 8 in dict.keys():
    ans1 = ans+dict[8]
else:
    ans1 = ans
print(ans, ans1)

Submission status: Wrong Answer

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

d = defaultdict(int)
a = 0
for num in nums:
    if 1 <= num <= 399:
        d['ash'] += 1
    elif 400 <= num <= 799:
        d['brown'] += 1
    elif 800 <= num <= 1199:
        d['green'] += 1
    elif 1200 <= num <= 1599:
        d['water'] += 1
    elif 1600 <= num <= 1999:
        d['blue'] += 1
    elif 2000 <= num <= 2399:
        d['yellow'] += 1
    elif 2400 <= num <= 2799:
        d['orange'] += 1
    elif 2800 <= num <= 3199:
        d['red'] += 1
    else:
        a += 1
MIN = len(d)
if MIN == 0 and a > 0:
    MIN = 1
MAX = min(8, len(d) + a)
print(MIN, MAX)

Submission status: Wrong Answer

Solution code:
# =map(int,input().split())
n=int(input())
a=list(map(int,input().split()))
ans=[0 for _ in range(8)]
cnt=0
res=0
for i in a:
    if 0<i<400:
        ans[0]+=1
    elif 400<=i<800:
        ans[1]+=1
    elif 800<=i<1200:
        ans[2]+=1
    elif 1200<=i<1600:
        ans[3]+=1
    elif 1600<=i<2000:
        ans[4]+=1
    elif 2000<=i<2400:
        ans[5]+=1
    elif 2400<=i<2800:
        ans[6]+=1
    elif 2800<=i<3200:
        ans[7]+=1
    elif 3200<=i:
        cnt+=1
for i in ans:
    if i==0:
        res+=1
x=8-res
if x+cnt<9:
    y=cnt+x
else:
    y=8
if x==0:
    x=1
print(x,y)
# print(ans)

Submission status: Wrong Answer

Solution code:
# =map(int,input().split())
n=int(input())
a=list(map(int,input().split()))
ans=[0 for _ in range(8)]
cnt=0
res=0
for i in a:
    if 0<i<400:
        ans[0]+=1
    elif 400<=i<800:
        ans[1]+=1
    elif 800<=i<1200:
        ans[2]+=1
    elif 1200<=i<1600:
        ans[3]+=1
    elif 1600<=i<2000:
        ans[4]+=1
    elif 2000<=i<2400:
        ans[5]+=1
    elif 2400<=i<2800:
        ans[6]+=1
    elif 2800<=i<3200:
        ans[7]+=1
    elif 3200<=i:
        cnt+=1
for i in ans:
    if i==0:
        res+=1
x=8-res
if x+cnt<9:
    y=cnt+x
else:
    y=8
if x==0:
    if cnt==0:
        x=0
    else:
        x=1
print(x,y)
# print(ans)

Submission status: Wrong Answer

Solution code:
# =map(int,input().split())
n=int(input())
a=list(map(int,input().split()))
ans=[0 for _ in range(8)]
cnt=0
res=0
for i in a:
    if 0<i<400:
        ans[0]+=1
    elif 400<=i<800:
        ans[1]+=1
    elif 800<=i<1200:
        ans[2]+=1
    elif 1200<=i<1600:
        ans[3]+=1
    elif 1600<=i<2000:
        ans[4]+=1
    elif 2000<=i<2400:
        ans[5]+=1
    elif 2400<=i<2800:
        ans[6]+=1
    elif 2800<=i<3200:
        ans[7]+=1
    elif 3200<=i:
        cnt+=1
for i in ans:
    if i==0:
        res+=1
x=8-res
if x+cnt<9:
    y=cnt+x
else:
    y=8
print(x,y)
# print(ans)

Submission status: Wrong Answer

Solution code:
# =map(int,input().split())
n=int(input())
a=list(map(int,input().split()))
ans=[0 for _ in range(8)]
cnt=0
res=0
for i in range(n):
    if 0<a[i]<400:
        ans[0]+=1
    elif 400<=a[i]<800:
        ans[1]+=1
    elif 800<=a[i]<1200:
        ans[2]+=1
    elif 1200<=a[i]<1600:
        ans[3]+=1
    elif 1600<=a[i]<2000:
        ans[4]+=1
    elif 2000<=a[i]<2400:
        ans[5]+=1
    elif 2400<=a[i]<2800:
        ans[6]+=1
    elif 2800<=a[i]<3200:
        ans[7]+=1
    elif 3200<=a[i]:
        cnt+=1
for i in ans:
    if i==0:
        res+=1
x=8-res
if x+cnt<9:
    y=cnt+x
else:
    y=8
print(x,y)

Submission status: Wrong Answer

Solution code:
# =map(int,input().split())
n=int(input())
a=list(map(int,input().split()))
ans=[0 for _ in range(8)]
cnt=0
res=0
for i in range(n):
    if 0<a[i]<400:
        ans[0]+=1
    elif 400<=a[i]<800:
        ans[1]+=1
    elif 800<=a[i]<1200:
        ans[2]+=1
    elif 1200<=a[i]<1600:
        ans[3]+=1
    elif 1600<=a[i]<2000:
        ans[4]+=1
    elif 2000<=a[i]<2400:
        ans[5]+=1
    elif 2400<=a[i]<2800:
        ans[6]+=1
    elif 2800<=a[i]<3200:
        ans[7]+=1
    elif 3200<=a[i]:
        cnt+=1
for i in ans:
    if i==0:
        res+=1
x=8-res
if x+cnt<9:
    y=cnt+x
else:
    y=x
print(x,y)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int,input().split()))
color = [0]*9
def col(x):
  if 1<=x<=399:
    return 0
  elif 400<=x<=799:
    return 1
  elif 800<=x<=1199:
    return 2
  elif 1200<=x<=1599:
    return 3
  elif 1600<=x<=1999:
    return 4
  elif 2000<=x<=2399:
    return 5
  elif 2400<=x<=2799:
    return 6
  elif 2800<=x<=3199:
    return 7
  else:
    return 8
  
for i in l:
  a = col(i)
  color[a] += 1
color2 = [1 for i in color if i!=0]
if color[8]==0:
  print(len(color2),len(color2))
else:
  print(max(len(color2)-1,1),min(len(color2)-1+color[8],8))

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int,input().split()))
color = [0]*9
def col(x):
  if 1<=x<=399:
    return 0
  elif 400<=x<=799:
    return 1
  elif 800<=x<=1199:
    return 2
  elif 1200<=x<=1599:
    return 3
  elif 1600<=x<=1999:
    return 4
  elif 2000<=x<=2399:
    return 5
  elif 2400<=x<=2799:
    return 6
  elif 2800<=x<=3199:
    return 7
  else:
    return 8
  
for i in l:
  a = col(i)
  color[a] += 1
color2 = [i for i in color if i!=0]
if color[8]==0:
  print(len(color2),len(color2))
else:
  print(max(len(color2)-1,1),min(len(color2)-1+color[8],8))