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()))
che = []
for i in range(N):
    if A[i] <= 399:
        che.append("hai")
    elif A[i] >= 400 and A[i] <= 799:
        che.append("cha")
    elif A[i] > 799 and A[i] <= 1199:
        che.append("mid")
    elif A[i] > 1199 and A[i] <= 1599:
        che.append("miz")
    elif A[i] > 1599 and A[i] <= 1999:
        che.append("ao")
    elif A[i] > 1999 and A[i] <= 2399:
        che.append("kii")
    elif A[i] > 2399 and A[i] <= 2799:
        che.append("dau")
    elif A[i] > 2799 and A[i] <= 3199:
        che.append("aka")
    else:
        che.append("wid")
#print(che)
result = set(che)

if "wid" in result == "True" and len(result) == 9:
    print(8,8)
elif "wid" in result == "True" and len(result) == 8:
    print(len(result)-1,8)
elif "wid" in result == "True" and len(result) < 8:
    print(len(result)-1,len(result))
else:
    print(len(result),len(result))

Submission status: Wrong Answer

Solution code:
N= int(input())
A = list(map(int, input().split()))
che = []
for i in range(N):
    if A[i] <= 399:
        che.append("hai")
    elif A[i] >= 400 and A[i] <= 799:
        che.append("cha")
    elif A[i] > 799 and A[i] <= 1199:
        che.append("mid")
    elif A[i] > 1199 and A[i] <= 1599:
        che.append("miz")
    elif A[i] > 1599 and A[i] <= 1999:
        che.append("ao")
    elif A[i] > 1999 and A[i] <= 2399:
        che.append("kii")
    elif A[i] > 2399 and A[i] <= 2799:
        che.append("dau")
    elif A[i] > 2799 and A[i] <= 3199:
        che.append("aka")
    else:
        che.append("wid")
#print(che)
result = set(che)

if "wid" in result == "False":
    print(len(result),len(result))
elif "wid" in result == "True" and len(result) == 9:
    print(8,8)
elif "wid" in result == "True" and len(result) == 8:
    print(len(result)-1,8)
elif "wid" in result == "True" and len(result) < 8:
    print(len(result)-1,len(result))
else:
    print(len(result),len(result))

Submission status: Wrong Answer

Solution code:
N= int(input())
A = list(map(int, input().split()))
che = []
for i in range(N):
    if A[i] <= 399:
        che.append("hai")
    elif A[i] >= 400 and A[i] <= 799:
        che.append("cha")
    elif A[i] > 799 and A[i] <= 1199:
        che.append("mid")
    elif A[i] > 1199 and A[i] <= 1599:
        che.append("miz")
    elif A[i] > 1599 and A[i] <= 1999:
        che.append("ao")
    elif A[i] > 1999 and A[i] <= 2399:
        che.append("kii")
    elif A[i] > 2399 and A[i] <= 2799:
        che.append("dau")
    elif A[i] > 2799 and A[i] <= 3199:
        che.append("aka")
    else:
        che.append("wid")
#print(che)
result = set(che)

if "wid" in result == "False":
    print(len(result),len(result))
elif "wid" in result == "True" and len(result) == 9:
    print(len(result)-1,len(result)-1)
elif "wid" in result == "True" and len(result) == 8:
    print(len(result)-1,len(result))
elif "wid" in result == "True" and len(result) <= 8:
    print(len(result)-1,len(result)+1)
else:
    print(len(result),len(result))

Submission status: Wrong Answer

Solution code:
N= int(input())
A = list(map(int, input().split()))
che = []
for i in range(N):
    if A[i] <= 399:
        che.append("hai")
    elif A[i] >= 400 and A[i] <= 799:
        che.append("cha")
    elif A[i] > 799 and A[i] <= 1199:
        che.append("mid")
    elif A[i] > 1199 and A[i] <= 1599:
        che.append("miz")
    elif A[i] > 1599 and A[i] <= 1999:
        che.append("ao")
    elif A[i] > 1999 and A[i] <= 2399:
        che.append("kii")
    elif A[i] > 2399 and A[i] <= 2799:
        che.append("dau")
    elif A[i] > 2799 and A[i] <= 3199:
        che.append("aka")
    else:
        che.append("wid")
#print(che)
result = set(che)
if "wid" in result == "False":
    print(len(result),len(result))
elif "wid" in result == "True" and len(result) == 9:
    print(len(result)-1,len(result)-1)
elif "wid" in result == "True" and len(result) == 8:
    print(len(result)-1,len(result))
else:
    print(len(result)-1,len(result)+1)

Submission status: Wrong Answer

Solution code:
N= int(input())
A = list(map(int, input().split()))
che = []
for i in range(N):
    if A[i] <= 399:
        che.append("hai")
    elif A[i] >= 400 and A[i] <= 799:
        che.append("cha")
    elif A[i] > 799 and A[i] <= 1199:
        che.append("mid")
    elif A[i] > 1199 and A[i] <= 1599:
        che.append("miz")
    elif A[i] > 1599 and A[i] <= 1999:
        che.append("ao")
    elif A[i] > 1999 and A[i] <= 2399:
        che.append("kii")
    elif A[i] > 2399 and A[i] <= 2799:
        che.append("dau")
    elif A[i] > 2799 and A[i] <= 3199:
        che.append("aka")
    else:
        che.append("wid")
#print(che)
result = set(che)
if "wid" in result == "False":
    print(len(result),len(result))
elif "wid" in result == "True" and len(result) == 9:
    print(len(result),len(result))
elif "wid" in result == "True" and len(result) == 8:
    print(len(result)-1,len(result))
else:
    print(len(result)-1,len(result)+1)

Submission status: Wrong Answer

Solution code:
N= int(input())
A = list(map(int, input().split()))
che = []
for i in range(N):
    if A[i] <= 399:
        che.append("hai")
    elif A[i] >= 400 and A[i] <= 799:
        che.append("cha")
    elif A[i] > 799 and A[i] <= 1199:
        che.append("mid")
    elif A[i] > 1199 and A[i] <= 1599:
        che.append("miz")
    elif A[i] > 1599 and A[i] <= 1999:
        che.append("ao")
    elif A[i] > 1999 and A[i] <= 2399:
        che.append("kii")
    elif A[i] > 2399 and A[i] <= 2799:
        che.append("dau")
    elif A[i] > 2799 and A[i] <= 3199:
        che.append("aka")
    else:
        che.append("wid")
#print(che)
result = set(che)
if "wid" in result == "True" and len(result) <= 7:
    print(len(result)-1,len(result))
else:
    print(len(result),len(result))

Submission status: Wrong Answer

Solution code:
# abc064_c.py
def _min(rates):
    return len(rates)-rates.count(0)

def _max(rates,free):
    return min(len(rates)-rates.count(0)+free,n)

n = int(input())
a = list(map(int,input().split()))
rates = [0]*8
free = 0
for i in a:
    if i<400: #gray
        rates[0] += 1
    elif i<800: #cha
        rates[1] += 1
    elif i<1200: #green
        rates[2] += 1
    elif i<1600: #water
        rates[3] += 1
    elif i<2000: #blue
        rates[4] += 1
    elif i<2400: #yellow
        rates[5] += 1
    elif i<2800: #daidai
        rates[6] += 1
    elif i<3200: #red
        rates[7] += 1
    else:
        free += 1
print(_min(rates),_max(rates,free))

Submission status: Wrong Answer

Solution code:
# abc064_c.py
def _min(rates):
    return len(rates)-rates.count(0)

def _max(rates,free):
    return min(len(rates)-rates.count(0)+free,len(rates))

n = int(input())
a = list(map(int,input().split()))
rates = [0]*8
free = 0
for i in a:
    if i<400: #gray
        rates[0] += 1
    elif i<800: #cha
        rates[1] += 1
    elif i<1200: #green
        rates[2] += 1
    elif i<1600: #water
        rates[3] += 1
    elif i<2000: #blue
        rates[4] += 1
    elif i<2400: #yellow
        rates[5] += 1
    elif i<2800: #daidai
        rates[6] += 1
    elif i<3200: #red
        rates[7] += 1
    else:
        free += 1
print(_min(rates),_max(rates,free))

Submission status: Wrong Answer

Solution code:
n, *a = map(int, open(0).read().split())

def get_color(rate):
    if 1<=rate<400:
        return 'gray'
    elif rate<800:
        return 'brown'
    elif rate<1200:
        return 'green'
    elif rate<1600:
        return 'rb'
    elif rate<2000:
        return 'blue'
    elif rate<2400:
        return 'yellow'
    elif rate<2800:
        return 'orange'
    elif rate<3200:
        return 'red'
    else:
        return 'free'

c = set()
free_cnt = 0
for i in range(n):
    if get_color(a[i]) == 'free':
        free_cnt += 1
    else:
        c.add(get_color(a[i]))

min_ans = max(len(c),1)
max_ans = min(len(c)+free_cnt, 8)

print(min_ans, max_ans)

Submission status: Wrong Answer

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

color = [False] * 9
i = rate[0] // 400
switch = 400 * (i + 1)

for r in range(len(rate)):
    if rate[r] < switch and i <= 8:
        color[i] = True
    else:
        i = rate[r] // 400
        if i <= 7:
            color[i] = True
            switch = 400 * (i + 1)
        else:
            color[8] += 1

ans_min = sum(color[:8])
ans_max = sum(color)

if ans_min == 0:
    print("{} {}".format(1, ans_max))
else:
    print("{} {}".format(ans_min, ans_max))

Submission status: Wrong Answer

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

color = [False] * 9
i = rate[0] // 400
switch = 400 * (i + 1)

for r in range(len(rate)):
    if rate[r] < switch:
        color[i] = True
    else:
        i = rate[r] // 400
        if i <= 7:
            color[i] = True
            switch = 400 * (i + 1)
        else:
            color[8] += 1

ans_min = sum(color[:8])
ans_max = sum(color)

print("{} {}".format(ans_min, ans_max))

Submission status: Wrong Answer

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

def color(r):
    if 1 <= r <= 399:
        return 'hai'
    elif r <= 799:
        return 'cha'
    elif r <= 1199:
        return 'midori'
    elif r <= 1599:
        return 'mizu'
    elif r <= 1999:
        return 'ao'
    elif r <= 2399:
        return 'ki'
    elif r <= 2799:
        return 'dai'
    elif r <= 3199:
        return 'aka'
    else:
        return 'all'

c = list(map(color, a))
cs = set(c)
cc = len(cs)
ac = c.count('all')
if ac == 0:
    print(cc, cc)
else:
    cc -= 1
    print(max(1,cc), min(cc+ac, 8))

Submission status: Wrong Answer

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

def color(r):
    if 1 <= r <= 399:
        return 'hai'
    elif r <= 799:
        return 'cha'
    elif r <= 1199:
        return 'midori'
    elif r <= 1599:
        return 'mizu'
    elif r <= 1999:
        return 'ao'
    elif r <= 2399:
        return 'ki'
    elif r <= 2799:
        return 'dai'
    elif r <= 3199:
        return 'aka'
    else:
        return 'all'

c = list(map(color, a))
cs = set(c)
cc = len(cs)
ac = c.count('all')
if ac == 0:
    print(cc, cc)
else:
    print(cc-1, min(cc+ac-1, 8))

Submission status: Wrong Answer

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

zero = num[:8].count(0)
print(8-zero, end = ' ')
print(8-zero + num[8])

Submission status: Wrong Answer

Solution code:
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd
# fractions.gcd() を用いること
# math.log2()はatcoderでは対応していない．留意せよ．

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


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


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def find_gcd(list_l):
    x = reduce(gcd, list_l)
    return x


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

    sur=0
    b=[0 for _ in range(8)]
    for i in range(n):
        if a[i] // 400 >=8:
            sur += 1
        else:
            b[a[i]//400]=1

    eprint('b ',end=':\n')
    eprint(b)

    cnt=0
    for i in range(8):
        if b[i]==1:
            cnt+=1

    ans1=cnt + sur
    ans2=cnt
    print(ans2,min(ans1,8))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd
# fractions.gcd() を用いること
# math.log2()はatcoderでは対応していない．留意せよ．

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


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


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def find_gcd(list_l):
    x = reduce(gcd, list_l)
    return x


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

    sur=0
    b=[0 for _ in range(8)]
    for i in range(n):
        if a[i] // 400 >=8:
            sur += 1
        else:
            b[a[i]//400]=1

    eprint('b ',end=':\n')
    eprint(b)

    cnt=0
    for i in range(8):
        if b[i]==1:
            cnt+=1

    ans1=cnt + sur
    ans2=cnt
    print(ans2,ans1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

check = [False] * 8
r = 0
for i in range(n):
    if a[i] < 400:
        check[0] = True
    elif 400 <= a[i] < 800:
        check[1] = True
    elif 800 <= a[i] < 1199:
        check[2] = True
    elif 1200 <= a[i] < 1599:
        check[3] = True
    elif 1600 <= a[i] < 1999:
        check[4] = True
    elif 2000 <= a[i] < 2399:
        check[5] = True
    elif 2400 <= a[i] < 2799:
        check[6] = True
    elif 2800 <= a[i] < 3199:
        check[7] = True
    else:
        r += 1

color = 0
ans_max = r
for i in range(8):
    if check[i]:
        color += 1
        ans_max += 1

ans_min = max(color,1)
print(ans_min,ans_max)

Submission status: Wrong Answer

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

check = [False] * 8
r = 0
for i in range(n):
    if a[i] < 400:
        check[0] = True
    elif 400 <= a[i] < 800:
        check[1] = True
    elif 800 <= a[i] < 1199:
        check[2] = True
    elif 1200 <= a[i] < 1599:
        check[3] = True
    elif 1600 <= a[i] < 1999:
        check[4] = True
    elif 2000 <= a[i] < 2399:
        check[5] = True
    elif 2400 <= a[i] < 2799:
        check[6] = True
    elif 2800 <= a[i] < 3199:
        check[7] = True
    else:
        r += 1

ans_min = 0
ans_max = r
for i in range(8):
    if check[i]:
        ans_min += 1
        ans_max += 1

print(ans_min,ans_max)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
C = [0] * 9
for a in A:
    C[min(8, a//400)] += 1
s = sum([c > 0 for c in C[:-1]])
print(C)
print(max(s, 1), s + C[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
C = [0] * 9
for a in A:
    C[min(8, a//400)] += 1
s = sum([c > 0 for c in C[:-1]])
print(max(s, 1), min(8, s + C[-1]))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
C = [0] * 9
for a in A:
    C[min(8, a//400)] += 1
s = sum([c > 0 for c in C[:-1]])
print(max(s, 1), min(9, s + C[-1]))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
ans = [0] * 8
over3200 = 0
rates = [1,400,800,1200,1600,2000,2400,2800,3200]
for i in range(N):
    if a[i] >= rates[8]:
        over3200 += 1
        continue
    for j in range(7,-1,-1):
        if a[i] >= rates[j]:
            ans[j] = 1
            break

min = 0
max = 0

if sum(ans) > 0:
    min = sum(ans)
else:
    min = 1

if sum(ans) + over3200 >= 8:
    max = 8
else:
    max = sum(ans) + over3200

print(min, max)

Submission status: Wrong Answer

Solution code:
import collections
def solve(n, a_list):

    count = collections.Counter()
    for i in a_list:
        no = 8 if i // 400 >= 8 else i // 400
        count[no] += 1

    tmp = len([i for i in count.keys() if i != 8])
    max_value = 8 if tmp + count[8] >= 8 else tmp + count[8]
    min_value = 1 if tmp == 0 else tmp

    return "{0} {1}".format(min_value, max_value)

if __name__ == "__main__":
    n = int(input())
    a_list = [int(i) for i in input().split()]
    print(solve(n, a_list))

Submission status: Wrong Answer

Solution code:
import collections
def solve(n, a_list):

    count = collections.Counter()
    for i in a_list:
        count[i // 400] += 1

    tmp = len([i for i in count.keys() if i != 8])
    max_value = 8 if tmp + count[8] >= 8 else tmp + count[8]
    min_value = 1 if tmp == 0 else tmp

    return "{0} {1}".format(min_value, max_value)

if __name__ == "__main__":
    n = int(input())
    a_list = [int(i) for i in input().split()]
    print(solve(n, a_list))

Submission status: Wrong Answer

Solution code:
import collections
def solve(n, a_list):

    count = collections.Counter()
    for i in a_list:
        count[i // 400] += 1

    tmp = len([i for i in count.keys() if i != 8])
    if count[8] == 0:
        max_value = tmp
        min_value = tmp
    else:
        max_value = 8 if tmp + count[8] >= 8 else tmp + count[8]
        min_value = 1 if tmp == 0 else tmp

    return "{0} {1}".format(min_value, max_value)

if __name__ == "__main__":
    n = int(input())
    a_list = [int(i) for i in input().split()]
    print(solve(n, a_list))

Submission status: Wrong Answer

Solution code:
import collections
def solve(n, a_list):

    count = collections.Counter()
    for i in a_list:
        count[i // 400] += 1

    max_value = len([i for i in count.keys() if i != 8]) + count[8]
    min_value =  1 if max_value - count[8] == 0 else max_value - count[8]
    return "{0} {1}".format(min_value, max_value)

if __name__ == "__main__":
    n = int(input())
    a_list = [int(i) for i in input().split()]
    print(solve(n, a_list))

Submission status: Wrong Answer

Solution code:
import collections
def solve(n, a_list):

    count = collections.Counter()
    for i in a_list:
        count[i // 400] += 1

    min_value = len([i for i in count.keys() if i != 8])
    max_value = min_value + count[8]
    return "{0} {1}".format(min_value, max_value)

if __name__ == "__main__":
    n = int(input())
    a_list = [int(i) for i in input().split()]
    print(solve(n, a_list))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
d = {'8':0}
for i in a:
  if 1 <= i <= 399:
    if '0' in d:
      d['0'] += 1
    else:
      d['0'] = 1
  elif 400 <= i <= 799:
    if '1' in d:
      d['1'] += 1
    else:
      d['1'] = 1
  elif 800 <= i <= 1199:
    if '2' in d:
      d['2'] += 1
    else:
      d['2'] = 1
  elif 1200 <= i <= 1599:
    if '3' in d:
      d['3'] += 1
    else:
      d['3'] = 1
  elif 1600 <= i <= 1999:
    if '4' in d:
      d['4'] += 1
    else:
      d['4'] = 1
  elif 2000 <= i <= 2399:
    if '5' in d:
      d['5'] += 1
    else:
      d['5'] = 1
  elif 2400 <= i <= 2799:
    if '6' in d:
      d['6'] += 1
    else:
      d['6'] = 1
  elif 2800 <= i <= 3199:
    if '7' in d:
      d['7'] += 1
    else:
      d['7'] = 1
  else:
    d['8'] += 1

if d['8'] == 0 :
  print(len(d)-1,len(d)-1)
else:
  if len(d)-1 == 0:
    print(1,min(8,len(d)+d['8'] -1))
  else:
    print(len(d)-1,min(8,len(d)+d['8'] -1))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
d = {'8':0}
for i in a:
  if 1 <= i <= 399:
    if '0' in d:
      d['0'] += 1
    else:
      d['0'] = 1
  elif 400 <= i <= 799:
    if '1' in d:
      d['1'] += 1
    else:
      d['1'] = 1
  elif 800 <= i <= 1199:
    if '2' in d:
      d['2'] += 1
    else:
      d['2'] = 1
  elif 1200 <= i <= 1599:
    if '3' in d:
      d['3'] += 1
    else:
      d['3'] = 1
  elif 1600 <= i <= 1999:
    if '4' in d:
      d['4'] += 1
    else:
      d['4'] = 1
  elif 2000 <= i <= 2399:
    if '5' in d:
      d['5'] += 1
    else:
      d['5'] = 1
  elif 2400 <= i <= 2799:
    if '6' in d:
      d['6'] += 1
    else:
      d['6'] = 1
  elif 2800 <= i <= 3199:
    if '7' in d:
      d['7'] += 1
    else:
      d['7'] = 1
  else:
    d['8'] += 1

if d['8'] == 0 :
  print(len(d)-1,len(d)-1)
else:
  print(len(d)-1,min(8,len(d)+d['8'] -1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
tuplet=set()
count=0
input()
x=map(int,input().split())
for a in x:
    if a<400:
        tuplet.add("gr")
    elif a<800:
        tuplet.add("br")
    elif a<1200:
        tuplet.add("gre")
    elif a<1600:
        tuplet.add("wa")
    elif a<2000:
        tuplet.add("bl")
    elif a<2400:
        tuplet.add("ye")
    elif a<2800:
        tuplet.add("ore")
    elif a<3200:
        tuplet.add("red")
    else:
        count+=1
if count>0:
    ma=min(8,len(tuplet)+count)
    mi=max(len(tuplet),1)
else:
    ma=len(tuplet)
    mi=ma
print("{} {}".format(mi,ma))

Submission status: Wrong Answer

Solution code:
tuplet=set()
count=0
input()
x=map(int,input().split())
for a in x:
    if a<400:
        tuplet.add("gr")
    elif a<800:
        tuplet.add("br")
    elif a<1200:
        tuplet.add("gre")
    elif a<1600:
        tuplet.add("wa")
    elif a<2000:
        tuplet.add("bl")
    elif a<2400:
        tuplet.add("ye")
    elif a<2800:
        tuplet.add("ore")
    elif a<3200 :
        tuplet.add("red")
    else:
        count+=1
if count:
    ma=min(8,len(tuplet)+count)
    mi=max(len(tuplet),1)
else:
    ma=len(tuplet)
    mi=ma
print("{} {}".format(mi,ma))

Submission status: Wrong Answer

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

def calculate(n, arr):
    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

    l = np.array(list(dict.values()))

    goodNum = np.sum(l == True)
    badNum = np.sum(l == False)

    if goodNum == 0:
        print(1,min(goodNum + any,8))
    else:
        print(goodNum,min(goodNum + any,8))

calculate(N,ARR)

Submission status: Wrong Answer

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

def calculate(n, arr):
    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

    l = np.array(list(dict.values()))

    goodNum = np.sum(l == True)
    badNum = np.sum(l == False)

    if any >= badNum:
        print(goodNum,8)
    else:
        print(goodNum,goodNum+any)

    # print(goodNum,min(goodNum + any,8))

calculate(N,ARR)

Submission status: Wrong Answer

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

def calculate(n, arr):
    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

    l = np.array(list(dict.values()))

    goodNum = np.sum(l == True)
    badNum = np.sum(l == False)

    print(goodNum,min(goodNum + any,8))

calculate(N,ARR)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

c = np.where(a < 3200, a//400, 8)
j = np.count_nonzero(c == 8)
Mans = min(8, len(np.unique(c)) - 1 + j) if j else len(np.unique(c))
mans = max(1, len(np.unique(c)) - 1) if j else len(np.unique(c))
print(mans, Mans)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

c = np.where(a < 3200, a//400, 8)
j = np.count_nonzero(c == 8)
Mans = max(8, len(np.unique(c)) - 1 + j) if j else len(np.unique(c))
mans = max(1, len(np.unique(c)) - 1) if j else len(np.unique(c))
print(mans, Mans)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

c = np.where(a < 3200, a//400, 8)
j = np.count_nonzero(c == 8)
ans = min(8, len(np.unique(c)) - 1 + j) if j else len(np.unique(c))
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

c = np.where(a < 3200, a//400, 8)
j = np.count_nonzero(c == 8)
ans = max(8, len(np.unique(c)) - 1 + j) if j else len(np.unique(c))
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

c = np.where(a < 3200, a//400, 8)
j = np.count_nonzero(c == 8)
ans = len(np.unique(c)) - 1 + j if j else len(np.unique(c))
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

c = np.where(a < 3200, a//400, 8)
j = np.count_nonzero(c == 8)
ans = len(np.unique(c)) - 1 + j if j else len(np.unique(c))