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())
lst = [int(i) for i in input().split()]
rate = [0] * 8
num = 0

for i in range(n):
    k = lst[i] // 400
    if k < 8 and rate[k] == 0:
        rate[k] += 1
    elif k >= 8:
        num += 1


c = rate.count(1)
y = min(num+c,8)

if c == 0:
    x = 1
else:
    x = c

print(x,y)

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = [int(i) for i in input().split()]
rate = [0] * 8

cnt = 0
for i in range(n):
    k = lst[i] // 400
    if k < 8 and rate[k] == 0:
        rate[k] = 1
    elif k >= 8:
        cnt += 1

c0 = rate.count(0)
c1 = rate.count(1)

x = max(c1,cnt)
y = min(c1+cnt,8)

print(x,y)

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = [int(i) for i in input().split()]
rate = [0] * 8

cnt = 0
for i in range(n):
    k = lst[i] // 400
    if k < 8 and rate[k] == 0:
        rate[k] = 1
    elif k >= 8:
        cnt += 1

c0 = rate.count(0)
c1 = rate.count(1)

if cnt > c1:
    Min = cnt
else:
    Min = c1

if cnt <= c0:
    Max = c1 + cnt
else:
    Max = 8

print(Min,Max)

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = [int(i) for i in input().split()]
rate = [0] * 9

cnt = 0
for i in range(n):
    k = lst[i] // 400
    if k < 8 and rate[k] == 0:
        rate[k] = 1
    elif k >= 8:
        cnt += 1

c0 = rate.count(0)
c1 = rate.count(1)

if cnt > c1:
    Min = cnt
else:
    Min = c1

if cnt <= c0:
    Max = c1 + cnt
else:
    Max = 8

print(Min,Max)

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = [int(i) for i in input().split()]
rate = [0] * 9

cnt = 0
for i in range(n):
    k = lst[i] // 400
    if k < 8 and rate[k] == 0:
        rate[k] = 1
    elif k >= 8:
        cnt += 1

c0 = rate.count(0)
c1 = rate.count(1)

Min = max(c1,cnt)
Max = min(c1+cnt,8)

print(Min,Max)

Submission status: Wrong Answer

Solution code:
# 2019/08/08

from bisect import bisect_left

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

pre=0
cnt=0
for i in range(1,9):
    idx=bisect_left(a,i*400)
    if idx==pre or idx==0:continue
    cnt+=1
    pre=idx

    
if idx<n-1:
    if cnt==0:
        cnt+=1
        res=n-idx
    else:
        res=n-idx+cnt

else:res=cnt
print(cnt,res,sep=' ')

Submission status: Wrong Answer

Solution code:
# 2019/08/08

from bisect import bisect_left

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

pre=0
cnt=0
for i in range(1,9):
    idx=bisect_left(a,i*400)
    if idx==pre or idx==0:continue
    cnt+=1
    pre=idx

if idx<n-1:
    res=n-idx+cnt
else:res=cnt
print(cnt,res,sep=' ')

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
score = [[1,399,0],[400,799,0],[800,1199,0],[1200,1599,0],[1600,1999,0],[2000,2399,0],[2400,2799,0],[2800,3199,0],[3200,4800,0]]

for i in range(N):
    for j in range(len(score)):
        if score[j][0] <= a[i] <= score[j][1]:
            score[j][2] += 1
            break
        else:
            continue
ans = 0
for _,_,cnt in score[:-1]:
    print(cnt)
    if cnt >= 1:
        ans += 1
print(max(1, ans, ans-score[-1][2]), ans+score[-1][2])

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
score = [[1,399,0],[400,799,0],[800,1199,0],[1200,1599,0],[1600,1999,0],[2000,2399,0],[2400,2799,0],[2800,3199,0],[3200,4800,0]]

for i in range(N):
    for j in range(len(score)):
        if score[j][0] <= a[i] <= score[j][1]:
            score[j][2] += 1
            break
        else:
            continue
ans = 0
for _,_,cnt in score[:-1]:
    if cnt >= 1:
        ans += 1
print(max(1, ans, ans-score[-1][2]), min(8, ans+score[-1][2]))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
score = [[1,399,0],[400,799,0],[800,1199,0],[1200,1599,0],[1600,1999,0],[2000,2399,0],[2400,2799,0],[2800,3199,0],[3200,4800,0]]

for i in range(N):
    for j in range(len(score)):
        if score[j][0] <= a[i] <= score[j][1]:
            score[j][2] += 1
            break
        else:
            continue
ans = 0
for _,_,cnt in score[:-1]:
    if cnt >= 1:
        ans += 1
print(max(ans, ans-score[-1][2]), min(8, ans+score[-1][2]))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
score = [[1,399,0],[400,799,0],[800,1199,0],[1200,1599,0],[1600,1999,0],[2000,2399,0],[2400,2799,0],[2800,3199,0],[3200,4800,0]]

for i in range(N):
    for j in range(len(score)):
        if score[j][0] <= a[i] <= score[j][1]:
            score[j][2] += 1
            break
        else:
            continue
ans = 0
for _,_,cnt in score:
    if cnt >= 1:
        ans += 1
if score[-1][2] != 0:
    print(max(1, ans-cnt+1), min(8, ans+cnt-1))
else:
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
score = [[1,399,0],[400,799,0],[800,1199,0],[1200,1599,0],[1600,1999,0],[2000,2399,0],[2400,2799,0],[2800,3199,0],[3200,4800,0]]

for i in range(N):
    for j in range(len(score)):
        if score[j][0] <= a[i] <= score[j][1]:
            score[j][2] += 1
            break
        else:
            continue
ans = 0
for _,_,cnt in score:
    if cnt >= 1:
        ans += 1
if score[-1][2] != 0:
    print(max(1, ans-cnt), min(8, ans+cnt-1))
else:
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
score = [[1,399,0],[400,799,0],[800,1199,0],[1200,1599,0],[1600,1999,0],[2000,2399,0],[2400,2799,0],[2800,3199,0],[3200,4800,0]]

for i in range(N):
    for j in range(len(score)):
        if score[j][0] <= a[i] <= score[j][1]:
            score[j][2] += 1
            break
        else:
            continue
ans = 0
for _,_,cnt in score:
    if cnt >= 1:
        ans += 1
if score[-1][2] != 0:
    print(max(1, ans-cnt), min(8, ans+cnt))
else:
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
score = [[1,399,0],[400,799,0],[800,1199,0],[1200,1599,0],[1600,1999,0],[2000,2399,0],[2400,2799,0],[2800,3199,0],[3200,4800,0]]

for i in range(N):
    for j in range(len(score)):
        if score[j][0] <= a[i] <= score[j][1]:
            score[j][2] = 1
            break
        else:
            continue
ans = 0
for _,_,cnt in score:
    if cnt >= 1:
        ans += 1
if score[-1][2] != 0:
    print(max(1, ans-cnt), min(7, ans+cnt))
else:
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
score = [[1,399,0],[400,799,0],[800,1199,0],[1200,1599,0],[1600,1999,0],[2000,2399,0],[2400,2799,0],[2800,3199,0],[3200,4800,0]]

for i in range(N):
    for j in range(len(score)):
        if score[j][0] <= a[i] <= score[j][1]:
            score[j][2] = 1
            break
        else:
            continue
ans = 0
for _,_,cnt in score:
    if cnt >= 1:
        ans += 1
if score[-1][2] != 0:
    print(max(1, ans-cnt), min(8, ans+cnt))
else:
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
score = [[1,399,0],[400,799,0],[800,1199,0],[1200,1599,0],[1600,1999,0],[2000,2399,0],[2400,2799,0],[2800,3199,0],[3200,4800,0]]

for i in range(N):
    for j in range(len(score)):
        if score[j][0] <= a[i] <= score[j][1]:
            score[j][2] = 1
            break
        else:
            continue
ans = 0
for _,_,cnt in score:
    if cnt >= 1:
        ans += 1
if score[-1][2] != 0:
    print(max(1, ans-1), min(8, ans+cnt))
else:
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
score = [[1,399,0],[400,799,0],[800,1199,0],[1200,1599,0],[1600,1999,0],[2000,2399,0],[2400,2799,0],[2800,3199,0],[3200,4800,0]]

for i in range(N):
    for j in range(len(score)):
        if score[j][0] <= a[i] <= score[j][1]:
            score[j][2] = 1
            break
        else:
            continue
ans = 0
for _,_,cnt in score:
    if cnt <= 1:
        ans += 1
if score[-1][2] != 0:
    print(max(1, ans-1), min(8, ans+cnt))
else:
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
score = [[1,399,0],[400,799,0],[800,1199,0],[1200,1599,0],[1600,1999,0],[2000,2399,0],[2400,2799,0],[2800,3199,0],[3200,4800,0]]

for i in range(N):
    for j in range(len(score)):
        if score[j][0] <= a[i] <= score[j][1]:
            score[j][2] = 1
            break
        else:
            continue
ans = 0
for _,_,cnt in score:
    if cnt == 1:
        ans += 1
if score[-1][2] != 0:
    print(max(1, ans-1), min(8, ans+cnt))
else:
    print(ans, ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a = list(map(int, input().split()))
b = 0
c = 0
d = 0
e = 0
f = 0
g = 0
h = 0
k = 0
ans = 0
j=0
for i in range(n):
    col = a[i]
    if col <= 399 and b == 0:
        b = 1
        ans += 1
    elif 400 <= col <= 799 and c == 0:
        c = 1
        ans += 1
    elif 800 <= col <= 1199 and d == 0:
        d = 1
        ans += 1
    elif 1200 <= col <= 1599 and e == 0:
        e = 1
        ans += 1
    elif 1600 <= col <= 1999 and f == 0:
        f = 1
        ans += 1
    elif 2000 <= col <= 2399 and g == 0:
        g = 1
        ans += 1
    elif 2400 <= col <= 2799 and h == 0:
        h = 1
        ans += 1
    elif 2800 <= col <= 3199 and k == 0:
        k = 1
        ans += 1
    elif 3200<=col:
        ans += 1
        j+=1
print(ans-j,"",ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
b,c=[],0
b.append(len([a for a in a if a<400]))
b.append(len([a for a in a if a<800 and a>=400]))
b.append(len([a for a in a if a<1200 and a>=800]))
b.append(len([a for a in a if a<1600 and a>=1200]))
b.append(len([a for a in a if a<2000 and a>=1600]))
b.append(len([a for a in a if a<2400 and a>=2000]))
b.append(len([a for a in a if a<2800 and a>=2400]))
b.append(len([a for a in a if a<3200 and a>=2800]))
b.append(len([a for a in a if a>=3200]))
for i in range(8):
    if b[i]>0:
        c+=1
if b[8]>0:
    print(c,c+b[8])
else:
    print(c,c)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
b,c=[],0
b.append(len([a for a in a if a<400]))
b.append(len([a for a in a if a<800 and a>=400]))
b.append(len([a for a in a if a<1200 and a>=800]))
b.append(len([a for a in a if a<1600 and a>=1200]))
b.append(len([a for a in a if a<2000 and a>=1600]))
b.append(len([a for a in a if a<2400 and a>=2000]))
b.append(len([a for a in a if a<2800 and a>=2400]))
b.append(len([a for a in a if a<3200 and a>=2800]))
b.append(len([a for a in a if a>=3200]))
for i in range(8):
    if b[i]>0:
        c+=1
if b[8]>0:
    print(c,min(c+b[8],9))
else:
    print(c,c)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
an = list(map(int,input().split()))
rate_bucket = [0] * 9
ret = 0
for a in an:
    rate_bucket[min(a//400,8)]+=1
for i in rate_bucket[0:-1:]:
    if i > 0:
        ret+=1
print("{} {}".format(ret,ret+rate_bucket[-1]))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
an = list(map(int,input().split()))
rate_bucket = [0] * 9
ret = 0
for a in an:
    rate_bucket[min(a,3200)//400]+=1
for i in rate_bucket[0:-1:]:
    if i > 0:
        ret+=1
print("{} {}".format(ret,ret+rate_bucket[-1]))

Submission status: Wrong Answer

Solution code:
from bisect import bisect as bisect

def main():
    score = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
    M = len(score)
    N = int(input())
    A = [int(x) for x in input().split()]

    colors = set()
    m = 0
    for a in A:
        i = bisect(score, a)
        if i != M:
            colors.add(i)
        elif i == M:
            m += 1
    print(len(colors), len(colors)+m)

main()

Submission status: Wrong Answer

Solution code:
late = range(0, 3201, 400)
m = len(late)
num = [0]*m
free_color = 0


N = int(input())

for i in input().split():
	t = int(i)
	flag = True
	for j in range(1, m):
		if late[j] >t:
			num[j-1] += 1
			flag = False
			break
	if flag:
		free_color += 1

num_color = 0
for n in num:
	if n!=0:
		num_color += 1

if not(num_color):
	print(1, min(num_color+free_color, m-1))
else:
	print(num_color, min(num_color+free_color, m-1))

Submission status: Wrong Answer

Solution code:
late = range(0, 3201, 400)
m = len(late)
num = [0]*m
free_color = 0


N = int(input())

for i in input().split():
	t = int(i)
	flag = True
	for j in range(1, m):
		if late[j] >t:
			num[j-1] += 1
			flag = False
			break
	if flag:
		free_color += 1

num_color = 0
for n in num:
	if n!=0:
		num_color += 1

if not(num_color):
	print(1, min(num_color+free_color, m))
else:
	print(num_color, min(num_color+free_color, m))

Submission status: Wrong Answer

Solution code:
li_a = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 1000000]
li_b = ["a", "b", "c", "d", "e", "f", "g", "h", 1]

n = int(input())
people = list(map(int,input().split()))
ans = []
cnt = 0

t = 0

for i in range(n):
    for j in range(9):
        if people[i] >= 3200:
            cnt += 1
            break
        elif people[i] <= li_a[j]:
            ans.append(li_b[j])
            break

ans = list(set(ans))
if cnt > 0:
    t = cnt
print(len(ans),len(ans)+t)

Submission status: Wrong Answer

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

colorlist = [0] * 8
freecolor = 0
colormin = 0
for i in a:
    if i >= 3200:
        freecolor += 1
    else:
        colorlist[i // 400] += 1


# print(colorlist)

for i in colorlist:
    if i != 0:
        colormin += 1

# 最小値
if colormin == 0:
    print(1, end=' ')
else:
    print(colormin, end=' ')

# 最大値
s = colormin + freecolor
if s > 8:
    s = 8
print(s)

Submission status: Wrong Answer

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

colorlist = [0] * 8
freecolor = 0
colormin = 0
for i in a:
    if i >= 3200:
        freecolor += 1
    else:
        colorlist[i // 400] += 1


print(colorlist)

for i in colorlist:
    if i != 0:
        colormin += 1

# 最小値
if colormin == 0:
    print(1, end=' ')
else:
    print(colormin, end=' ')

# 最大値
s = colormin + freecolor
if s > 8:
    s = 8
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0] * 8
cntmax = 0
cnt = 0
for i in a:
    if i >= 3200:
        cntmax += 1
    else:
        b[i // 400] += 1

for i in b:
    if i != 0:
        cnt += 1
# print(b)
if cnt == 0:
    print(1, cntmax if cntmax <= 8 else 8)
    exit()

s = cnt + cntmax
if s > 8:
    s = 8

print(cnt, s)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0] * 8
cntmax = 0
cnt = 0
for i in a:
    if i >= 3200:
        cntmax += 1
    else:
        b[i // 400] += 1

for i in b:
    if i != 0:
        cnt += 1
# print(b)
if sum(b) == 0:
    cnt = 1
    cntmax-=1

s = cnt + cntmax
if s > 8:
    s = 8

print(cnt, s)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0] * 8
cntmax = 0
cnt = 0
for i in a:
    if i >= 3200:
        cntmax += 1
    else:
        b[i // 400] += 1

for i in b:
    if i != 0:
        cnt += 1
print(cnt, cnt + cntmax)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = list(map(int, input().split()))
co_li = [0]*8
any_col = 0
for s in li:
    if s < 400:
        co_li[0] += 1
    elif 400 <= s < 800:
        co_li[1] += 1
    elif 800 <= s < 1200:
        co_li[2] += 1
    elif 1200 <= s < 1600:
        co_li[3] += 1
    elif 1600 <= s < 2000:
        co_li[4] += 1
    elif 2000 <= s < 2400:
        co_li[5] += 1
    elif 2400 <= s < 2800:
        co_li[6] += 1
    elif 2800 <= s < 3200:
        co_li[7] += 1
    elif 3200 <= s:
        any_col += 1
color_kind = sum(x>0 for x in co_li)
min_sum = color_kind
max_sum = min_sum + any_col
print(min_sum,max_sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
rates = list(map(int, input().split()))
over = 0
colors = []
GREY = 0
BROWN = 1
GREEN = 2
SKY = 3
BLUE = 4
YELLOW = 5
ORANGE = 6
RED = 7

for rate in rates:
  if rate <= 399:
    if not GREY in colors:
      colors.append(GREY)
  elif rate <= 799:
    if not BROWN in colors:
      colors.append(BROWN)
  elif rate <= 1199:
    if not GREEN in colors:
      colors.append(GREEN)
  elif rate <= 1599:
    if not SKY in colors:
      colors.append(SKY)
  elif rate <= 1999:
    if not BLUE in colors:
      colors.append(BLUE)
  elif rate <= 2399:
    if not YELLOW in colors:
      colors.append(YELLOW)
  elif rate <= 2799:
    if not ORANGE in colors:
      colors.append(ORANGE)
  elif rate <= 3199:
    if not RED in colors:
      colors.append(RED)
  else:
    over += 1
min_c = len(colors)
max_c = min(8, len(colors)+over)
print(min_c, max_c)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, a: "List[int]"):
    ans = [0] * 8
    a32 = 0
    for i in a:
        if(i >= 3200):
            a32 += 1
        else:
            if(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

    if(ans.count(0) == 8):
        if(a32 > 0):
            print(1)
        else:
            print(0)
    else:
        print(8-ans.count(0), 8-ans.count(0)+a32)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, a: "List[int]"):
    ans = [0] * 8
    a32 = 0
    for i in a:
        if(i >= 3200):
            a32 += 1
        else:
            if(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

    if(ans.count(0) == 8):
        if(a32 > 0):
            print(1)
        else:
            print(0)
    else:
        print(8-ans.count(0), min(8, 8-ans.count(0)+a32))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, a: "List[int]"):
    ans = [0] * 8
    a32 = 0
    for i in a:
        if(i >= 3200):
            a32 += 1
        else:
            if(i < 400):
                ans[0] = min(ans[0]+1, 1)
            elif(400 <= i < 800):
                ans[1] = min(ans[1]+1, 1)
            elif(800 <= i < 1200):
                ans[2] = min(ans[2]+1, 1)
            elif(1200 <= i < 1600):
                ans[3] = min(ans[3]+1, 1)
            elif(1600 <= i < 2000):
                ans[4] = min(ans[4]+1, 1)
            elif(2000 <= i < 2400):
                ans[5] = min(ans[5]+1, 1)
            elif(2400 <= i < 2800):
                ans[6] = min(ans[6]+1, 1)
            elif(2800 <= i < 3200):
                ans[7] = min(ans[7]+1, 1)     

    if(sum(ans) == 0 and a32 > 0):
        print(1)
    else:
        print(sum(ans), min(8,sum(ans)+a32))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math
import itertools
import random
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    A = inputList()
    
    free = 0
    a = [0 for _ in range(8)]
    
    for i in A:
        if i < 400:
            a[0] += 1
        elif i < 800:
            a[1] += 1
        elif i < 1200:
            a[2] += 1
        elif i < 1600:
            a[3] += 1
        elif i < 2000:
            a[4] += 1
        elif i < 2400:
            a[5] += 1
        elif i < 2800:
            a[6] += 1
        elif i < 3200:
            a[7] += 1
        else:
            free += 1
            
    ans = 0
    for i in a:
        if i == 0:
            continue
        if i != 0:
            ans += 1
            
    print("{} {}".format(ans, ans+free))
    
        
if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, a: "List[int]"):
    ans = [0] * 8
    a32 = 0
    for i in a:
        if(i >= 3200):
            a32 += 1
        else:
            if(i < 400):
                ans[0] = min(ans[0]+1, 1)
            elif(400 <= i < 800):
                ans[1] = min(ans[1]+1, 1)
            elif(800 <= i < 1200):
                ans[2] = min(ans[2]+1, 1)
            elif(1200 <= i < 1600):
                ans[3] = min(ans[3]+1, 1)
            elif(1600 <= i < 2000):
                ans[4] = min(ans[4]+1, 1)
            elif(2000 <= i < 2400):
                ans[5] = min(ans[5]+1, 1)
            elif(2400 <= i < 2800):
                ans[6] = min(ans[6]+1, 1)
            elif(2800 <= i < 3200):
                ans[7] = min(ans[7]+1, 1)     

    print(sum(ans), min(8,sum(ans)+a32))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
A = [int(_) // 400 if int(_) < 3199 else 8 for _ in input().split()]

min_counter = Counter(A).copy()
if 8 in min_counter.keys():
    min_counter.pop(8)
    if not min_counter:
        minimum = 1
    else:
        minimum = len(min_counter)
else:
    minimum = len(min_counter)

maximum = 0
max_counter = Counter(A).copy()

if 8 in max_counter.keys():
    maximum = max_counter[8]
    max_counter.pop(8)
    maximum += len(max_counter)
else:
    maximum += len(max_counter)

print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
A = [int(_) // 400 if int(_) < 3199 else 8 for _ in input().split()]

min_counter = Counter(A).copy()
if 8 in min_counter.keys():
    min_counter.pop(8)
    if not min_counter:
        minimum = 1
    else:
        minimum = len(min_counter)
else:
    minimum = len(min_counter)

maximum = 0
max_counter = Counter(A).copy()
if max_counter[8] >= 8:
    maximum = max_counter[8]
    max_counter.pop(8)
    maximum += len(max_counter)
else:
    if 8 in max_counter.keys():
        maximum = max_counter[8]
        max_counter.pop(8)
    maximum += len(max_counter)

print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
A = [int(_) // 400 if int(_) < 3199 else 8 for _ in input().split()]

min_counter = Counter(A).copy()
if 8 in min_counter.keys():
    min_counter.pop(8)
    minimum = 1
else:
    minimum = len(min_counter)

maximum = 0
max_counter = Counter(A).copy()
if max_counter[8] >= 8:
    maximum = max_counter[8]
    max_counter.pop(8)
    maximum += len(max_counter)
else:
    if 8 in max_counter.keys():
        maximum = max_counter[8]
        max_counter.pop(8)
    maximum += len(max_counter)

print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
A = [int(_) // 400 if int(_) < 3199 else 8 for _ in input().split()]

min_counter = Counter(A).copy()
if 8 in min_counter.keys():
    min_counter.pop(8)
maximum = 0
max_counter = Counter(A).copy()
if max_counter[8] >= 8:
    maximum = max_counter[8]
    max_counter.pop(8)
    maximum += len(max_counter)
else:
    if 8 in max_counter.keys():
        maximum = max_counter[8]
        max_counter.pop(8)
    maximum += len(max_counter)
minimum = len(min_counter)
print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
A = [int(_) // 400 if int(_) < 3199 else 8 for _ in input().split()]

min_counter = Counter(A).copy()
if 8 in min_counter.keys():
    min_counter.pop(8)
maximum = 0
max_counter = Counter(A).copy()
if max_counter[8] >= 8:
    maximum = 8
else:
    if 8 in max_counter.keys():
        maximum = max_counter[8]
        max_counter.pop(8)
    maximum += len(max_counter)
minimum = len(min_counter)
print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
A = [int(_) // 400 if int(_) < 3199 else 8 for _ in input().split()]

min_counter = Counter(A)
if 8 in min_counter.keys():
    min_counter.pop(8)
maximum = 0
max_counter = Counter(A)
if max_counter[8] >= 8:
    maximum = 8
else:
    if 8 in max_counter.keys():
        maximum = max_counter[8]
        max_counter.pop(8)
    maximum += len(max_counter)
minimum = len(min_counter)
print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
cnt=0
arr=[]
for i in range(n):
  color=a[i]//400
  if color>=8:
    cnt+=1
  else:
    arr.append(color)
if len(set(arr))+cnt<=8:
  b = len(set(arr))+cnt
else:
  b=8
if len(set(arr))>0:
  print(len(set(arr)),b)
else:
  print(1,b)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
cnt=0
arr=[]
for i in range(n):
  color=a[i]//400
  if color>=8:
    cnt+=1
  else:
    arr.append(color)
print(len(set(arr)),len(set(arr))+cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = [int(zz) for zz in input().split()]

ans = set()
p = 0
for i in S:
    q = i // 400
    if q < 8:
        ans.add(q)
    else:
        p += 1

if N == 1:
    print(1, 1)
else:
    print(len(ans), len(ans) + p)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = [int(zz) for zz in input().split()]

ans = set()
p = 0
for i in S:
    q = i//400
    if q < 8:
        ans.add(q)
    else:
        p += 1

if N == 1:
    print(1)
else:
    print(len(ans),len(ans)+p)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = [int(zz) for zz in input().split()]

ans = set()
p = 0
for i in S:
    q = i//400
    if q < 8:
        ans.add(q)
    else:
        p += 1

print(len(ans),len(ans)+p)

Submission status: Wrong Answer

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

colors = set()
above = 0

for score in a:
    if score < 400:
        colors.add("a")
    elif score < 800:
        colors.add("b")
    elif score < 1200:
        colors.add("c")
    elif score < 1600:
        colors.add("d")
    elif score < 2000:
        colors.add("e")
    elif score < 2400:
        colors.add("f")
    elif score < 2800:
        colors.add("g")
    elif score < 3200:
        colors.add("h")
    else:
        above += 1

x = len(colors)

if x == 8:
    print(x, x)
    exit()

if x == 0:
    if above >= 8:
        print(1, 8)
        exit()
    else:
        print(1, above)
        exit()

if 8 - x >= above:
    print(x, x+above)
else:
    print(x, 8)