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()))
rate=[0]*13
for i in a:
    rate[i//400]+=1
min = 0
for i in range(8):
    if rate[i]>0:
        min+=1
max = min + rate[8] + rate[9] + rate[10] + rate[11] + rate[12]

print(min,max)

Submission status: Wrong Answer

Solution code:
col = [0, 399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
flag = [False for _ in range(len(col))]
n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(1, len(col)):
        if col[j-1] < a[i] <= col[j]:
            flag[j] = True
        if a[i] >= 3200:
            cnt += 1
            break
bs = flag.count(True)
mn = bs
mx = bs+cnt
print(mn, mx)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
rate=[0]*13
for i in a:
    rate[i//400]+=1
min = 0
for i in range(8):
    if rate[i]>0:
        min+=1
max = min + rate[8] + rate[9] + rate[10] + rate[11] + rate[12]
if max>8:
    max=8
print(min,max)

Submission status: Wrong Answer

Solution code:
col = [0, 399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
flag = [False for _ in range(len(col))]
n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(1, len(col)):
        if col[j-1] < a[i] <= col[j]:
            flag[j] = True
        if a[i] >= 3200:
            cnt += 1
bs = flag.count(True)
mn = bs
mx = min(bs+cnt, 8)
print(mn, mx)

Submission status: Wrong Answer

Solution code:
col = [0, 399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
flag = [False for _ in range(len(col))]
n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(1, len(col)):
        if col[j-1] < a[i] <= col[j]:
            flag[j] = True
        if a[i] >= 3200:
            cnt += 1
            break
bs = flag.count(True)
mn = bs
mx = min(bs+cnt, 8)
print(mn, mx)

Submission status: Wrong Answer

Solution code:
n = int(input())

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


ans = [0] * 8
hi_rate = 0

for i in range(n):
    buf = int(a[i]/400)
    if buf <= 7:
        ans[buf] += 1
    else:
        hi_rate += 1

print(ans)
low_rate = 0
for i in range(8):
    if ans[i] > 0:
        low_rate += 1

if low_rate == 0:
    minm = 1
    maxm = hi_rate
else:
    minm = low_rate
    maxm = low_rate + hi_rate

#if maxm > 8:
#    maxm = 8

print(str(minm) + ' ' + str(maxm))

Submission status: Wrong Answer

Solution code:
n = int(input())

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


ans = [0] * 8
hi_rate = 0

for i in range(n):
    buf = int(a[i]/400)
    if buf <= 7:
        ans[buf] += 1
    else:
        hi_rate += 1

down = 0
for i in range(8):
    if ans[i] > 0:
        down += 1

if down == 0:
    minm = 1
    maxm = hi_rate
else:
    minm = down
    maxm = down + hi_rate
if maxm > 8:
    maxm = 8

print(str(minm) + ' ' + str(maxm))

Submission status: Wrong Answer

Solution code:
n = int(input())

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


ans = [0] * 8
hi_rate = 0

for i in range(n):
    buf = int(a[i]/400)
    if buf <= 7:
        ans[buf] += 1
    else:
        hi_rate += 1

down = 0
for i in range(8):
    if ans[i] > 0:
        down += 1

if down == 0:
    minm = 1
    maxm = hi_rate
else:
    minm = down
    maxm = down + hi_rate
    if maxm > 8:
        maxm = 8

print(str(minm) + ' ' + str(maxm))

Submission status: Wrong Answer

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

L = []
for i, v in enumerate(A):
    if (1 <= v and v <= 399):
        L.append('灰色')
    elif(400 <= v and v <= 799):
        L.append('茶色')
    elif(800 <= v and v <= 1199):
        L.append('緑色')
    elif(1200 <= v and v <= 1599):
        L.append('水色')
    elif(1600 <= v and v <= 1999):
        L.append('青色')
    elif(2000 <= v and v <= 2399):
        L.append('黄色')
    elif(2400 <= v and v <= 2799):
        L.append('橙色')
    elif(2800 <= v and v <= 3199):
        L.append('赤色')
    else:
        L.append('自由')

J = [i for i in L if i == '自由']
L = list(set(L))
if ('自由' in L):
    L.remove('自由')

print(len(L), len(L) + len(J))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b=[]
cnt = 0
for i in range(n):
    if a[i]>=3200:
        cnt+=1
    else:
        for j in range(1,9):
            if a[i]<400*j:
                b.append(j)
                break
print(len(set(b)),len(set(b))+cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
ans = 0
cnt = 0
for i in range(8):
    if a[cnt] >= 400 * (i + 1):
        continue
    else:
        if a[cnt]>=400*i:
            cnt+=1
            ans+=1
        else:
            while a[cnt] < 400 * i:
                if cnt < n - 1:
                    cnt += 1
                else:
                    break
m=0
if cnt<n:
    while cnt < n:
        if a[cnt] >= 3200:
            m += 1
        cnt += 1
print(ans, ans+m)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
ans = 0
cnt = 0
for i in range(8):
    if a[cnt] >= 400 * (i + 1):
        continue
    else:
        if a[cnt]>=400*i:
            if i==7:
                ans+=1
            else:
                cnt+=1
                ans+=1
        else:
            while a[cnt] < 400 * i:
                if cnt < n - 1:
                    cnt += 1
                else:
                    break
print(ans, ans + n - cnt - 1)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
colors = set()
kami = 0
for i in range(n):
    if 1 <= a[i] <= 399:
        colors.add('hai')
    elif 400 <= a[i] <= 799:
        colors.add('cha')
    elif 800 <= a[i] <= 1199:
        colors.add('midori')
    elif 1200 <= a[i] <= 1599:
        colors.add('mizu')
    elif 1600 <= a[i] <= 1999:
        colors.add('ao')
    elif 2000 <= a[i] <= 2399:
        colors.add('kiiro')
    elif 2400 <= a[i] <= 2799:
        colors.add('daidai')
    elif 2800 <= a[i] <= 3199:
        colors.add('aka')
    else:
        kami += 1
if kami == 0:
    print(len(colors),len(colors))
else:
    print(max(len(colors), 1), min(len(colors)+kami,8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
colors = set()
kami = 0
for i in range(n):
    if 1 <= a[i] <= 399:
        colors.add('hai')
    elif 400 <= a[i] <= 799:
        colors.add('cha')
    elif 800 <= a[i] <= 1199:
        colors.add('midori')
    elif 1200 <= a[i] <= 1599:
        colors.add('mizu')
    elif 1600 <= a[i] <= 1999:
        colors.add('ao')
    elif 2000 <= a[i] <= 2399:
        colors.add('kiiro')
    elif 2400 <= a[i] <= 2799:
        colors.add('daidai')
    elif 2800 <= a[i] <= 3199:
        colors.add('aka')
    else:
        kami += 1
if kami == 0:
    print(len(colors),len(colors))
elif len(colors) >= kami:
    print(max(len(colors), 1), min(len(colors)+kami,8))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
num = 0
if min(a) >= 3200:
  num = 1
else:
  for i in range(8):
    for j in range(N):
      if 400*i <= a[j] and a[j] < 400*(i+1):
        num += 1
        break
num_max = num
for k in a:
  if k >= 3200 and num < min(8, N):
    num_max += 1
ans = [str(num), str(num_max)]
print(" ".join(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
num = 0
for i in range(8):
  for j in range(N):
    if 400*i <= a[j] and a[j] < 400*(i+1):
      num += 1
      break
num_max = num
for k in a:
  if k >= 3200 and num < 8:
    num_max += 1
if min(a) >= 3200:
  num = 1
ans = [str(num), str(num_max)]
print(" ".join(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
num = 0
for i in range(8):
  for j in range(N):
    if 400*i <= a[j] and a[j] < 400*(i+1):
      num += 1
      break
num_max = num
for k in a:
  if k >= 3200 and num < 8:
    num_max += 1
ans = [str(num), str(num_max)]
print(" ".join(ans))

Submission status: Wrong Answer

Solution code:
def color(num: int) -> int:
    if 1 <= num <= 399:
        return 0
    if 400 <= num <= 799:
        return 1
    if 800 <= num <= 1199:
        return 2
    if 1200 <= num <= 1599:
        return 3
    if 1600 <= num <= 1999:
        return 4
    if 2000 <= num <= 2399:
        return 5
    if 2400 <= num <= 2799:
        return 6
    if 2800 <= num <= 3199:
        return 7
    if 3200 <= num:
        return 8


n = int(input())
a = list(map(int, input().split()))
arr = []
certain = 0
for num in a:
    col = color(num)
    if col == 8:
        certain += 1
    else:
        arr.append(col)

color_count = len(set(arr))
if color_count == 0:
    print(1, certain)
else:
    print(color_count, min(8, color_count + certain))

Submission status: Wrong Answer

Solution code:
def color(num: int) -> int:
    if 1 <= num <= 399:
        return 0
    if 400 <= num <= 799:
        return 1
    if 800 <= num <= 1199:
        return 2
    if 1200 <= num <= 1599:
        return 3
    if 1600 <= num <= 1999:
        return 4
    if 2000 <= num <= 2399:
        return 5
    if 2400 <= num <= 2799:
        return 6
    if 2800 <= num <= 3199:
        return 7
    if 3200 <= num:
        return 8


n = int(input())
a = list(map(int, input().split()))
arr = []
certain = 0
for num in a:
    col = color(num)
    if col == 8:
        certain += 1
    else:
        arr.append(col)

cnt = len(set(arr))
if cnt  == 0:
    certain -= 1
ans_min = max(1, cnt)
ans_max = min(8, ans_min + certain)
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
def color(num: int) -> int:
    if 1 <= num <= 399:
        return 0
    if 400 <= num <= 799:
        return 1
    if 800 <= num <= 1199:
        return 2
    if 1200 <= num <= 1599:
        return 3
    if 1600 <= num <= 1999:
        return 4
    if 2000 <= num <= 2399:
        return 5
    if 2400 <= num <= 2799:
        return 6
    if 2800 <= num <= 3199:
        return 7
    if 3200 <= num:
        return 8


n = int(input())
a = list(map(int, input().split()))
arr = []
certain = 0
for num in a:
    col = color(num)
    if col == 8:
        certain += 1
    else:
        arr.append(col)

ans_min = 0
ans_max = 0
if certain == 0:
    ans_min = len(set(arr))
    ans_max = min(8, ans_min)
else:
    ans_min = len(set(arr))
    if ans_min == 0:
        ans_min += 1
        ans_max = min(8, certain)
    else:
        ans_max = min(8, ans_min + certain)
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
def color(num: int) -> int:
    if 1 <= num <= 399:
        return 0
    if 400 <= num <= 799:
        return 1
    if 800 <= num <= 1199:
        return 2
    if 1200 <= num <= 1599:
        return 3
    if 1600 <= num <= 1999:
        return 4
    if 2000 <= num <= 2399:
        return 5
    if 2400 <= num <= 2799:
        return 6
    if 2800 <= num <= 3199:
        return 7
    if 3200 <= num:
        return 8


n = int(input())
a = list(map(int, input().split()))
arr = []
certain = 0
for num in a:
    col = color(num)
    if col == 8:
        certain += 1
    else:
        arr.append(col)
ans_min = len(set(arr))
ans_max = min(8, ans_min + certain)
if ans_min == 0:
    ans_min += 1
print(ans_min, ans_max)

Submission status: Wrong Answer

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


n = int(input())
a = list(map(int, input().split()))
arr = []
certain = 0
for num in a:
    col = color(num)
    if col == 8:
        certain += 1
    else:
        arr.append(col)
ans_min = len(set(arr))
ans_max = min(8, ans_min + certain)
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    d = defaultdict(int)
    free = 0
    for i in range(N):
        if 1<=A[i]<400:
            d['gray'] += 1
        elif 400<=A[i]<800:
            d['brown'] += 1
        elif 800<=A[i]<1200:
            d['green'] += 1
        elif 1200<=A[i]<1600:
            d['light_blue'] += 1
        elif 1600<=A[i]<2000:
            d['blue'] += 1
        elif 2000<=A[i]<2400:
            d['yellow'] += 1
        elif 2400<=A[i]<2800:
            d['orange'] += 1
        elif 2800<=A[i] < 3200:
            d['red'] += 1
        else:
            free += 1
    ans_min = max(len(d.keys()), 1)
    ans_max = min(8, len(d.keys())+free)
    print(ans_min, ans_max)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    d = defaultdict(int)
    free = 0
    for i in range(N):
        if 1<=A[i]<400:
            d['gray'] += 1
        elif 400<=A[i]<800:
            d['brown'] += 1
        elif 800<=A[i]<1200:
            d['green'] += 1
        elif 1200<=A[i]<1600:
            d['light_blue'] += 1
        elif 1600<=A[i]<2000:
            d['blue'] += 1
        elif 2000<=A[i]<2400:
            d['yellow'] += 1
        elif 2400<=A[i]<2800:
            d['orange'] += 1
        elif 2800<=A[i] < 3200:
            d['red'] += 1
        else:
            free += 1
    ans_min = min(len(d.keys()), 1)
    ans_max = min(8, len(d.keys())+free)
    print(ans_min, ans_max)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    d = defaultdict(int)
    free = 0
    for i in range(N):
        if 1<=A[i]<400:
            d['gray'] += 1
        elif 400<=A[i]<800:
            d['brown'] += 1
        elif 800<=A[i]<1200:
            d['green'] += 1
        elif 1200<=A[i]<1600:
            d['light_blue'] += 1
        elif 1600<=A[i]<2000:
            d['blue'] += 1
        elif 2000<=A[i]<2400:
            d['yellow'] += 1
        elif 2400<=A[i]<2800:
            d['orange'] += 1
        elif 2800<=A[i] < 3200:
            d['red'] += 1
        else:
            free += 1
    ans = min(8, len(d.keys())+free)
    print(len(d.keys()), ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [0,0,0,0,0,0,0,0,0]
mi = 0
for i in range(len(A)):
    for t in range(len(B)-1):
        if A[i] < (400 * (t+1)) and A[i] > (400 * t):
            B[t] = B[t]+1
    if A[i] > 3199:
        B[-1] = B[-1] + 1
for t in range(len(B)-1):
    if B[t] > 0:
        mi = mi +1
ma = mi + B[-1]
print(ma + mi)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [0,0,0,0,0,0,0,0,0]
mi = 0
for i in range(len(A)):
    for t in range(len(B)):
        if A[i] < (400 * (t+1)) and A[i] > (400 * t):
            B[t] = B[t]+1
for t in range(len(B)-1):
    if B[t] > 0:
        mi = mi +1
ma = mi + B[-1]
print(ma + mi)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [0,0,0,0,0,0,0,0,0]
mi = 0
for i in range(len(A)):
    for t in range(len(B)):
        if A[i] < (400 * (t+1)):
            B[t] = B[t]+1
for t in range(len(B)-1):
    if B[t] > 0:
        mi = mi +1
ma = mi + B[-1]
print(ma + mi)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
L = [False]*8
cnt = 0
for i in range(N):
    for j in range(8):
        if j*400 <= a[i] <= j*400+399:
            L[j] = True
    if a[i] >= 3200:
        cnt += 1

minnum = L.count(1) 
maxnum = min(N, minnum+cnt)
print(minnum, maxnum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
li = []
cnt = 0
for i in range(N):
    if a[i] >= 1 and a[i] <= 399:
        li.append(1)
    elif a[i] >= 400 and a[i] <= 799:
        li.append(2)
    elif a[i] >= 800 and a[i] <= 1199:
        li.append(3)
    elif a[i] >= 1200 and a[i] <= 1599:
        li.append(4)
    elif a[i] >= 1600 and a[i] <= 1999:
        li.append(5)
    elif a[i] >= 2000 and a[i] <= 2399:
        li.append(6)
    elif a[i] >= 2400 and a[i] <= 2799:
        li.append(7)
    elif a[i] >= 2800 and a[i] <= 3199:
        li.append(8)
    else:
        cnt += 1
c = len(set(li))
print(c, c+cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
li = []
cnt = 0
for i in range(N):
    if a[i] >= 1 and a[i] <= 399:
        li.append(1)
    elif a[i] >= 400 and a[i] <= 799:
        li.append(2)
    elif a[i] >= 800 and a[i] <= 1199:
        li.append(3)
    elif a[i] >= 1200 and a[i] <= 1599:
        li.append(4)
    elif a[i] >= 1600 and a[i] <= 1999:
        li.append(5)
    elif a[i] >= 2000 and a[i] <= 2399:
        li.append(6)
    elif a[i] >= 2400 and a[i] <= 2799:
        li.append(7)
    elif a[i] >= 2800 and a[i] <= 3199:
        li.append(8)
    else:
        cnt += 1
c = len(set(li))
print(c, min(c+cnt, 8))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
#print(a)
ans = [0] * 8
free = 0

for r in a:
    if r > 3199:
        free += 1
    else:
        ans[r // 800] = 1

min_ = max(sum(ans), 1)
#max_ = min(sum(ans) + free, 8)
max_ = sum(ans) + free
print(min_, max_)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
#print(a)
ans = [0] * 8
free = 0

for r in a:
    if r > 3199:
        free += 1
    else:
        ans[r // 800] = 1

min_ = max(sum(ans), 1)
max_ = min(sum(ans) + free, 8)
print(min_, max_)

Submission status: Wrong Answer

Solution code:
A = int(input())
colors = [0] * 8
l_n = list(map(int,input().split()))
if [i for i in l_n if 1 <= i <= 399] != []:
        colors[0] = 1
for j in range(1,8):
    if [i for i in l_n if 0+(j*400) <= i <= 399+(j*400)] != []:
        colors[j] = 1
ans_m = colors.count(1)
all_colors = len([i for i in l_n if 3200 <= i])
print(ans_m,ans_m+all_colors)

Submission status: Wrong Answer

Solution code:
colors=[0]*8
n=int(input())
a=list(map(int,input().split()))
wild=0
for i in range(n):
  index=(a[i]+1)//400
  if index>7:
    wild+=1
  else:
    colors[index]=1
ans1=sum(colors)
ans2=sum(colors)
ans1+=wild
if ans2==0 and wild>0:
  ans2=1
print(ans2,' ',ans1)

Submission status: Wrong Answer

Solution code:
colors=[False]*8
n=int(input())
a=list(map(int,input().split()))
wild=0
for i in range(n):
  index=(a[i]+1)//400
  if index>=8:
    wild+=1
  else:
    colors[index]=True
ans1=0
ans2=0
for color in colors:
  if color:
    ans1+=1
    ans2+=1
ans1+=wild
if ans2==0 and wild>0:
  ans2=1
print(ans2,' ',ans1)

Submission status: Wrong Answer

Solution code:
colors=[False]*8
n=int(input())
a=list(map(int,input().split()))
wild=0
for i in range(n):
  index=(a[i]+1)//400
  if index>=8:
    wild+=1
  else:
    colors[index]=True
ans1=0
ans2=0
for color in colors:
  if color:
    ans1+=1
    ans2+=1
ans1+=wild
if ans2==0:
  ans2=1
print(ans2,' ',ans1)

Submission status: Wrong Answer

Solution code:
colors=[False]*8
n=int(input())
a=list(map(int,input().split()))
wild=0
for i in range(n):
  index=(a[i]+1)//400
  if index>=8:
    wild+=1
  else:
    colors[index]=True
ans1=0
ans2=0
for color in colors:
  if color:
    ans1+=1
    ans2+=1
ans1+=min(wild,8-ans1)
if ans2==0:
  ans2=1
print(ans2,' ',ans1)

Submission status: Wrong Answer

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

huriwake = [0, 0, 0, 0, 0, 0, 0, 0]
rea = 0
count = 0

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

for h in huriwake:
    if h == 1:
        count += 1

if count == 0 and rea > 0:
    count += 1
    rea -= 1

min = count

if rea > 0:
    count += rea
    if count > 8: count = 8

max = count

print("{0} {1}".format(min, max))

Submission status: Wrong Answer

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

huriwake = [0, 0, 0, 0, 0, 0, 0, 0]
rea = 0
count = 0

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

for h in huriwake:
    if h == 1:
        count += 1

if count == 0 and rea > 0:
    count += 1

min = count

if rea > 0:
    count += rea
    if count > 8: count = 8

max = count

print("{0} {1}".format(min, max))

Submission status: Wrong Answer

Solution code:
def resolve():
	n = input()
	c = [False] * 8
	p = 0
	for i in list(map(int, input().split())):
		if i >= 3200:
			p += 1
		else:
			c[i//400] = True
	print(sum(c), sum(c) + p)
resolve()

Submission status: Wrong Answer

Solution code:
N = int(input())
an = list(map(int, input().split()))
free = 0
check = []
for a in an:
    if a > 3199:
        free += 1
    else:
        check.append(a//400)
print(len(set(check)), len(set(check))+free)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x) for x in input().split()]
count=-1
for i in range(N):
    if 1<=A[i]<=399:
        A[i]=1
    elif 400<=A[i]<=799:
        A[i]=2
    elif 800<=A[i]<=1199:
        A[i]=3
    elif 1200<=A[i]<=1599:
        A[i]=4
    elif 1600<=A[i]<1999:
        A[i]=5
    elif 2000<=A[i]<=2399:
        A[i]=6
    elif 2400<=A[i]<=2799:
        A[i]=7
    elif 2800<=A[i]<=3199:
        A[i]=8
    else:
        A[i]=9
        count+=1

A=[x for x in set(A)]

if 9 in A:
    print(len(A)-1,len(A)+count)
else:
    print(len(A),len(A))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(x) for x in input().split()]
count=0
for i in range(N):
    if 1<=A[i]<=399:
        A[i]=1
    elif 400<=A[i]<=799:
        A[i]=2
    elif 800<=A[i]<=1199:
        A[i]=3
    elif 1200<=A[i]<=1599:
        A[i]=4
    elif 1600<=A[i]<1999:
        A[i]=5
    elif 2000<=A[i]<=2399:
        A[i]=6
    elif 2400<=A[i]<=2799:
        A[i]=7
    elif 2800<=A[i]<=3199:
        A[i]=8
    else:
        A[i]=9
        count+=1

A=[x for x in set(A)]

if 9 in A:
    print(len(A)-1,len(A)-1+count)
else:
    print(len(A),len(A))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
f1 = f2 = 0
for k in c.keys():
    if k >= 8:
        f1 += 1
        f2 += c[k]
        
if f1 == 0:
    min_ = max_ = len(c.keys())

else:
    min_ = len(c.keys()) -f1
    max_ = len(c.keys()) -f1 +f2
if max_ >8:
    max_ = 8
if min_ <1:
    min_ = 1
print(min_, max_)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
f1 = f2 = 0
for k in c.keys():
    if k >= 8:
        f1 += 1
        f2 += c[k]
if f1 == 0:
    min_ = max_ = len(c.keys())

else:
    min_ = len(c.keys()) -f1
    max_ = sum(c.values())
if max_ >8:
    max_ = 8
if min_ <1:
    min_ = 1
print(min_, max_)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
f1 = f2 = 0
for k in c.keys():
    if k >= 8:
        f1 += 1
        f2 += c[k]
if f1 == 0:
    min_ = max_ = len(c.keys())

else:
    min_ = len(c.keys()) -f1
    max_ = len(c.keys()) +f2
if max_ >8:
    max_ = 8
if min_ <1:
    min_ = 1
print(min_, max_)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
col = [0 for i in range(10)]
for i in range(n):
    if 1 <= a[i] and a[i] <= 399:
        col[0] = 1
    elif 400 <= a[i] and a[i] <= 799:
        col[1] = 1
    elif 800 <= a[i] and a[i] <= 1199:
        col[2] = 1
    elif 1200 <= a[i] and a[i] <= 1599:
        col[3] = 1
    elif 1600 <= a[i] and a[i] <= 1999:
        col[4] = 1
    elif 2000 <= a[i] and a[i] <= 2399:
        col[5] = 1
    elif 2400 <= a[i] and a[i] <= 2799:
        col[6] = 1
    elif 2800 <= a[i] and a[i] <= 3199:
        col[7] = 1
    elif 2800 <= a[i] and a[i] <= 3199:
        col[8] = 1
    elif 3200 <= a[i]:
        col[9] += 1
s = 0
for i in range(len(col)-1):
    s += col[i]
if col[9] >= 1:
    print(s, s+col[9])
else:
    print(s, s)

Submission status: Wrong Answer

Solution code:
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

N = intinp()
a = mapint_inp()

def get_color(x):
    c = None
    if 399 >= x: c = "Gray"
    elif 799 >= x: c = "Blown"
    elif 1199 >= x: c = "Green"
    elif 1599 >= x: c = "Sky"
    elif 1999 >= x: c = "Blue"
    elif 2399 >= x: c = "Yellow"
    elif 2799 >= x: c = "Orange"
    elif 3199 >= x: c = "Red"
    else:
        c = "Any"
    return c

color_set = set()
num_of_any = 0

for a_i in a:
    c_i = get_color(a_i)
    if c_i == "Any":
        num_of_any += 1
        continue
    if c_i not in color_set:
        color_set.add(c_i)

num_of_colors = len(color_set)
rest_of_colors = 8 - num_of_colors

if num_of_any == 0:
    print(num_of_colors, min(num_of_colors, 8))
elif num_of_any == N:
    if N <= 8:
        print(1, N)
    else:
        print(1, 8)
else:
    if N-num_of_any >= 8:
        print(8, 8)
    else:
        if num_of_any >= rest_of_colors:
            print(num_of_colors, 8)
        else:
            print(num_of_colors, min(num_of_colors+num_of_any, 8))

Submission status: Wrong Answer

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

for i in range(n):
    A[i] //= 400
    if A[i] > 7:
        A[i] = "*"
        
over3200 = A.count("*")

base = len(set(A))

if over3200 > 0:
    base -= 1

print(base,base+over3200)

Submission status: Wrong Answer

Solution code:
N = int(input())
List = list(map(int,input().split()))
color = [0,0,0,0,0,0,0,0,0]

for i in range(N):
  if List[i] < 400:
    color[0] += 1
  elif 400<= List[i] < 800:
    color[1] += 1
  elif 800<= List[i] < 1200:
    color[2] += 1
  elif 1200<= List[i] < 1600:
    color[3] += 1
  elif 1600<= List[i] < 2000:
    color[4] += 1
  elif 2000<= List[i] < 2400:
    color[5] += 1
  elif 2400<= List[i] < 2800:
    color[6] += 1
  elif 2800<= List[i] < 3200:
    color[7] += 1
  else:
    color[8] += 1
#print(color)
count = 0
for i in range(8):
  if color[i] != 0:
    count += 1
    
if count != 0:
  if color[8] == 0:
    print(str(count) + " " + str(count))
  else:
    if 8 - count <= color[8]:
      print(str(count) + " " + str(8))
    else:
      print(str(count) + " " + str(count+color[8]))
else:
  if color[8] <= 8:
    print(str(1) + " " + str(color[8]))
  else:
    print(str(1) + " " + str(8))

Submission status: Wrong Answer

Solution code:
N = int(input())
List = list(map(int,input().split()))
color = [0,0,0,0,0,0,0,0,0]

for i in range(N):
  if List[i] < 400:
    color[0] += 1
  elif 400<= List[i] < 800:
    color[1] += 1
  elif 800<= List[i] < 1200:
    color[2] += 1
  elif 1200<= List[i] < 1600:
    color[3] += 1
  elif 1600<= List[i] < 2000:
    color[4] += 1
  elif 2000<= List[i] < 2400:
    color[5] += 1
  elif 2400<= List[i] < 2800:
    color[6] += 1
  elif 2800<= List[i] < 3200:
    color[7] += 1
  else:
    color[8] += 1
#print(color)
count = 0
for i in range(8):
  if color[i] != 0:
    count += 1
if color[8] == 0:
  print(str(count) + " " + str(count))
else:
  if 8 - count <= color[8]:
    print(str(count) + " " + str(8))
  else:
    print(str(count) + " " + str(count+color[8]))