Problem:


Score : 300 points

Problem Statement

In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:  

Rating 1-399 : gray

Rating 400-799 : brown

Rating 800-1199 : green

Rating 1200-1599 : cyan

Rating 1600-1999 : blue

Rating 2000-2399 : yellow

Rating 2400-2799 : orange

Rating 2800-3199 : red

Other than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.

Currently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.

Find the minimum and maximum possible numbers of different colors of the users.  

Constraints

1 ≤ N ≤ 100

1 ≤ a_i ≤ 4800

a_i is an integer.

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 ... a_N

Output

Print the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.  

Sample Input 1

4
2100 2500 2700 2700

Sample Output 1

2 2

The user with rating 2100 is "yellow", and the others are "orange". There are two different colors.  

Sample Input 2

5
1100 1900 2800 3200 3200

Sample Output 2

3 5

The user with rating 1100 is "green", the user with rating 1900 is blue and the user with rating 2800 is "red".

If the fourth user picks "red", and the fifth user picks "blue", there are three different colors. This is one possible scenario for the minimum number of colors.

If the fourth user picks "purple", and the fifth user picks "black", there are five different colors. This is one possible scenario for the maximum number of colors.  

Sample Input 3

20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990

Sample Output 3

1 1

All the users are "green", and thus there is one color.



Sample input:
4
2100 2500 2700 2700


Sample output:
2 2

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
S = set()
count = 0
for rate in A:
    if rate < 400:
        S.add("gray")
    elif rate < 800:
        S.add("brown")
    elif rate < 1200:
        S.add("green")
    elif rate < 1600:
        S.add("light_blue")
    elif rate < 2000:
        S.add("blue")
    elif rate < 2400:
        S.add("yellow")
    elif rate < 2800:
        S.add("orange")
    elif rate < 3200:
        S.add("red")
    else:
        count += 1

if count == 0:
    color_min = len(S)
    color_max = len(S)
else:
    color_max = min(len(S) + count, 7)
    color_min = max(len(S), 1)

print(color_min, color_max)

Submission status: Wrong Answer

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

ans = [0] * 8
over_3200 = 0

for i in range(n):
    if a[i] < 400:
        ans[0] = 1
    elif a[i] < 800:
        ans[1] = 1
    elif a[i] < 1200:
        ans[2] = 1
    elif a[i] < 1600:
        ans[3] = 1
    elif a[i] < 2000:
        ans[4] = 1
    elif a[i] < 2400:
        ans[5] = 1
    elif a[i] < 2800:
        ans[6] = 1
    elif a[i] < 3200:
        ans[7] = 1
    else:
        over_3200 += 1

print(max(sum(ans), 1), end=' ')
print(8 if sum(ans) + over_3200 >= 8 else sum(ans) + over_3200)

Submission status: Wrong Answer

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

ans = [0] * 8
over_3200 = 0

for i in range(n):
    if a[i] < 400:
        ans[0] = 1
    elif a[i] < 800:
        ans[1] = 1
    elif a[i] < 1200:
        ans[2] = 1
    elif a[i] < 1600:
        ans[3] = 1
    elif a[i] < 2000:
        ans[4] = 1
    elif a[i] < 2400:
        ans[5] = 1
    elif a[i] < 2800:
        ans[6] = 1
    elif a[i] < 3200:
        ans[7] = 1
    else:
        over_3200 += 1

print(1 if sum(ans) == 0 and over_3200 >= 1 else sum(ans), end=' ')
print(8 if sum(ans) + over_3200 >= 8 else sum(ans) + over_3200)

Submission status: Wrong Answer

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

ans = [0] * 8
over_3200 = 0

for i in range(n):
    if a[i] < 400:
        ans[0] = 1
    elif a[i] < 800:
        ans[1] = 1
    elif a[i] < 1200:
        ans[2] = 1
    elif a[i] < 1600:
        ans[3] = 1
    elif a[i] < 2000:
        ans[4] = 1
    elif a[i] < 2400:
        ans[5] = 1
    elif a[i] < 2800:
        ans[6] = 1
    elif a[i] < 3200:
        ans[7] = 1
    else:
        over_3200 += 1

print(sum(ans), end=' ')
print(8 if sum(ans) + over_3200 >= 8 else sum(ans) + over_3200)

Submission status: Wrong Answer

Solution code:
N=int(input())
A = list(map(int, input().split()))
gray=any([1<=i<=399 for i in A])
brown=any([400<=i<=799 for i in A])
green=any([800<=i<=1199 for i in A])
sky=any([1200<=i<=1599 for i in A])
blue=any([1600<=i<=1999 for i in A])
yellow=any([2000<=i<=2399 for i in A])
orange=any([2400<=i<=2799 for i in A])
red=any([2800<=i<=3199 for i in A])
color_list=[gray,brown,green,sky,blue,yellow,orange,red]
count= color_list.count(True)
change=len([i for i in A if 3200<=i])
print(count,count+change)

Submission status: Wrong Answer

Solution code:

a=int(input())
b=[]
c=[0,0,0,0,0,0,0,0,0]
ans1=0
ans2=0
jdg=0

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

for i in range(a):
    if(int(b[i])<3200):
        jdg=int(b[i]/400)
        c[jdg]+=1
    else:
        c[8]+=1

for i in range(8):
    if(c[i] >= 1):
        ans1+=1
ans2=ans1
if(c[8]>=1):
    ans2+=c[8]
    if(ans2>8):
        ans2=8
if(ans1==0):
    ans1=1

print('%d %d' % (ans1, ans2))

Submission status: Wrong Answer

Solution code:

a=int(input())
b=[]
c=[0,0,0,0,0,0,0,0,0]
ans1=0
ans2=0
jdg=0

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

for i in range(a):
    if(int(b[i])<3200):
        jdg=int(b[i]/400)
        c[jdg]+=1
    else:
        c[8]+=1

for i in range(8):
    if(c[i] >= 1):
        ans1+=1
ans2=ans1
if(c[8]>=1):
    ans2+=c[8]
    if(ans2>8):
        ans2=8

print('%d %d' % (ans1, ans2))

Submission status: Wrong Answer

Solution code:
people = int(input())
rates = list(map(int, input().split(' ')))
colors = [0 for i in range(8)]

color_var = 0
for i in range(people):
    if rates[i] // 400 <= 7:
        if colors[rates[i] // 400] == 0 :
            colors[rates[i] // 400] += 1
    else:
        color_var += 1
        
min_colors = colors.count(1)
max_colors = colors.count(1) + color_var

print(min_colors, max_colors)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
c, d = 0, 0
for i in range(9):
  for j in A:
    if 400*i <= j < 400*(i+1):
      if i<8:
        c += 1
        break
      else:
        d += 1
print(max(1, c), c+d)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
c, d = 0, 0
for i in range(8):
  for j in A:
    if 400*i <= j < 400*(i+1):
      c += 1
      break
for j in A:
  if j >= 3200:
    d += 1
print(c, c+d)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
c, d = 0, 0
for i in range(9):
  for j in A:
    if 400*i <= j < 400*(i+1):
      if i<8:
        c += 1
        break
      else:
        d += 1
print(c, c+d)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
c, d = 0, 0
for i in range(9):
  for j in A:
    if 400*i <= j < 400*(i+1):
      if i<8:
        c += 1
        break
      else:
        d += 1
print(c, c+d)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
c = 0
for i in range(8):
  for j in A:
    if 400*i <= j < 400*(i+1):
      c += 1
      if i<7:
        break
print(c)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
col=[False for i in range(8)]
val=0
count=0
for i in range(n):
  m=l[i]
  if m<400:
    col[0]=True
  if 400<=m<800:
    col[1]=True
  if 800<=m<1200:
    col[2]=True
  if 1200<=m<1600:
    col[3]=True
  if 1600<=m<2000:
    col[4]=True
  if 2000<=m<2400:
    col[5]=True
  if 2400<=m<2800:
    col[6]=True
  if 2800<=m<3200:
    col[7]=True
  if m>=3200:
    val+=1
for i in range(8):
  if col[i]:
    count+=1
print(max(1,count),min(8,count+val))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
col=[False for i in range(8)]
val=0
count=0
for i in range(n):
  m=l[i]
  if m<400:
    col[0]=True
  if 400<=m<800:
    col[1]=True
  if 800<=m<1200:
    col[2]=True
  if 1200<=m<1600:
    col[3]=True
  if 1600<=m<2000:
    col[4]=True
  if 2000<=m<2400:
    col[5]=True
  if 2400<=m<2800:
    col[6]=True
  if 2800<=m<3200:
    col[7]=True
  if m>=3200:
    val+=1
for i in range(8):
  if col[i]:
    count+=1
print(count,min(8,count+val))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
col=[False for i in range(8)]
val=0
count=0
for i in range(n):
  m=l[i]
  if m<400:
    col[0]=True
  elif 400<=m<800:
    col[1]=True
  elif 800<=m<1200:
    col[2]=True
  elif 1200<=m<1600:
    col[3]=True
  elif 1600<=m<2000:
    col[4]=True
  elif 2000<=m<2400:
    col[5]=True
  elif 2400<=m<2800:
    col[6]=True
  elif 2800<=m<3200:
    col[7]=True
  else:
    val+=1
for i in range(8):
  if col[i]:
    count+=1
print(count,min(8,count+val))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
col=[False for i in range(8)]
val=0
count=0
for i in range(n):
  m=l[i]
  if m<400:
    col[0]=True
  elif m<800:
    col[1]=True
  elif m<1200:
    col[2]=True
  elif m<1600:
    col[3]=True
  elif m<2000:
    col[4]=True
  elif m<2400:
    col[5]=True
  elif m<2800:
    col[6]=True
  elif m<3200:
    col[7]=True
  else:
    val+=1
for i in range(8):
  if col[i]:
    count+=1
print(count,min(8,count+val))

Submission status: Wrong Answer

Solution code:
import copy
import heapq
import math
import fractions

def j(n):
    if n:print("Yes")
    else:print("No")
    exit(0)
rem = 10 ** 9 + 7

"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def ipmultiplerow(n):
    a = []
    for i in range(n):
        a.append(ip())
    return a
def printmultiplerow(a):
    for i in a:
        print(i)
def printrow(a):
    for i in range(len(a)-1):
        print(a[i],end = " ")
    print(a[-1])



n = ip()
a = iprow()
for i in range(n):
    a[i]//=400
any = 0
for i in range(n):
    if a[i] >=8:
        a[i]=-1
        any+=1
for i in range(n-1,-1,-1):
    if a[i]==-1:
        a.pop(i)
l = len(set(a))
print(max(1,l),min(l+any,8))

Submission status: Wrong Answer

Solution code:
import copy
import heapq
import math
import fractions

def j(n):
    if n:print("Yes")
    else:print("No")
    exit(0)
rem = 10 ** 9 + 7

"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def ipmultiplerow(n):
    a = []
    for i in range(n):
        a.append(ip())
    return a
def printmultiplerow(a):
    for i in a:
        print(i)
def printrow(a):
    for i in range(len(a)-1):
        print(a[i],end = " ")
    print(a[-1])



n = ip()
a = iprow()
for i in range(n):
    a[i]//=400
any = 0
for i in range(n):
    if a[i] >=8:
        a[i]=-1
        any+=1
l = len(set(a))
if any: l-=1
print(max(1,l),min(l+any,8))

Submission status: Wrong Answer

Solution code:
import copy
import heapq
import math
import fractions

def j(n):
    if n:print("Yes")
    else:print("No")
    exit(0)
rem = 10 ** 9 + 7

"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def ipmultiplerow(n):
    a = []
    for i in range(n):
        a.append(ip())
    return a
def printmultiplerow(a):
    for i in a:
        print(i)
def printrow(a):
    for i in range(len(a)-1):
        print(a[i],end = " ")
    print(a[-1])



n = ip()
a = iprow()
for i in range(n):
    a[i]//=400
any = 0
for i in range(n):
    if a[i] >=8:
        a[i]=-1
        any+=1
l = len(set(a))
if any: l-=1
print(l,min(l+any,8))

Submission status: Wrong Answer

Solution code:
N = int(input())
an = list(map(int, input().split()))
over_cnt = 0
colors = []
for a in an:
    rate = a // 400
    if rate >= 8:
        over_cnt += 1
    elif rate not in colors:
        colors.append(rate)

print(len(colors), len(colors) + over_cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
an = list(map(int, input().split()))
over_cnt = 0
colors = []
for a in an:
    rate = a // 400
    if rate >= 8:
        over_cnt += 1
    elif rate not in colors:
        colors.append(rate)

print(len(colors), min(len(colors) + over_cnt, 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
an = list(map(int, input().split()))
over_cnt = 0
colors = []
for a in an:
    rate = a // 400
    if rate >= 8:
        over_cnt += 1
    elif rate not in colors:
        colors.append(rate)

min = len(colors)
max = len(colors) + over_cnt
print(min, max)

Submission status: Wrong Answer

Solution code:
def read_input():
  n = int(input())
  a = [int(item) for item in input().split()]
  return n,a

def main():
  n,a = read_input()
  l = [0 for i in range(8)]
  experts = 0
  for score in a:
    if score > 3199:
      experts += 1
    else:
      l[score//400] += 1
  minimum = 8-l.count(0)
  maximum = minimum + experts
  print(minimum, maximum)

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
a.sort()
c = [0] * 9
for i in range(N):
  if a[i] // 400 > 8:
    c[8] += 1
  else:
    c[a[i] // 400] += 1
res = 0
for i in range(8):
  res += c[i] > 0
print(res, res + c[8])

Submission status: Wrong Answer

Solution code:
N = int(input())
List = input().split()
counter = [0 for _ in range(8)]
prime = 0
for item in List:
  if int(item) >=3200:
    prime +=1
  else:
    num = int(item)//400
    counter[num] += 1

minimum = 8 - counter.count(0)
maximum = minimum + prime
print(minimum, maximum)

Submission status: Wrong Answer

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

N = int(input())
rating = [int(r) for r in input().split()]
rating.sort()

color = ['gray', 'brown', 'green', 'cyan', 'blue', 'yellow', 'orange', 'red']
c_count = {c: 0 for c in color}

count_over = 0
for r in rating:
    if r < 400:    c_count[color[0]] += 1
    elif r < 800:  c_count[color[1]] += 1
    elif r < 1200: c_count[color[2]] += 1
    elif r < 1600: c_count[color[3]] += 1
    elif r < 2000: c_count[color[4]] += 1
    elif r < 2400: c_count[color[5]] += 1
    elif r < 2800: c_count[color[6]] += 1
    elif r < 3200: c_count[color[7]] += 1
    else:          count_over += 1
     
dif_c_count = 0
for v in c_count.values():
    if v != 0: dif_c_count += 1 

mini, maxi = dif_c_count, dif_c_count + count_over
print(mini, maxi)

Submission status: Wrong Answer

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    A = string_to_int(inputs[0])
    rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
    rate_num = len(rate)

    counter_overs = 0
    rate_set = set()
    for a in A:
        if a >= 3200:
            counter_overs += 1
        else:
            hit = None
            for i, r in enumerate(reversed(rate)):
                if a <= r:
                    hit = i
            rate_set.add(hit)
    if len(rate_set) == 0:
        max_num = counter_overs if counter_overs <= rate_num else rate_num
        min_num = 1
    else:
        sum_all = len(rate_set) + counter_overs
        max_num = sum_all if sum_all <= rate_num else rate_num
        min_num = len(rate_set)
    return "{} {}".format(min_num, max_num)


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    input()
    ret = solve(inputs(1))
    print(ret)

Submission status: Wrong Answer

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    A = string_to_int(inputs[0])
    rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
    rate_num = len(rate)

    counter_overs = 0
    rate_set = set()
    for a in A:
        if a >= 3200:
            counter_overs += 1
        else:
            hit = None
            for i, r in enumerate(reversed(rate)):
                if a <= r:
                    hit = i
            rate_set.add(hit)
    print(rate_set)
    if len(rate_set) == 0:
        max_num = counter_overs if counter_overs <= rate_num else rate_num
        min_num = 1
    else:
        sum_all = len(rate_set) + counter_overs
        max_num = sum_all if sum_all <= rate_num else rate_num
        min_num = len(rate_set)
    return "{} {}".format(min_num, max_num)


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    input()
    ret = solve(inputs(1))
    print(ret)

Submission status: Wrong Answer

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    A = string_to_int(inputs[0])
    rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]

    counter = collections.Counter()
    for a in A:
        hit = -1
        for i, r in enumerate(reversed(rate)):
            if a <= r:
                hit = i
            else:
                break
        counter[hit] += 1

    if -1 in counter.keys():
        if len(counter.keys()) == 1:
            max_n = len(rate) if counter[-1] > len(rate) else counter[-1]
            min_n = 1
        else:
            n = len(counter.keys()) - 1
            n += counter[-1]
            max_n = len(rate) if n > len(rate) else n
            min_n = len(counter.keys()) - 1
        return '{} {}'.format(min_n, max_n)
    else:
        n = len(counter.keys())
        return '{} {}'.format(n, n)


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    input()
    ret = solve(inputs(1))
    print(ret)

Submission status: Wrong Answer

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    A = string_to_int(inputs[0])
    rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]

    counter = collections.Counter()
    for a in A:
        hit = -1
        for i, r in enumerate(reversed(rate)):
            if a <= r:
                hit = i
            else:
                break
        counter[hit] += 1

    if -1 in counter.keys():
        n = len(counter.keys()) - 1
        n += counter[-1]
        max_n = len(rate) if n > len(rate) else n
        min_n = len(counter.keys()) - 1
        return '{} {}'.format(min_n, max_n)
    else:
        n = len(counter.keys())
        return '{} {}'.format(n, n)


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    input()
    ret = solve(inputs(1))
    print(ret)

Submission status: Wrong Answer

Solution code:
N = int(input())
rank = list(map(int, input().split()))
color = [0 for i in range(8)]
for i in range(len(rank)):
    for j in range(len(color)):
        if 400 * j <= int(rank[i]) < 400 * (j + 1):
            color[j] += 1
            break
count = N - sum(color)
print(len(color) - color.count(0), len(color) - color.count(0) + count)

Submission status: Wrong Answer

Solution code:
N = int(input())
rank = list(map(int, input().split()))
color = [0 for i in range(8)]
for i in range(len(rank)):
    for j in range(len(color)):
        if 400 * j <= int(rank[i]) < 400 * (j + 1):
            color[j] += 1
count = N - sum(color)
print(len(color) - color.count(0), len(color) - color.count(0) + count)

Submission status: Wrong Answer

Solution code:
a = [i for i in range(1, 399)]
b = [i for i in range(400, 799)]
c = [i for i in range(800, 1199)]
d = [i for i in range(1200, 1599)]
e = [i for i in range(1600, 1999)]
f = [i for i in range(2000, 2399)]
g = [i for i in range(2400, 2799)]
h = [i for i in range(2800, 3199)]
count = 0
n = int(input())
A = list(map(int, input().split()))
color = [0 for i in range(8)]
for i in range(len(A)):
    if A[i] in a:
        color[0] += 1
    elif A[i] in b:
        color[1] += 1
    elif A[i] in c:
        color[2] += 1
    elif A[i] in d:
        color[3] += 1
    elif A[i] in e:
        color[4] += 1
    elif A[i] in f:
        color[5] += 1
    elif A[i] in g:
        color[6] += 1
    elif A[i] in h:
        color[7] += 1
    else:
        count += 1
print(len(color) - color.count(0), len(color) - color.count(0) + count)

Submission status: Wrong Answer

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

    R = [1]
    for i in range(1, 8):
        R.append(400 * i)
    
    st = set()
    free = 0
    for ai in A:
        if ai >= 3200:
            free += 1
            continue
        for ri in R[::-1]:
            if ai >= ri:
                st.add(ri)
                break

    
    if len(st) > free:
        mn = len(st)
    else:
        mn = len(st) + (free - len(st))
    print(mn, len(st) + free)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    R = [1]
    for i in range(1, 8):
        R.append(400 * i)
    
    st = set()
    free = 0
    for ai in A:
        if ai >= 3200:
            free += 1
            continue
        for ri in R[::-1]:
            if ai >= ri:
                st.add(ri)
                break
    # print(st)
    # print(free)
    print(len(st), len(st) + free)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np

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

colors = np.array([0 for _ in range(9)])
for a in A:
    if 1 <= a <= 399: colors[0] += 1
    elif 400 <= a <= 799: colors[1] += 1
    elif 800 <= a <= 1199: colors[2] += 1
    elif 1200 <= a <= 1599: colors[3] += 1
    elif 1600 <= a <= 1999: colors[4] += 1
    elif 2000 <= a <= 2399: colors[5] += 1
    elif 2400 <= a <= 2799: colors[6] += 1
    elif 2800 <= a <= 3199: colors[7] += 1
    else: colors[8] += 1

if colors[8] == 0:
    ans = len(colors[colors > 0])
    print(ans, ans)
else:
    legend = colors[8]
    colors = colors[:8]
    v = len(colors[colors > 0])
    print(max(1, v), min(8, v + legend))

Submission status: Wrong Answer

Solution code:
import numpy as np

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

colors = np.array([0 for _ in range(9)])
for a in A:
    if 1 <= a <= 399: colors[0] += 1
    elif 400 <= a <= 799: colors[1] += 1
    elif 800 <= a <= 1199: colors[2] += 1
    elif 1200 <= a <= 1599: colors[3] += 1
    elif 1600 <= a <= 1999: colors[4] += 1
    elif 2000 <= a <= 2399: colors[5] += 1
    elif 2400 <= a <= 2799: colors[6] += 1
    elif 2800 <= a <= 3199: colors[7] += 1
    else: colors[8] += 1

if colors[8] == 0:
    ans = len(colors[colors > 0])
    print(ans, ans)
else:
    legend = colors[8]
    colors = colors[:8]
    v = len(colors[colors > 0])
    print(max(1, v), v + min(legend, 8 - v))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = [int(i) for i in input().split()]
ac =[]
rate = [i*400 for i in range(1,10)]

for i in a:
	for j in reversed(rate):
		if i >= j:
			ac.append(j)
			break

TT = ac.count(3200)
NTT = [i for i in ac if i != 3200]
lenNTT = len(set(NTT))
if TT+lenNTT >= 8:
	cmax = 8; cmin = lenNTT
else:
	cmax = TT+lenNTT; cmin = lenNTT
print(cmin,cmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list( map(int,input().split()) )
flag = [0 for i in range(8)]
n = 0
c = 0
for a in A:
  if a // 400 >= 8:
    n += 1
  elif flag[a//400] == 0:
    flag[a//400] = 1
    c += 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list( map(int,input().split()) )
flag = [0 for i in range(8)]
n = 0
c = 0
for a in A:
  if a // 400 >= 8:
    n += 1
  elif flag[a//400] == 0:
    flag[a//400] = 1
    c += 1

if c == 1:
  print( 1 , min( 8,c+n ) )
else:
  print( c , min( 8,c+n ) )

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
r_table = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
rate = [0]*8
god = 0
for x in a:
    for id, y in enumerate(r_table):
        if x >= y:
            if id == 8:
                god += 1
                break
        else:
            rate[id-1] = 1
            break
print(max(sum(rate), 1), min(sum(rate) + god, 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
r_table = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
rate = [0]*8
god = 0
for x in a:
    for id, y in enumerate(r_table):
        if x >= y:
            if id == 8:
                god += 1
                break
        else:
            rate[id-1] = 1
            break
print(sum(rate), min(sum(rate) + god, 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
r_table = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
rate = [0]*9
god = 0
for x in a:
    for id, y in enumerate(r_table):
        if x >= y:
            if id == 8:
                god += 1
                break
        else:
            rate[id] = 1
            break
print(sum(rate), min(sum(rate) + god, 9))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
r_table = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
rate = [0]*9
god = 0
for x in a:
    for id, y in enumerate(r_table):
        if x >= y:
            if id == 8:
                god += 1
                break
        else:
            rate[id] = 1
            break
print(sum(rate), min(sum(rate) + god, 8))

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

da = [ai//400 for ai in aa if ai<3200]
over = sum([ai>=3200 for ai in aa])

c = Counter(da)

min_v = len(c)
max_v = min_v + over

print(min_v,max_v)

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

da = [ai//400 for ai in aa if ai<3200]
over = sum([ai>=3200 for ai in aa])

c = Counter(da)

min_v = len(c)
max_v = min(8,(min_v+over))

print(min_v,max_v)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
b = []
max = 0
r = (0, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200)
for i in range(n):
    if int(a[i]) >= 3200:
        max += 1
    else:
        for j in range(len(r)-1):
            if int(r[j]) <= int(a[i]) < int(r[j+1]):
                b.append(r[j])

min = len(set(b))
print(str(min)+' '+str(min+max) if min != 0 else str(max)+' '+str(max))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
b = []
max = 0
r = (0, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200)
for i in range(n):
    if int(a[i]) >= 3200:
        max += 1
    else:
        for j in range(len(r)-1):
            if int(r[j]) <= int(a[i]) < int(r[j+1]):
                b.append(r[j])

min = len(set(b))
print(str(min)+' '+str(min+max))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
b = []
max = 0
r = (0, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200)
for i in range(n):
    if int(a[i]) >= 3200:
        max += 1
    for j in range(len(r)-1):
        if int(r[j]) <= int(a[i]) < int(r[j+1]):
            b.append(r[j])

min = len(set(b))
print(str(min)+' '+str(min+max))