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:
#1問目
N = int(input())
A = list(map(int, input().split()))
color = [0,0,0,0,0,0,0,0]
overColor = 0
Min = 0
Max = 0

for i in range(N):
    if 1 <= A[i] <= 399:
        color[0] += 1
    elif 400 <= A[i] <= 799:
        color[1] += 1
    elif 800 <= A[i] <= 1199:
        color[2] += 1
    elif 1200 <= A[i] <= 1599:
        color[3] += 1
    elif 1600 <= A[i] <= 1999:
        color[4] += 1
    elif 2000 <= A[i] <= 2399:
        color[5] += 1
    elif 2400 <= A[i] <= 2799:
        color[6] += 1
    elif 2800 <= A[i] <= 3199:
        color[7] += 1
    else:
        overColor += 1

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

if(overColor == 0 or color == 8):
    print(str(count) + " " + str(count))
else:
    if(count >= 6):
        if(overColor >= 2):
            print(str(count) + " 8")
        else:
            print(str(count) + " " + str(count + overColor))
    elif(count == 0):
        if(overColor >= 8):
            print("1 8")
        else:
            print("1 " + str(overColor))
    else:
        if(count + overColor >= 8):
            print(str(count) + " 8")
        else:
            print(str(count) + " " + str(count + overColor))

Submission status: Wrong Answer

Solution code:
#1問目
N = int(input())
A = list(map(int, input().split()))
color = [0,0,0,0,0,0,0,0]
overColor = 0
Min = 0
Max = 0

for i in range(N):
    if 1 <= A[i] <= 399:
        color[0] += 1
    elif 400 <= A[i] <= 799:
        color[1] += 1
    elif 800 <= A[i] <= 1199:
        color[2] += 1
    elif 1200 <= A[i] <= 1599:
        color[3] += 1
    elif 1600 <= A[i] <= 1999:
        color[4] += 1
    elif 2000 <= A[i] <= 2399:
        color[5] += 1
    elif 2400 <= A[i] <= 2799:
        color[6] += 1
    elif 2800 <= A[i] <= 3199:
        color[7] += 1
    else:
        overColor += 1

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

if(overColor == 0):
    print(str(count) + " " + str(count))
else:
    if(count >= 6):
        if(overColor >= 2):
            print(str(count) + " 8")
        else:
            print(str(count) + " " + str(count + overColor))
    elif(count == 0):
        if(overColor >= 8):
            print("1 8")
        else:
            print("1 " + str(overColor))
    else:
        if(count + overColor >= 8):
            print(str(count) + " 8")
        else:
            print(str(count) + " " + str(count + overColor))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
K = [0]*8
ans = 0
ans_2 = 0
for i in range(0,N):
    if A[i] >= 3200:
        ans += 1
    else:
        K[A[i]//400] += 1
for j in range(len(K)):
    if K[j] >= 1:
        ans_2 += 1
print(ans_2,ans+ans_2)

Submission status: Wrong Answer

Solution code:
#1問目
N = int(input())
A = list(map(int, input().split()))
color = [0,0,0,0,0,0,0,0]
overColor = 0
Min = 0
Max = 0

for i in range(N):
    if 1 <= A[i] <= 399:
        color[0] += 1
    elif 400 <= A[i] <= 799:
        color[1] += 1
    elif 800 <= A[i] <= 1199:
        color[2] += 1
    elif 1200 <= A[i] <= 1599:
        color[3] += 1
    elif 1600 <= A[i] <= 1999:
        color[4] += 1
    elif 2000 <= A[i] <= 2399:
        color[5] += 1
    elif 2400 <= A[i] <= 2799:
        color[6] += 1
    elif 2800 <= A[i] <= 3199:
        color[7] += 1
    elif A[i] >= 3200:
        overColor += 1

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

if(overColor == 0):
    print(str(count) + " " + str(count))
else:
    if(count >= 6):
        print(str(count) + " 8")
    elif(count == 0):
        if(count + overColor > 8):
            print("1 8")
        else:
            print("1 " + str(count + overColor))
    else:
        if(count + overColor > 8):
            print(str(count) + " 8")
        else:
            print(str(count) + " " + str(count + overColor))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
K = [0]*8
ans = 0
ans_2 = 0
for i in range(0,N):
    if A[i] >= 3200:
        ans += 1
    else:
        K[A[i]//400] += 1
for j in range(8):
    if K[j] >= 1:
        ans_2 += 1
if ans >= ans_2:
    print(ans,ans+ans_2)
else:
    print(ans_2,ans+ans_2)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
K = [0]*8
ans = 0
ans_2 = 0
for i in range(0,N):
    if A[i] >= 3200:
        ans += 1
    else:
        K[A[i]//400] += 1
for j in range(8):
    if K[j] >= 1:
        ans_2 += 1
if ans > ans_2:
    print(ans,ans+ans_2)
else:
    print(ans_2,ans+ans_2)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
K = [0]*8
ans = 0
ans_2 = 0
for i in range(0,N):
    if A[i] >= 3200:
        ans += 1
    else:
        K[A[i]//400] += 1
for j in range(8):
    if K[j] >= 1:
        ans_2 += 1
print(ans_2,ans+ans_2)

Submission status: Wrong Answer

Solution code:
#1問目
N = int(input())
A = list(map(int, input().split()))
color = [0,0,0,0,0,0,0,0]
overColor = 0
Min = 0
Max = 0

for i in range(N):
    if 1 <= A[i] <= 399:
        color[0] += 1
    elif 400 <= A[i] <= 799:
        color[1] += 1
    elif 800 <= A[i] <= 1199:
        color[2] += 1
    elif 1200 <= A[i] <= 1599:
        color[3] += 1
    elif 1600 <= A[i] <= 1999:
        color[4] += 1
    elif 2000 <= A[i] <= 2399:
        color[5] += 1
    elif 2400 <= A[i] <= 2799:
        color[6] += 1
    elif 2800 <= A[i] <= 3199:
        color[7] += 1
    else:
        overColor += 1

count = 0
for i in range(len(color)):
    if(color[i] > 0):
        count+=1

if(overColor == 0):
    print(str(count) + " " + str(count))
else:
    if(count >= 6):
        print(str(count) + " 8")
    elif(count == 0):
        print("1 " + str(count + overColor))
    else:
        print(str(count) + " " + str(count + overColor))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = [0]*9
for a in A:
    k = 0
    while a>=400*k:
        k+=1
        if k>8:break
    B[k-1]+=1
a = B[8]
B = [1 for b in B[:8] if b>0]
print(sum(B),sum(B)+a)

Submission status: Wrong Answer

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
from functools import lru_cache
INF = 1 << 60
mod = 1000000007
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

#　素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# ここから書き始める
# Colorful Leaderboard 
n = int(input())
a = list(map(int, input().split()))
s = [0] * 8
cnt = 0
for i in a:
    if i < 3200:
        s[i // 400] = 1
    else:
        cnt += 1
# print(s)
maximum = sum(s) + cnt
minimum = max(sum(s), cnt)
print(minimum, maximum)

# @lru_cache(maxsize=1000)
# def dfs(total, index):
#     if index == n:
#         if total % 10 != 0:
#             return total
#         return 0
#     return max(dfs(total + s[index], index + 1), dfs(total, index + 1))

# n = int(input())
# s = [0] * n
# for i in range(n):
#     s[i] = int(input())
# ans = dfs(0, 0)
# print(ans)

Submission status: Wrong Answer

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

colors = [0]*9
for a in A:
    colors[min(8, a//400)] += 1
ansmin = 0
for c in colors[:-1]:
    if c:
        ansmin += 1
print("{} {}".format(ansmin, ansmin+colors[-1]))

Submission status: Wrong Answer

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
INF = 1 << 60
mod = 1000000007
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

#　素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# ここから書き始める
n = int(input())
a = list(map(int, input().split()))
s = [0] * 8
cnt = 0
for i in a:
    if i < 3200:
        s[i // 400] = 1
    else:
        cnt += 1
# print(s)
maximum = sum(s) + cnt
minimum = sum(s)
print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
INF = 1 << 60
mod = 1000000007
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

#　素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# ここから書き始める
n = int(input())
a = list(map(int, input().split()))
s = [0] * 8
cnt = 0
for i in a:
    if i < 3200:
        s[i // 400] = 1
    else:
        cnt += 1
# print(s)
maximum = min(sum(s) + cnt, n)
minimum = sum(s)
print(minimum, maximum)

Submission status: Wrong Answer

Solution code:
N = int(input())
ARR = [int(s) for s in input().split(" ")]


def calculate(n, arr):
    colorNum = 8
    dict = {"gray": False, "brown": False, "green": False, "water": False, "blue": False, "yellow": False,
            "orange": False, "red": False}

    any = 0
    for ar in arr:
        if ar >= 1 and ar <= 399:
            dict.__setitem__("gray", True)
        elif ar >= 400 and ar <= 799:
            dict.__setitem__("brown", True)
        elif ar >= 800 and ar <= 1199:
            dict.__setitem__("green", True)
        elif ar >= 1200 and ar <= 1599:
            dict.__setitem__("water", True)
        elif ar >= 1600 and ar <= 1999:
            dict.__setitem__("blue", True)
        elif ar >= 2000 and ar <= 2399:
            dict.__setitem__("yellow", True)
        elif ar >= 2400 and ar <= 2799:
            dict.__setitem__("orange", True)
        elif ar >= 2800 and ar <= 3199:
            dict.__setitem__("red", True)
        else:
            any = any + 1

    already = sum(list(dict.values()))
    notYet = colorNum - already



    if any == 0:
        print("{} {}".format(already, already))
    else:
        ministValue = max(already,1)
        maxValue = min(already + any,colorNum)
        print("{} {}".format(ministValue,maxValue))


calculate(N, ARR)

Submission status: Wrong Answer

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

cnt1 = 0
for i in range(8):
  v1 = i * 400
  v2 = (i + 1) * 400 - 1
  for j in range(N):
    if v1 <= A[j] and A[j] <= v2:
      cnt1 += 1
      break

cnt2 = 0
for i in range(N):
  if A[i] >= 3200:
    cnt2 += 1

print(cnt1, cnt1 + cnt2)

Submission status: Wrong Answer

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

cnt1 = 0
for i in range(8):
  v1 = i * 400
  v2 = (i + 1) * 400 - 1
  for j in range(N):
    if v1 <= A[j] and A[j] <= v2:
      cnt1 += 1
      break

cnt2 = 0
for i in range(N):
  if A[i] >= 3200:
    cnt2 += 1

print(cnt1, cnt2)

Submission status: Wrong Answer

Solution code:
from collections import Counter
from bisect import bisect_left

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

rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]

color = Counter()
for a in A:
    i = bisect_left(rate, a)
    color[i] += 1

# print(color) 399 799 1199 1599 1999 2399 2799 3199
L = len(list(color.keys()))
if color[8] > 0:
    print(max(1, L - 1), min(8, L - 1 + color[8]))
else:
    print(L, L)

Submission status: Wrong Answer

Solution code:
from collections import Counter
from bisect import bisect_left

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

rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]

color = Counter()
for a in A:
    i = bisect_left(rate, a)
    color[i] += 1

# print(color)
L = len(list(color.keys()))
if color[8] > 0:
    print(L - 1, min(8, L - 1 + color[8]))
else:
    print(L, L)

Submission status: Wrong Answer

Solution code:
from collections import Counter
from bisect import bisect_left

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

rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]

color = Counter()
for a in A:
    i = bisect_left(rate, a)
    color[i] += 1

free = color[8]
L = len(list(color.keys()))
print(L - (free > 0), min(8, L - (free > 0) + free))

Submission status: Wrong Answer

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

ans = [0] * 9
for ai in a:
    if ai // 400 > 7:
        ans[8] += 1
    else:
        ans[ai // 400] = 1

if sum(ans[:-1]) == 0 and ans[-1]:
    print(0, 1)
else:
    print(sum(ans[:-1]), sum(ans))

Submission status: Wrong Answer

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

ans = [0] * 9
for ai in a:
    if ai // 400 > 7:
        ans[8] += 1
    else:
        ans[ai // 400] = 1

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

Submission status: Wrong Answer

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

ans = [0] * 9
for ai in a:
    if ai // 400 > 8:
        ans[8] += 1
    else:
        ans[ai // 400] = 1

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

Submission status: Wrong Answer

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

ans = [0] * 9
for ai in a:
    if ai // 400 > 8:
        ans[8] += 1
    else:
        ans[ai // 400] = 1

print(sum(ans[:-1]), sum(ans) + ans[8])

Submission status: Wrong Answer

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

ans = [0] * 9
for ai in a:
    if ai // 400 > 7:
        ans[8] += 1
    else:
        ans[ai // 400] = 1

print(sum(ans), sum(ans) + ans[8])

Submission status: Wrong Answer

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

color = [0]*9

for rate in a:
    if rate >= 3200:
        color[8] += 1
    else:
        color[rate//400] += 1
    
ans = 0

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

Submission status: Wrong Answer

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

color = [0]*9

for rate in a:
    if rate >= 3200:
        color[8] += 1
    else:
        color[rate//400] += 1
    
ans = 0

if color[8] == 0:
    for i in range(9):
        if color[i] > 0:
            ans += 1
    print(ans,ans)
else:
    for i in range(8):
        if color[i] > 0:
            ans +=1
    print(ans,ans+color[8])

Submission status: Wrong Answer

Solution code:
d={"hai":0,"tya":0,"midori":0,"mizu":0,"ao":0,"ki":0,"dai":0,"aka":0,"sonota":0}
n=int(input())
a=list(map(int,input().split()))
for v in a:
    
    if v <400:
        d["hai"]+=1
    elif v<800:
        d["tya"]+=1
    elif v<1200:
        d["midori"]+=1
    elif v<1600:
        d["mizu"]+=1
    elif v<2000:
        d["ao"]+=1
    elif v<2400:
        d["ki"]+=1
    elif v<2800:
        d["dai"]+=1
    elif v<3200:
        d["aka"]+=1
    else:
        d["sonota"]+=1
#print(d.values)
l=list(d.values())

x=l.count(0)
#print(d["sonota"])
if x==0:
    print(8,8)
elif d["sonota"]==0:
    print(9-x,9-x)
else:
    M=min(d["sonota"]+8-x,8)
    m=max(1,8-x)
    print(m,M)

Submission status: Wrong Answer

Solution code:
n = int(input())
v = list(map(int, input().split()))
c = [0] * 9
for i in range(0, n):
  if v[i] >= 3200:
    c[8] += 1
  else:
    c[v[i]//400] += 1
a = 0
for i in range(0, 8):
  if c[i] > 0:
    a += 1
print(a, a+c[8])

Submission status: Wrong Answer

Solution code:
n = int(input())
v = list(map(int, input().split()))
c = [0] * 9
for i in range(0, n):
  if v[i] >= 3200:
    c[8] += 1
  else:
    c[v[i]//400] += 1
a = 0
for i in range(0, 8):
  if c[i] > 0:
    a += 1
print(a, min(8, a+c[8]))

Submission status: Wrong Answer

Solution code:
n = int(input())
v = list(map(int, input().split()))
c = [0] * 9
for i in range(0, n):
  if v[i] >= 3200:
    c[8] += 1
  else:
    c[v[i]//400] += 1
a = 0
for i in range(0, 8):
  if c[i] > 0:
    a += 1
print(a, min(a, a+c[8]))

Submission status: Wrong Answer

Solution code:
n = int(input())
v = list(map(int, input().split()))
c = [0] * 9
for i in range(0, n):
  if v[i] >= 3200:
    c[8] += 1
  else:
    c[v[i]//400] += 1
a = 0
for i in range(0, 8):
  a += c[i]
print(a, min(a, a+c[8]))

Submission status: Wrong Answer

Solution code:
#1
#入力
N=int(input())
A=list(map(int,input().split()))

#処理

X=[0 for i in range(8)]
Y=0
for i in A:
    if i<400:
        X[0]=1
    elif i<800:
        X[1]=1
    elif i<1200:
        X[2]=1
    elif i<1600:
        X[3]=1
    elif i<2000:
        X[4]=1
    elif i<2400:
        X[5]=1
    elif i<2800:
        X[6]=1
    elif i<3200:
        X[7]=1
    else:
        Y+=1
print(sum(X),sum(X)+Y)

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
a=list(map(int,input().split()))
a=np.array(a)
a=a//400
a1=[i for i in a if i<8]
a2=[i for i in a if i>=8]
k=len(set(a1))
if k+len(a2)>8:m=8
else:m=k+len(a2)
if len(set(a1))!=0:s=len(set(a1))
else:s=1
print(s,m)

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
a=list(map(int,input().split()))
a=np.array(a)
a=a//400
a1=[i for i in a if i<8]
a2=[i for i in a if i>=8]
k=len(set(a1))
if k+len(a2)>8:m=8
else:m=k+len(a2)
print(len(set(a1)),m)

Submission status: Wrong Answer

Solution code:
MAX_COLORS = 8
DIFF_RATE = 400

def solve(a):

    colors = [0]*9

    for i in a:
        num = 0
        tmp = 400
        flag = True
        for j in range(9):
            if i < 0:
                flag = False
                break
            else:
                i -= 400
                num += 1
        if flag:
            colors[num-1] += 1
        else:
            colors[num-1] = 1
    print(colors)
    if sum(colors[:8]) == 0:
        print(1,colors[-1])
    else:
        print(sum(colors[:8]),sum(colors[:8])+colors[-1])

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
MAX_COLORS = 8
DIFF_RATE = 400

def solve(a):

    colors = [0]*9

    for i in a:
        num = 0
        tmp = 400
        flag = True
        for j in range(8):
            if i < 0:
                flag = False
                break
            else:
                i -= 400
                num += 1
        if flag:
            colors[num-1] += 1
        else:
            colors[num-1] = 1
    ##print(colors)
    if sum(colors[:8]) == 0:
        print(1,colors[-1])
    else:
        print(sum(colors[:8]),sum(colors[:8])+colors[-1])

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
MAX_COLORS = 8
DIFF_RATE = 400

def solve(a):

    colors = [0]*9

    for i in a:
        num = 0
        tmp = 400
        flag = True
        for j in range(9):
            if i < 0:
                flag = False
                break
            else:
                i -= 400
                num += 1
        if flag:
            colors[num-1] += 1
        else:
            colors[num-1] = 1
    ##print(colors)
    print(sum(colors[:8]),sum(colors[:8])+colors[-1])

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
MAX_COLORS = 8
DIFF_RATE = 400

def solve(a):

    colors = [0]*9

    for i in a:
        num = 0
        tmp = 400
        flag = True
        for j in range(9):
            if i < 0:
                flag = False
                break
            else:
                i -= 400
                num += 1
        if flag:
            colors[num-1] += 1
        else:
            colors[num-1] = 1
    ##print(colors)
    print(sum(colors[:8]),min(sum(colors[:8])+colors[-1],MAX_COLORS))

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
MAX_COLORS = 8
DIFF_RATE = 400

def solve(a):

    colors = [0]*9

    for i in a:
        num = 0
        tmp = 400
        for j in range(9):
            if i < 0:
                break
            else:
                i -= 400
                num += 1
        if i > 0:
            colors[num-1] += 1
        else:
            colors[num-1] = 1
    print(sum(colors[:8]),min(sum(colors[:8])+colors[-1],MAX_COLORS))

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
MAX_COLORS = 8
DIFF_RATE = 400

def solve(a):

    colors = [0]*9

    for i in a:
        num = 0
        tmp = 400
        for j in range(9):
            if i < 0:
                break
            else:
                i -= 400
                num += 1
        print(num)
        if i > 0:
            colors[num-1] += 1
        else:
            colors[num-1] = 1
    print(sum(colors[:8]),min(sum(colors[:8])+colors[-1],MAX_COLORS))

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

scores = [int(i) for i in input().split()]

under_3200_cnt = {}
over_3200_cnt = {}
for score in scores:
    key = score // 400
    if key == 8:
        over_3200_cnt.setdefault(key, 0)
        over_3200_cnt[key] += 1
    else :
        under_3200_cnt.setdefault(key, 0)
        under_3200_cnt[key] += 1
        
colors = len(under_3200_cnt.keys())

if len(over_3200_cnt) == 0:
    min_color = colors
    max_color = colors
else :
    if colors >= 1:
        min_color = colors
    else :
        min_color = 1
    max_color = colors + over_3200_cnt[8]
    
print(min_color, max_color)

Submission status: Wrong Answer

Solution code:
N = int(input())

scores = [int(i) for i in input().split()]

cnt = {}
for score in scores:
    key = score // 400
    cnt.setdefault(key, 0)
    cnt[key] += 1
    
print(cnt)
colors = len(cnt.keys())
             
if 8 in cnt.keys():
    if colors == 1:
        min_color = colors
    else :
        min_color = colors - 1
    max_color = colors + cnt[8] -1 
else :
    min_color = colors
    max_color = colors
    
if max_color >= 8:
    max_color = 8
    
print(min_color, max_color)

Submission status: Wrong Answer

Solution code:
N = int(input())

scores = [int(i) for i in input().split()]

cnt = {}
for score in scores:
    key = score // 400
    cnt.setdefault(key, 0)
    cnt[key] += 1
    
colors = len(cnt.keys())
             
if 8 in cnt.keys():
    min_color = colors - 1
    max_color = colors + cnt[8] - 1
else :
    min_color = colors
    max_color = colors
    
if max_color >= 8:
    max_color = 8
    
print(min_color, max_color)

Submission status: Wrong Answer

Solution code:
N = int(input())

scores = [int(i) for i in input().split()]

cnt = {}
for score in scores:
    key = score // 400
    cnt.setdefault(key, 0)
    cnt[key] += 1
    
colors = len(cnt.keys())
             
if 8 in cnt.keys():
    min_color = colors - 1
    max_color = colors + cnt[8] - 1
else :
    min_color = colors
    max_color = colors
    
if max_color >= 7:
    max_color = 7
    
print(min_color, max_color)