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:
# -*- coding:utf-8 -*-

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


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

    """方針
    色が8のとき、何色にもなれる。

    先に0~7の色を埋める(Trueにして)。これが最小の数。
    
    その後、色が8の数だけ他の色を埋めていく。それが最大の数。

    """
    min_colors = [False] * 8
    max_colors = [False] * 8
    color8_cnt = 0
    for i, a in enumerate(A):
        color = determine_color(a)
        if color == 8:
            color8_cnt += 1
            continue
        min_colors[color] = True
        max_colors[color] = True

    k = 0
    for i in range(color8_cnt):
        if k == len(max_colors)-1:
            break

        for j in range(k, len(max_colors)):
            if not max_colors[j]:
                max_colors[j] = True
                break
        k = j
    
    min_ans = 0
    for i, c in enumerate(min_colors):
        if c:
            min_ans += 1

    max_ans = 0
    for i, c in enumerate(max_colors):
        if c:
            max_ans += 1

    print("{} {}".format(min_ans, max_ans))



if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

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


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

    """方針
    色が8のとき、何色にもなれる。

    先に0~7の色を埋める(Trueにして)。これが最小の数。
    
    その後、色が8の数だけ他の色を埋めていく。それが最大の数。

    """
    min_colors = [False] * 8
    max_colors = [False] * 8
    color8_cnt = 0
    for i, a in enumerate(A):
        color = determine_color(a)
        if color == 8:
            color8_cnt += 1
            continue
        min_colors[color] = True
        max_colors[color] = True

    k = 0
    for i in range(color8_cnt):
        if k == len(max_colors)-1:
            break

        for j in range(k, len(max_colors)):
            k = j
            if not max_colors[j]:
                max_colors[j] = True
                break
    
    min_ans = 0
    for i, c in enumerate(min_colors):
        if c:
            min_ans += 1

    max_ans = 0
    for i, c in enumerate(max_colors):
        if c:
            max_ans += 1

    print("{} {}".format(min_ans, max_ans))



if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
free = 0
color = set()
for i in a:
    if i >= 3200:
        free += 1
    else:
        color.add(i//400)
print(len(color), len(color) + free)

Submission status: Wrong Answer

Solution code:
#   1 - 399：灰色
#  400- 799：茶色
#  800-1199：緑色
# 1200-1599：水色
# 1600-1999：青色
# 2000-2399：黄色
# 2400-2799：橙色
# 2800-3199：赤色
# また、レートが 3200 以上になると色を自由に変えることができます。

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

used_colors = set()
unknown_color = 0

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

minimum = max(1, min(max(len(used_colors), unknown_color), 8))
maximum = min(8, len(used_colors) + unknown_color)
print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
#   1 - 399：灰色
#  400- 799：茶色
#  800-1199：緑色
# 1200-1599：水色
# 1600-1999：青色
# 2000-2399：黄色
# 2400-2799：橙色
# 2800-3199：赤色
# また、レートが 3200 以上になると色を自由に変えることができます。

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

used_colors = set()
unknown_color = 0

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

minimum = max(1, len(used_colors))
maximum = min(8, len(used_colors) + unknown_color)
print(minimum, maximum)

Submission status: Wrong Answer

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

count = [0,0,0,0,0,0,0,0,0]

for a in A:
    if a<= 399:
        count[0] = 1
    elif a<= 799:
        count[1] = 1
    elif a<= 1199:
        count[2] = 1
    elif a<= 1599:
        count[3] = 1
    elif a<= 1999:
        count[4] = 1
    elif a<= 2399:
        count[5] = 1
    elif a<= 2799:
        count[6] = 1
    elif a<= 3199:
        count[7] = 1
    else:
        count[8] += 1

print(sum(count[:-1]),sum(count))

Submission status: Wrong Answer

Solution code:
from collections import Counter
N=int(input())
z=Counter([int(int(x)/400) for x in input().split()])
if 8 in z:
	print("%d %d" % (max(1, len(z)-1), len(z)-1+z[8]))
else:
	print("%d %d" % (len(z), len(z)))

Submission status: Wrong Answer

Solution code:
from collections import Counter
N=int(input())
z=Counter([int(int(x)/400) for x in input().split()])
if 8 in z:
	print("%d %d" % (min(1, len(z)-1), len(z)-1+z[8]))
else:
	print("%d %d" % (len(z), len(z)))

Submission status: Wrong Answer

Solution code:
from collections import Counter
N=int(input())
z=Counter([int(int(x)/400) for x in input().split()])
if 8 in z:
	print("%d %d" % (len(z)-1, len(z)-1+z[8]))
else:
	print("%d %d" % (len(z), len(z)))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [list(range(1,400))]+[list(range(400*i,400*i+399)) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
ans = vars.count(True)
if ans == 0:
    print(1, ans+len(exc))
else:
    print(ans, ans+len(exc))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [list(range(1,400))]+[list(range(400*i,400*i+399)) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    print(1, len(exc))
else:
    ans = vars.count(True)
    if exc == []:
        print(ans, ans)
    else:
        if ans == 0:
            while True:
                ans += 1
        print(ans, ans+len(exc))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [list(range(1,400))]+[list(range(400*i,400*i+399)) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    print(1, len(exc))
else:
    ans = vars.count(True)
    if exc == []:
        print(ans, ans)
    else:
        print(ans, ans+len(exc))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [list(range(1,400))]+[list(range(400*i,400*i+399)) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    print(1, min(len(exc), 8))
else:
    ans = vars.count(True)
    if exc == []:
        print(ans, ans)
    else:
        print(ans, ans+len(exc))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [list(range(1,400))]+[list(range(400*i,400*i+399)) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    while True:
        ans = 0
    print(1, min(len(exc), 8))
else:
    ans = vars.count(True)
    if exc == []:
        print(ans, ans)
    else:
        print(ans, min(ans+len(exc), 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [list(range(1,400))]+[list(range(400*i,400*i+399)) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    print(1, min(len(exc), 8))
else:
    ans = vars.count(True)
    if exc == []:
        while True:
            ans += 1
        print(ans, ans)
    else:
        print(ans, min(ans+len(exc), 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [list(range(1,400))]+[list(range(400*i,400*i+399)) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    print(1, min(len(exc), 8))
else:
    ans = vars.count(True)
    if exc == []:
        print(ans, ans)
    else:
        print(ans, min(ans+len(exc), 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [range(1,400)]+[range(400*i,400*i+399) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    print(1, min(len(exc), 8))
else:
    ans = vars.count(True)
    if exc == []:
        print(ans, ans)
    else:
        print("a")
        print(ans, min(ans+len(exc), 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [range(1,400)]+[range(400*i,400*i+399) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    print(1, len(exc))
else:
    ans = vars.count(True)
    if exc == []:
        print(ans, ans)
    else:
        print(ans, min(ans+len(exc), 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [range(1,400)]+[range(400*i,400*i+399) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    print(1, min(len(exc), 8))
else:
    ans = vars.count(True)
    if exc == []:
        print(ans, ans)
    else:
        print(ans, min(ans+len(exc), 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [range(1,400)]+[range(400*i,400*i+399) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    print(1, min(len(exc), 8))
else:
    ans = vars.count(True)
    if exc == []:
        print(ans, ans)
    else:
        print(ans, min(ans+len(exc), 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [range(1,400)]+[range(400*i,400*i+399) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    print(1, 1)
else:
    ans = vars.count(True)
    if exc == []:
        print(ans, ans)
    else:
        print(ans, min(ans+len(exc), 8))

Submission status: Wrong Answer

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import math
from collections import defaultdict



def check(a):
  if a <= 399: return 0
  elif a < 799: return 1
  elif a < 1199: return 2
  elif a < 1599: return 3
  elif a < 1999: return 4
  elif a < 2399: return 5
  elif a < 2799: return 6
  elif a < 3199: return 7
  else: return 8
  

def main():
  N = int(input())
  An = list(map(int, input().split()))
  Cn = [0]*9
  for a in An:
    Cn[check(a)] += 1
  mn = 0
  for i in range(8):
    if Cn[i]>0: mn += 1
  return max(1,mn),mn+Cn[8]


if __name__ == "__main__":
  mn,mx = main()

  print(mn,mx)

Submission status: Wrong Answer

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import math
from collections import defaultdict



def check(a):
  if a <= 399: return 0
  elif a < 799: return 1
  elif a < 1199: return 2
  elif a < 1599: return 3
  elif a < 1999: return 4
  elif a < 2399: return 5
  elif a < 2799: return 6
  elif a < 3199: return 7
  else: return 8
  

def main():
  N = int(input())
  An = list(map(int, input().split()))
  Cn = [0]*9
  for a in An:
    Cn[check(a)] += 1
  mn = 0
  for i in range(8):
    if Cn[i]>0: mn += 1
  return max(1,mn),min(8,mn+Cn[8])


if __name__ == "__main__":
  mn,mx = main()

  print(mn,mx)

Submission status: Wrong Answer

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import math
from collections import defaultdict



def check(a):
  if a <= 399: return 0
  elif a < 799: return 1
  elif a < 1199: return 2
  elif a < 1599: return 3
  elif a < 1999: return 4
  elif a < 2399: return 5
  elif a < 2799: return 6
  elif a < 3199: return 7
  else: return 8
  

def main():
  N = int(input())
  An = list(map(int, input().split()))
  Cn = [0]*9
  for a in An:
    Cn[check(a)] += 1
  mn = 0
  for i in range(8):
    if Cn[i]>0: mn += 1
  mx = mn
  if Cn[8] > 0:
    mx += Cn[8]
  return mn,mx


if __name__ == "__main__":
  mn,mx = main()
  print(max(1,mn),mx)

Submission status: Wrong Answer

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import math
from collections import defaultdict



def check(a):
  if a <= 399: return 0
  elif a < 799: return 1
  elif a < 1199: return 2
  elif a < 1599: return 3
  elif a < 1999: return 4
  elif a < 2399: return 5
  elif a < 2799: return 6
  elif a < 3199: return 7
  else: return 8
  

def main():
  N = int(input())
  An = list(map(int, input().split()))
  Cn = [0]*9
  for a in An:
    Cn[check(a)] += 1
  mn = 0
  for i in range(8):
    if Cn[i]>0: mn += 1
  mx = mn
  if Cn[8] > 0:
    mx += Cn[8]
  return mn,mx


if __name__ == "__main__":
  mn,mx = main()
  print(max(1,mn),min(8,mx))

Submission status: Wrong Answer

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import math
from collections import defaultdict



def check(a):
  if a <= 399: return 0
  elif a < 799: return 1
  elif a < 1199: return 2
  elif a < 1599: return 3
  elif a < 1999: return 4
  elif a < 2399: return 5
  elif a < 2799: return 6
  elif a < 3199: return 7
  else: return 8
  

def main():
  N = int(input())
  An = list(map(int, input().split()))
  Cn = [0]*9
  for a in An:
    Cn[check(a)] += 1
  mn = 0
  for i in range(8):
    if Cn[i]>0: mn += 1
  mx = mn
  if Cn[8] > 0:
    mx += Cn[8]
  return mn,mx


if __name__ == "__main__":
  mn,mx = main()
  print(max(1,mn),min(9,mx))

Submission status: Wrong Answer

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import math
from collections import defaultdict



def check(a):
  if a <= 399: return 0
  elif a < 799: return 1
  elif a < 1199: return 2
  elif a < 1599: return 3
  elif a < 1999: return 4
  elif a < 2399: return 5
  elif a < 2799: return 6
  elif a < 3199: return 7
  else: return 8
  

def main():
  N = int(input())
  An = list(map(int, input().split()))
  Cn = [0]*9
  for a in An:
    Cn[check(a)] += 1
  mn = 0
  for i in range(8):
    if Cn[i]>0: mn += 1
  mx = mn
  if Cn[8] > 0:
    mx += Cn[8]
  return mn,mx


if __name__ == "__main__":
  mn,mx = main()
  print(mn,mx)

Submission status: Wrong Answer

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import math
from collections import defaultdict



def check(a):
  if a <= 399: return 0
  elif a <= 799: return 1
  elif a <= 1199: return 2
  elif a <= 1599: return 3
  elif a <= 1999: return 4
  elif a <= 2399: return 5
  elif a <= 2799: return 6
  elif a <= 3199: return 7
  else: return 8


def main():
  N = int(input())
  An = list(map(int, input().split()))
  colors = defaultdict(lambda:0)
  for a in An:
    colors[check(a)] += 1
  mn = len(colors)
  mx = mn
  if colors[8] > 0:
    mn -= 1
    mx = mn+colors[8]
  return [mn,mx]

if __name__ == "__main__":
  ans = main()
  print(ans[0],ans[1])

Submission status: Wrong Answer

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import math
from collections import defaultdict



def check(a):
  if a <= 399: return 0
  elif a <= 799: return 1
  elif a <= 1199: return 2
  elif a <= 1599: return 3
  elif a <= 1999: return 4
  elif a <= 2399: return 5
  elif a <= 2799: return 6
  elif a <= 3199: return 7
  else: return 8


def main():
  N = int(input())
  An = list(map(int, input().split()))
  colors = defaultdict(lambda:0)
  for a in An:
    colors[check(a)] += 1
  mn = len(colors)
  mx = mn
  if colors[8] > 0:
    mn -= 1
    mx = min(9,mn+colors[8])
  return [mn,mx]

if __name__ == "__main__":
  ans = main()
  print(ans[0],ans[1])

Submission status: Wrong Answer

Solution code:
n=int(input())
arr=list(map(int,input().split()))
for i in range(n):
  arr[i]=arr[i]//400
cnt=[arr.count(i) for i in range(9)]
ans=0
for i in range(8):
  if cnt[i]!=0:
    ans+=1
if ans==0:
  print(1,cnt[-1])
else:
  print(ans,ans+cnt[-1])

Submission status: Wrong Answer

Solution code:
n=int(input())
arr=list(map(int,input().split()))
for i in range(n):
  arr[i]=arr[i]//400
cnt=[arr.count(i) for i in range(9)]
ans=0
for i in range(8):
  if cnt[i]!=0:
    ans+=1
if ans==0:
  if cnt[-1]==0:
    print(0,0)
  else:
    print(1,cnt[-1])
else:
  print(ans,ans+cnt[-1])

Submission status: Wrong Answer

Solution code:
n=int(input())
arr=list(map(int,input().split()))
for i in range(n):
  arr[i]=arr[i]//400
cnt=[arr.count(i) for i in range(9)]
min=sum(arr[:-1])
max=min+arr[-1]
print(min,max)

Submission status: Wrong Answer

Solution code:
n=int(input())
arr=list(map(int,input().split()))
for i in range(n):
  arr[i]=arr[i]//400
cnt=[arr.count(i) for i in range(9)]
min=sum(arr[:-1])
max=min+arr[-1]

Submission status: Wrong Answer

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


for a in lst_a:
    if 1 <= a <= 399:
        lst_color[0] += 1
    elif 400 <= a <= 799:
        lst_color[1] += 1
    elif 800 <= a <= 1199:
        lst_color[2] += 1
    elif 1200 <= a <= 1599:
        lst_color[3] += 1
    elif 1600 <= a <= 1999:
        lst_color[4] += 1
    elif 2000 <= a <= 2399:
        lst_color[5] += 1
    elif 2400 <= a <= 2799:
        lst_color[6] += 1
    elif 2800 <= a <= 3199:
        lst_color[7] += 1
    else:
        lst_color[8] += 1
num_existed_rate = sum(1 for x in lst_color[:8] if x!=0)


num_super = lst_color[8]
num_uncolored = 8 - num_existed_rate
if num_super >= num_uncolored:
    num_max = 8
else:
    num_max = num_existed_rate + num_super
if num_existed_rate == 0:
    num_min = 1
else:
    num_min = num_existed_rate


print(num_min, num_max)

Submission status: Wrong Answer

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

N = int(input())
L = [int(v) // 400 for v in input().split()]
ma = max(L)

if ma < 8:
    s = set(L)
    print(len(s), len(s))
else:
    ml = [v for v in L if v < 8]
    ms = set(ml)
    
    pl = [v for v in L if v >= 8]
    
    if len(ms) == 8:
        print(8, 8)
    else:
        t = len(ms) + len(pl)
        mm = len(ms)
        print(mm if mm != 0 else 1, t if t <= 8 else 8)

Submission status: Wrong Answer

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

N = int(input())
L = [int(v) // 400 for v in input().split()]
ma = max(L)

if ma < 8:
    s = set(L)
    print(len(s), len(s))
else:
    ml = [v for v in L if v < 8]
    ms = set(ml)
    
    pl = [v for v in L if v >= 8]
    
    if len(ms) == 8:
        print(8, 8)
    else:
        t = len(ms) + len(pl)
        
        if t >= 8:
            print(8, 8)
        else:
            mm = len(ms)
            print(mm if mm != 0 else 1, t)

Submission status: Wrong Answer

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

N = int(input())
L = [int(v) // 400 for v in input().split()]
ma = max(L)

if ma < 8:
    t = set(L)
    print(len(t), len(t))
else:
    p = len([v for v in L if v < 8])
    t = len([v for v in L if v >= 8])
    print((p if p <= 8 else 8) if p != 0 else 1, p + t if p + t <= 8 else 8)

Submission status: Wrong Answer

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

N = int(input())
L = [int(v) // 400 for v in input().split()]
ma = max(L)

if ma < 8:
    t = set(L)
    print(len(t), len(t))
else:
    p = len([v for v in L if v < 8])
    t = len([v for v in L if v >= 8])
    print(p if p != 0 else 1, p + t if p + t <= 8 else 8)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
A = (int(i) // 400 for i in input().split())

mi, d = 0, 0
for k, v in Counter(A).items():
    if k >= 8:
        d += v
    else:
        mi += 1

print(mi, mi + d)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
rate = [400 * i for i in range(9)]
nums = [0] * 8
tourist = 0

for i in range(N):
    for j in range(8):
        if rate[j] <= a[i] < rate[j+1]:
            nums[j] = 1
    if a[i] >= 3200:
        tourist += 1

color = nums.count(1)

print(color, color + tourist)

Submission status: Wrong Answer

Solution code:
N = int(input())
c = [0] * 9
for a in map(int, input().split()):
    c[min(a // 400, 8)] += 1
csum = sum(map(lambda x: min(x, 1), c[:8]))
print(csum, csum + c[8])

Submission status: Wrong Answer

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

color = [0] * 9
for i in range(N):
  if a[i] < 400:
    color[0] += 1
  elif a[i] < 800:
    color[1] += 1
  elif a[i] < 1200:
    color[2] += 1
  elif a[i] < 1600:
    color[3] += 1
  elif a[i] < 2000:
    color[4] += 1
  elif a[i] < 2400:
    color[5] += 1
  elif a[i] < 2800:
    color[6] += 1
  elif a[i] < 3200:
    color[7] += 1
  else:
    color[8] += 1
#print(color)
tmp = 0
for i in range(8):
  if color[i] > 0:
    tmp += 1
color_min = max(tmp, 1)
color_max = min(8, tmp + color[8])
print("{0} {1}".format(color_min, color_max))

Submission status: Wrong Answer

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

color = [0] * 9
for i in range(N):
  if a[i] < 400:
    color[0] += 1
  elif a[i] < 800:
    color[1] += 1
  elif a[i] < 1200:
    color[2] += 1
  elif a[i] < 1600:
    color[3] += 1
  elif a[i] < 2000:
    color[4] += 1
  elif a[i] < 2400:
    color[5] += 1
  elif a[i] < 2800:
    color[6] += 1
  elif a[i] < 3200:
    color[7] += 1
  else:
    color[8] += 1
#print(color)
tmp = 0
for i in range(8):
  if color[i] > 0:
    tmp += 1
color_min = max(tmp, 1)
color_max = tmp + min(8-tmp, color[8])
print("{0} {1}".format(color_min, color_max))

Submission status: Wrong Answer

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

color = [0] * 9
for i in range(N):
  if a[i] <= 399:
    color[0] += 1
  elif a[i] <= 799:
    color[1] += 1
  elif a[i] <= 1199:
    color[2] += 1
  elif a[i] <= 1599:
    color[3] += 1
  elif a[i] <= 1999:
    color[4] += 1
  elif a[i] <= 2399:
    color[5] += 1
  elif a[i] <= 2799:
    color[6] += 1
  elif a[i] <= 3199:
    color[7] += 1
  else:
    color[8] += 1
#print(color)
tmp = 0
for i in range(8):
  if color[i] > 0:
    tmp += 1
color_min = max(tmp, 1)
color_max = tmp + min(8-tmp, color[8])
print("{0} {1}".format(color_min, color_max))

Submission status: Wrong Answer

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

color = [0] * 9
for i in range(N):
  if a[i] <= 399:
    color[0] += 1
  elif a[i] <= 799:
    color[1] += 1
  elif a[i] <= 1199:
    color[2] += 1
  elif a[i] <= 1599:
    color[3] += 1
  elif a[i] <= 1999:
    color[4] += 1
  elif a[i] <= 2399:
    color[5] += 1
  elif a[i] <= 2799:
    color[6] += 1
  elif a[i] <= 3199:
    color[7] += 1
  else:
    color[8] += 1
print(color)
tmp = 0
for i in range(8):
  if color[i] > 0:
    tmp += 1
color_min = max(tmp, 1)
color_max = tmp + min(8-tmp, color[8])
#print("{0} {1}".format(color_min, color_max))

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
a = list(map(lambda x:int(x)//400,input().split(" ")))
c = Counter(a)
s = 0
for i in [0,1,2,3,4,5,6,7]:
    s += (c[i] and 1)
l = max(1,s)
m = s+c[8]
print(str(l)+" "+str(m))

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
a = list(map(lambda x:int(x)//400,input().split(" ")))
c = Counter(a)
s = 0
for i in [0,1,2,3,4,5,6,7]:
    s += (c[i] and 1)
l = max(1,s)
m = min(8,s+c[8])
print(str(l)+" "+str(m))

Submission status: Wrong Answer

Solution code:
import collections
def color(n):
    if 1 <= n <= 399:
        return 1
    elif 400 <= n <= 799:
        return 2
    elif 800 <= n <= 1199:
        return 3
    elif 1200 <= n <= 1599:
        return 4
    elif 1600 <= n <= 1999:
        return 5
    elif 2000 <= n <= 2399:
        return 6
    elif 2400 <= n <= 2799:
        return 7
    elif 2800 <= n <= 3199:
        return 8
    elif 3200 <= n:
        return 9
    

n = int(input())
a = list(map(int,input().split()))
for i in range(n):
    a[i] = color(a[i])
data = collections.Counter(a)
mnm = 0
for i in data:
    if i != 9 and data[i] != 0:
        mnm += 1
print(mnm,mnm+data[9])

Submission status: Wrong Answer

Solution code:
#ABC064C
N = int(input())
ai = list(map(int, input().split()))
hai = 0
tya = 0
mido = 0
mizu = 0
ao = 0
ki = 0
ore = 0
aka = 0
kinds = 0
all_c = 0
for a in ai:
    if a < 400:
        hai = 1
    elif a < 800:
        tya = 1
    elif a < 1200:
        mido = 1
    elif a < 1600:
        mizu = 1
    elif a < 2000:
        ao = 1
    elif a < 2400:
        ki = 1
    elif a < 2800:
        ore = 1    
    elif a < 3200:
        aka = 1
    else:
        all_c += 1 
colors = [hai,tya,mido,mizu,ao,ki,ore,aka]
for color in colors:
    if color == 1:
        kinds += 1
min_c = 0
max_c = 0
if kinds ==0:
    min_c = 1
else:
    min_c = kinds
if 8-kinds > all_c:
    max_c += kinds + all_c
else:
    max_c = 8
print(str(min_c) + " " + str(max_c))

Submission status: Wrong Answer

Solution code:
#ABC064C
N = int(input())
ai = list(map(int, input().split()))
hai = 0
tya = 0
mido = 0
mizu = 0
ao = 0
ki = 0
ore = 0
aka = 0
kinds = 0
all_c = 0
for a in ai:
    if a < 400:
        hai = 1
    elif a < 800:
        tya = 1
    elif a < 1200:
        mido = 1
    elif a < 1600:
        mizu = 1
    elif a < 2000:
        ao = 1
    elif a < 2400:
        ki = 1
    elif a < 2800:
        ore = 1    
    elif a < 3200:
        aka = 1
    else:
        all_c += 1 
colors = [hai,tya,mido,mizu,ao,ki,ore,aka]
for color in colors:
    if color == 1:
        kinds += 1
min_c = kinds
max_c = 0
no_color = 8-kinds
if no_color >= all_c:
    max_c += kinds + all_c
else:
    max_c = 8
print(str(min_c) + " " + str(max_c))

Submission status: Wrong Answer

Solution code:
#ABC064C
N = int(input())
ai = list(map(int, input().split()))
hai = 0
tya = 0
mido = 0
mizu = 0
ao = 0
ki = 0
ore = 0
aka = 0
kinds = 0
for a in ai:
    if a < 400:
        hai = 1
    elif a < 800:
        tya = 1
    elif a < 1200:
        mido = 1
    elif a < 1600:
        mizu = 1
    elif a < 2000:
        ao = 1
    elif a < 2400:
        ki = 1
    elif a < 2800:
        ore = 1    
    else:
        aka +=1
colors = [hai,tya,mido,mizu,ao,ki,ore]
for color in colors:
    if color == 1:
        kinds += 1
min_n = kinds
if aka > kinds:
    min_n = kinds + 1
max_n = 0
no_color = 7-kinds
if no_color >= aka:
    max_n += kinds + aka
else:
    max_n = 8
print(str(min_n) + " " + str(max_n))

Submission status: Wrong Answer

Solution code:
#ABC064C
N = int(input())
ai = list(map(int, input().split()))
hai = 0
tya = 0
mido = 0
mizu = 0
ao = 0
ki = 0
ore = 0
aka = 0
kinds = 0
for a in ai:
    if a < 400:
        hai = 1
    elif a < 800:
        tya = 1
    elif a < 1200:
        mido = 1
    elif a < 1600:
        mizu = 1
    elif a < 2000:
        ao = 1
    elif a < 2400:
        ki = 1
    elif a < 2800:
        ore = 1    
    else:
        aka +=1
colors = [hai,tya,mido,mizu,ao,ki,ore]
for color in colors:
    if color == 1:
        kinds += 1
min_n = kinds
if aka > kinds:
    min_n = kinds + 1
max_n = 0
no_color = 8-kinds
if no_color >= aka:
    max_n += kinds + aka
else:
    max_n = 8
print(str(min_n) + " " + str(max_n))