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:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD


# --------------------------------------------

dp = None


def main():
    N = int(input())
    A = li_input()

    C = list(map(lambda x: min(8, x // 400), A))

    if 8 in C:
        free = C.count(8)

        if free == N:
            print(1, min(N, 8))
        else:
            low = len(set([c for c in C if c != 8]))
            print(low, min(low + free, 8))
    else:
        ans = len(set(C))
        print(ans, ans)


main()

Submission status: Wrong Answer

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD


# --------------------------------------------

dp = None


def main():
    N = int(input())
    A = li_input()

    C = list(map(lambda x: min(8, x // 400), A))

    if 8 in C:
        low = len(set(C)) - 1
        free = C.count(8)

        print(max(1, low), min(max(1, low) + free, 7))
    else:
        ans = len(set(C))
        print(ans, ans)


main()

Submission status: Wrong Answer

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD


# --------------------------------------------

dp = None


def main():
    N = int(input())
    A = li_input()

    C = list(map(lambda x: min(8, x // 400), A))

    if 8 in C:
        low = len(set(C)) - 1
        free = C.count(8)

        print(max(1, low), min(low + free, 7))
    else:
        ans = len(set(C))
        print(ans, ans)


main()

Submission status: Wrong Answer

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD


# --------------------------------------------

dp = None


def main():
    N = int(input())
    A = li_input()

    C = list(map(lambda x: min(8, x // 400), A))

    if 8 in C:
        low = len(set(C)) - 1
        free = C.count(8)

        print(min(1, low), min(low + free, 7))
    else:
        ans = len(set(C))
        print(ans, ans)


main()

Submission status: Wrong Answer

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD


# --------------------------------------------

dp = None


def main():
    N = int(input())
    A = li_input()

    C = list(map(lambda x: min(8, x // 400), A))

    if 8 in C:
        low = len(set(C)) - 1
        free = C.count(8)

        print(low, min(low + free, 7))
    else:
        ans = len(set(C))
        print(ans, ans)


main()

Submission status: Wrong Answer

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD


# --------------------------------------------

dp = None


def main():
    N = int(input())
    A = li_input()

    C = list(map(lambda x: x // 400, A))

    if 8 in C:
        low = len(set(C)) - 1
        free = C.count(8)

        print(low, min(low + free, 7))
    else:
        ans = len(set(C))
        print(ans, ans)


main()

Submission status: Wrong Answer

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

L = [0] * 8
for i in range(N):
    if A[i] < 3200:
        num = int(A[i] / 400)
        L[num] = 1
S_min = sum(L)
count = 0
for i in range(N):
    if A[i] >= 3200:
        count = count + 1
S_max = count + S_min
print(S_min, S_max)

Submission status: Wrong Answer

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

L = [0] * 8
for i in range(N):
    if A[i] < 3200:
        num = int(A[i] / 400)
        L[num] = 1
S_min = sum(L)
for i in range(N):
    if A[i] >= 3200:
        for j in range(8):
            if L[j] == 0:
                L[j] = 1
                break
S_max = sum(L)
print(S_min, S_max)

Submission status: Wrong Answer

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

color = [0]*9
for i in range(n):
    rate = min(a[i]//400, 8)
    color[rate] += 1

ans_min = 0
color_min = copy.deepcopy(color)
for c in color_min[:-1]:
    if c > 0:
        ans_min += 1
ans_min = max(1, ans_min)

ans_max = 0
color_max = copy.deepcopy(color)
for c in color_max[:-1]:
    if c > 0:
        ans_max += 1
    else:
        if color[-1] > 0:
            color[-1] -= 1
            ans_max += 1

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(_) for _ in input().split()]

rate = len(set([ai // 400 for ai in a if ai < 3200]))
count_master = len([ai for ai in a if ai >= 3200])

print(rate, rate + count_master)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [i // 400 for i in map(int, input().split())]
min_a = sum(i < 8 for i in set(a))
max_a = min(8, min_a + sum(i >= 8 for i in a))
if min_a == 0:
    print(1, max_a)
else:
    print(min_a, max_a)

Submission status: Wrong Answer

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

def main():
    n = int(input())
    a_list = list(map(int, input().split()))

    flag = [0 for i in range(8)]
    other_cnt = 0

    for i in a_list:
        if 1 <= i and i < 400:
            flag[0] = 1
        elif 400 <= i and i < 800:
            flag[1] = 1
        elif 800 <= i and i < 1200:
            flag[2] = 1
        elif 1200 <= i and i < 1600:
            flag[3] = 1
        elif 1600 <= i and i < 2000:
            flag[4] = 1
        elif 2000 <= i and i < 2400:
            flag[5] = 1
        elif 2400 <= i and i < 2800:
            flag[6] = 1
        elif 2800 <= i and i < 3200:
            flag[7] = 1
        elif i >= 3200:
            other_cnt += 1
        
    print(sum(flag), sum(flag) + other_cnt)
        

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def main():
    n = int(input())
    a_list = list(map(int, input().split()))

    flag = [0 for i in range(8)]
    other_cnt = 0

    for i in a_list:
        if i < 400:
            flag[0] = 1
        elif 400 <= i and i < 800:
            flag[1] = 1
        elif 800 <= i and i < 1200:
            flag[2] = 1
        elif 1200 <= i and i < 1600:
            flag[3] = 1
        elif 1600 <= i and i < 2000:
            flag[4] = 1
        elif 2000 <= i and i < 2400:
            flag[5] = 1
        elif 2400 <= i and i < 2800:
            flag[6] = 1
        elif 2800 <= i and i < 3200:
            flag[7] = 1
        else:
            other_cnt += 1
        
    print(sum(flag), sum(flag) + other_cnt)
        

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

arr = map(int,raw_input().split())

colors = [0] * 8
ans = 0

for i in arr:
	t = i/400
	if t < 8:
		colors[t] += 1

	else:
		ans += 1

col = 0
for i in colors:
	if i > 0:
		col += 1

print col, col + ans

Submission status: Wrong Answer

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

color_types = [False]*8
pro_count = 0
for a_i in a:
	if a_i < 3200:
		color_types[a_i//400] = 1
	else:
		pro_count += 1
print(max(1, sum(color_types)), min(8, sum(color_types)+pro_count))

Submission status: Wrong Answer

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

color_types = [False]*8
pro_count = 0
for a_i in a:
	if a_i < 3200:
		color_types[a_i//400] = True
	else:
		pro_count += 1
print(max(1, sum(color_types)), min(8, sum(color_types)+pro_count))

Submission status: Wrong Answer

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

color_types = [False for i in range(8)]
pro_count = 0
for a_i in a:
	if a_i < 3200:
		color_types[a_i//400] = True
	else:
		pro_count += 1
print(sum(color_types), min(8, sum(color_types)+pro_count))

Submission status: Wrong Answer

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

color_types = [False]*8
pro_count = 0
for a_i in a:
	if a_i < 3200:
		color_types[a_i//400] = True
	else:
		pro_count += 1
print(sum(color_types), min(8, sum(color_types)+pro_count))

Submission status: Wrong Answer

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

color_types = [False]*7
pro_count = 0
for a_i in a:
	if a_i < 3200:
		color_types[a_i//400-1] = True
	else:
		pro_count += 1
print(sum(color_types), min(8, sum(color_types)+pro_count))

Submission status: Wrong Answer

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

n=int(input())
l=list(map(f,input().split()))
v=l.count(9)
t=len(set(l))

if not v:
  print(t,t)
else:
  print(t-1,t+v-1)

Submission status: Wrong Answer

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

n=int(input())
l=list(map(f,input().split()))
if not l.count(9):
  s=set(l)
  t=len(s)
  print(t,t)
else:
  s=set(l)
  t=len(s)
  u=t-1#cnt of colors
  v=l.count(9)
  if u==8:
    b=u
  else:
    b=u+v
    if b>8:
      b=8
  print(u,b)

Submission status: Wrong Answer

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

n=int(input())
l=list(map(f,input().split()))
if not l.count(8):
  s=set(l)
  t=len(s)
  print(t,t)
else:
  s=set(l)
  t=len(s)
  u=t-1#cnt of colors
  v=l.count(8)
  if u>=v:
    a=u
  else:
    a=v
  if u==7:
    b=u
  else:
    b=u+v
    if b>7:
      b=2
  print(a,b)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right
def inpl(): return input().split()

n = int(input())
a = list(map(int, inpl()))
b = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]

d = dict()
for i in range(n):
    pos = bisect_right(b, a[i])#1->pos=1, 3200->pos=9
    d[pos] = d.get(pos, 0) + 1
ans = 0
for pos in range(1, 9):
    if (d.get(pos, 0) > 0):
        ans += 1
cnt_colorful = d.get(bisect_right(b, 3200), 0)
print(ans + min(0, cnt_colorful), ans + cnt_colorful)

Submission status: Wrong Answer

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

colors=[]
niji=[]
for i in a:
    if 1<=i<=399:
        colors.append('灰')
    elif 400<=i<=799:
        colors.append('茶')
    elif 800<=i<=1199:
        colors.append('緑')
    elif 1200<=i<=1599:
        colors.append('水')
    elif 1600<=i<=1999:
        colors.append('青')
    elif 2000<=i<=2399:
        colors.append('黄')
    elif 2400<=i<=2799:
        colors.append('橙')
    elif 2800<=i<=3199:
        colors.append('赤')
    elif 3200<=i:
        niji.append('虹')

colors_count =len(set(colors))

if 0<= colors_count+len(niji)<=8:
    print(max(colors_count,1),colors_count+len(niji))
else:
    print(max(colors_count,1), 8)

Submission status: Wrong Answer

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

colors=[]
niji=[]
for i in a:
    if 1<=i<=399:
        colors.append('灰')
    elif 400<=i<=799:
        colors.append('茶')
    elif 800<=i<=1199:
        colors.append('緑')
    elif 1200<=i<=1599:
        colors.append('水')
    elif 1600<=i<=1999:
        colors.append('青')
    elif 2000<=i<=2399:
        colors.append('黄')
    elif 2400<=i<=2799:
        colors.append('橙')
    elif 2800<=i<=3199:
        colors.append('赤')
    elif 3200<=i:
        niji.append('虹')

colors_count =len(set(colors))

if len(niji)>=0:
    print(colors_count,colors_count+len(niji))
else:
    print(colors_count)

Submission status: Wrong Answer

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

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

B = {'a': 0, 'b': 0, 'c': 0, 'd': 0, 'e': 0, 'f': 0, 'g': 0, 'h': 0, 'z': 0}
for a in A:
    if 1 <= a <= 399:
        B['a'] += 1
    elif 400 <= a <= 799:
        B['b'] += 1
    elif 800 <= a <= 1199:
        B['c'] += 1
    elif 1200 <= a <= 1599:
        B['d'] += 1
    elif 1600 <= a <= 1999:
        B['e'] += 1
    elif 2000 <= a <= 2399:
        B['f'] += 1
    elif 2400 <= a <= 2799:
        B['g'] += 1
    elif 2800 <= a <= 3199:
        B['h'] += 1
    else:
        B['z'] += 1

ans = 0
for b in list(B.values())[:-1]:
    if b > 0:
        ans += 1
print(max(1, ans), ans + B['z'])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
d = {i:0 for i in range(9)}
for ele in a:
  if ele>=3200:
    d[8] += 1
  else:
    d[ele//400] = 1
ans1, ans2 = 0, 0
for k, v in d.items():
  if k!=8:
    ans1 += v
  ans2 += v
ans1 = max(1, ans1)
ans2 = min(8, ans2)
print(ans1, ans2)

Submission status: Wrong Answer

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

color_dict = [0 for x in range(9)] # d[8]

for c in a :
    if c in range(1, 400) : color_dict[0] = 1
    elif c in range(400, 800) : color_dict[1] = 1
    elif c in range(800, 1200) : color_dict[2] = 1
    elif c in range(1200, 1600) : color_dict[3] = 1
    elif c in range(1600, 2000) : color_dict[4] = 1
    elif c in range(2000, 2400) : color_dict[5] = 1
    elif c in range(2400, 2800) : color_dict[6] = 1
    elif c in range(2800, 3200) : color_dict[7] = 1
    elif c >= 3200 : color_dict[8] += 1
        
tot = sum(color_dict)
rainbow = color_dict[8]

if tot >= rainbow :
    print(tot - rainbow, tot)
elif tot < rainbow :
    print(rainbow, tot + rainbow)

Submission status: Wrong Answer

Solution code:
import math

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

a = [0]*9
for x in l:
 if math.floor(x/400)>8:
  a[8] += 1
 else:
  a[math.floor(x/400)] += 1
c = 0
for i in range(len(a)):
 if i==8:
  if c==0:
   min=1
  else:
   min = c
  c += a[i]
 elif a[i] >0:
  c+=1

if c>8:
 print("%d %d"% (min, 8))
else:
 print("%d %d"% (min, c))

Submission status: Wrong Answer

Solution code:
import math

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

a = [0]*9
for x in l:
 if math.floor(x/400)>8:
  a[8] += 1
 else:
  a[math.floor(x/400)] += 1
c = 0
for i in range(len(a)):
 if i==8:
  min = c
  c += a[i]
 elif a[i] >0:
  c+=1

if c>8:
 print("%d %d"% (min, 8))
else:
 print("%d %d"% (min, c))

Submission status: Wrong Answer

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

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

mx = 0
mn = 0
cnt = 0
if len([i for i in aN if 1 <= i < 400]) > 0:
    cnt += 1
if len([i for i in aN if 400 <= i < 800]) > 0:
    cnt += 1
if len([i for i in aN if 800 <= i < 1200]) > 0:
    cnt += 1
if len([i for i in aN if 1200 <= i < 1600]) > 0:
    cnt += 1
if len([i for i in aN if 1600 <= i < 2000]) > 0:
    cnt += 1
if len([i for i in aN if 2000 <= i < 2400]) > 0:
    cnt += 1
if len([i for i in aN if 2400 <= i < 2800]) > 0:
    cnt += 1
if len([i for i in aN if 2800 <= i < 3200]) > 0:
    cnt += 1

# 神がいる場合は話が変わってくる
kami = len([i for i in aN if 3200 <= i])
if kami == 0:
    print(str(cnt) + " " + str(cnt)) 
else:
    if cnt == 0:
        mn = 1
        mx = min(kami, 8)
    else:
        mn = cnt
        mx = min(cnt + kami, 8)
    print(str(mn) + " " + str(mx))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
x1 = 0
x2 = 0
x3 = 0
x4 = 0
x5 = 0
x6 = 0
x7 = 0
x8 = 0
c = 0

for i in range(N):
	if a[i] < 400:
		x1 = 1
	elif a[i] < 800:
		x2 = 1
	elif a[i] < 1200:
		x3 = 1
	elif a[i] < 1600:
		x4 = 1
	elif a[i] < 2000:
		x5 = 1
	elif a[i] < 2400:
		x6 = 1
	elif a[i] < 2800:
		x7 = 1
	elif a[i] < 3200:
		x8 = 1
	else:
		c += 1
s = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8
print(s, s + c)