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()))
A.sort()
flags = [False] * 8
min_ans = 1
high_coder = 0
for i in range(N):
    idx = A[i] // 400
    if idx < 8:
        flags[idx] = True
        min_ans = sum(flags)
    else:
        high_coder = N - i
        break

print(min_ans, min(8, min_ans + high_coder))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = map(int, input().split())
colors = [False] * 8
any = 0

for a in A:
    if 1 <= a < 300:
        colors[0] = True
    elif 300 <= a < 800:
        colors[1] = True
    elif 800 <= a < 1200:
        colors[2] = True
    elif 1200 <= a < 1600:
        colors[3] = True
    elif 1600 <= a < 2000:
        colors[4] = True
    elif 2000 <= a < 2400:
        colors[5] = True
    elif 2400 <= a < 2800:
        colors[6] = True
    elif 2800 <= a < 3200:
        colors[7] = True
    elif 3200 <= a:
        any += 1

if colors.count(True):
    print(1, end=" ")
else:
    print(colors.count(True), end=" ")

for _ in range(any):
    try:
        i = colors.index(False)
        colors[i] = True
    except Exception:
        break

print(colors.count(True))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = map(int, input().split())
colors = [False] * 8
any = 0

for a in A:
    if 1 <= a < 300:
        colors[0] = True
    elif 300 <= a < 800:
        colors[1] = True
    elif 800 <= a < 1200:
        colors[2] = True
    elif 1200 <= a < 1600:
        colors[3] = True
    elif 1600 <= a < 2000:
        colors[4] = True
    elif 2000 <= a < 2400:
        colors[5] = True
    elif 2400 <= a < 2800:
        colors[6] = True
    elif 2800 <= a < 3200:
        colors[7] = True
    elif 3200 <= a:
        any += 1

print(colors.count(True), end=" ")

for _ in range(any):
    try:
        i = colors.index(False)
        colors[i] = True
    except Exception:
        break

print(colors.count(True))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = map(int, input().split())
colors = [False] * 8
any = 0

for a in A:
    if 1 <= a < 300:
        colors[0] = True
    if 300 <= a < 800:
        colors[1] = True
    if 800 <= a < 1200:
        colors[2] = True
    if 1200 <= a < 1600:
        colors[3] = True
    if 1600 <= a < 2000:
        colors[4] = True
    if 2000 <= a < 2400:
        colors[5] = True
    if 2400 <= a < 2800:
        colors[6] = True
    if 2800 <= a < 3200:
        colors[7] = True
    if 3200 <= a:
        any += 1

print(colors.count(True), end=" ")

for _ in range(any):
    try:
        i = colors.index(False)
        colors[i] = True
    except Exception:
        break

print(colors.count(True))

Submission status: Wrong Answer

Solution code:
N = int(input())
*A, = map(int, input().split())
colors = [False] * 8
any = 0

for a in A:
    if 1 <= a < 300:
        colors[0] = True
        break
    if 300 <= a < 800:
        colors[1] = True
        break
    if 800 <= a < 1200:
        colors[2] = True
        break
    if 1200 <= a < 1600:
        colors[3] = True
        break
    if 1600 <= a < 2000:
        colors[4] = True
        break
    if 2000 <= a < 2400:
        colors[5] = True
        break
    if 2400 <= a < 2800:
        colors[6] = True
        break
    if 2800 <= a < 3200:
        colors[7] = True
        break
    if 3200 <= a:
        any += 1

print(colors.count(True), end=" ")

for _ in range(any):
    try:
        i = colors.index(False)
        colors[i] = True
    except Exception:
        break

print(colors.count(True))

Submission status: Wrong Answer

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

    cnt = [False] * 8
    tuyo = 0
    for i in range(N):
        if 1 <= A[i] <= 3199:
            cnt[A[i] // 400] = True
        else:
            tuyo += 1

    val = 0
    for i in cnt:
        if i:
            val += 1
    if val==0 and tuyo>0:
        val=1

    print(val, val + tuyo)


resolve()

Submission status: Wrong Answer

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

cnt = [0]*8
ziyu = 0
for a in A:
    if 1 <= a <= 399 and cnt[0] == 0:
        cnt[0] = 1
    elif 400 <= a <= 799 and cnt[1] == 0:
        cnt[1] = 1
    elif 800 <= a < 1199 and cnt[2] == 0:
        cnt[2] = 1
    elif 1200 <= a <= 1599 and cnt[3] == 0:
        cnt[3] = 1
    elif 1600 <= a <= 1999 and cnt[4] == 0:
        cnt[4] = 1
    elif 2000 <= a <= 2399 and cnt[5] == 0:
        cnt[5] = 1
    elif 2400 <= a <= 2799 and cnt[6] == 0:
        cnt[6] = 1
    elif 2800 <= a <= 3199 and cnt[7] == 0:
        cnt[7] = 1
    elif a <= 3200:
        ziyu += 1

min_cnt = 0
if ziyu > 0:
    min_cnt = 1

print(max(min_cnt, sum(cnt)), sum(cnt)+ziyu)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A.sort()
flags = [False] * 8
min_ans = 1
for a in A:
    idx = a // 400
    if idx < 8:
        flags[idx] = True
        min_ans = sum(flags)
    else:
        for i in range(8):
            if not flags[i]:
                flags[i] = True
                break

print(min_ans, sum(flags))

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

n = INT()
a = LIST()
arr = []
plus = 0
for i in range(n):
    flag = True
    for j in range(1, 9):
        if (j - 1) * 400 <= a[i] < j * 400:
            if not j in arr:
                arr.append(j)
            flag = False
    if flag:
        plus += 1
debug(len(arr), plus, arr)
ansmx = min(len(arr) + plus, 8)
ansmn = max(1, len(arr))
print(ansmn, ansmx)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]

def flag(l,r):
    return 1 if [a for a in A if l <= a <= r] else 0

ans = 0
for l in range(0,2801, 400):
    ans += flag(l, l + 399)

ans1 = ans + len([a for a in A if a >= 3200])
print(ans,ans1)

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

n = INT()
a = LIST()
arr = []
plus = 0
for i in range(n):
    flag = True
    for j in range(1, 9):
        if a[i] < j * 400:
            if not j in arr:
                arr.append(j)
            flag = False
            break
    if flag:
        plus += 1
debug(len(arr), plus, arr)
ansmx = min(len(arr) + plus, 8)
ansmn = max(1, len(arr))
print(ansmn, ansmx)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list(map(int,input().split()))
    ary = [0] * 8
    tmp = 0
    for i, aa in enumerate(a):
        if 0 < aa <= 399 and ary[0] == 0:
            ary[0] = 1
        elif 399 < aa <= 799 and ary[1] == 0:
            ary[1] = 1
        elif 799 < aa <= 1199 and ary[2] == 0:
            ary[2] = 1
        elif 1199 < aa <= 1599 and ary[3] == 0:
            ary[3] = 1
        elif 1599 < aa <= 1999 and ary[4] == 0:
            ary[4] = 1
        elif 1999 < aa <= 2399 and ary[5] == 0:
            ary[5] = 1
        elif 2399 < aa <= 2799 and ary[6] == 0:
            ary[6] = 1
        elif 2799 < aa <= 3199 and ary[7] == 0:
            ary[7] = 1
        elif 3199 < aa:
            tmp += 1
            # print(a[i])
    print(sum(ary), sum(ary) + tmp)

if __name__ =='__main__':
    main()

Submission status: Wrong Answer

Solution code:
def resolve():

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

    cnt=[False]*8
    tuyo=0
    for i in range(N):
        if 1<=A[i]<=3199:
            cnt[A[i]//400]=True
        else:
            tuyo+=1

    val=0
    for i in cnt:
        if i:
            val+=1


    print(val,val+tuyo)

resolve()

Submission status: Wrong Answer

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

cnt = [0]*8
ziyu = 0
for a in A:
    if 1 <= a <= 399 and cnt[0] == 0:
        cnt[0] = 1
    elif 400 <= a <= 799 and cnt[1] == 0:
        cnt[1] = 1
    elif 800 <= a < 1199 and cnt[2] == 0:
        cnt[2] = 1
    elif 1200 <= a <= 1599 and cnt[3] == 0:
        cnt[3] = 1
    elif 1600 <= a <= 1999 and cnt[4] == 0:
        cnt[4] = 1
    elif 2000 <= a <= 2399 and cnt[5] == 0:
        cnt[5] = 1
    elif 2400 <= a <= 2799 and cnt[6] == 0:
        cnt[6] = 1
    elif 2800 <= a <= 3199 and cnt[7] == 0:
        cnt[7] = 1
    elif 3200 <= a:
        ziyu += 1

min_cnt = 0
if ziyu > 0:
    min_cnt = 1

print(max(min_cnt, sum(cnt)), min(8, sum(cnt)+ziyu))

Submission status: Wrong Answer

Solution code:

def resolve():

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

    cnt=[False]*8
    tuyo=0
    for i in range(N):
        if 1<=A[i]<=3199:
            #t=A[i]//4
            cnt[A[i]//400]=True
        else:
            tuyo+=1

    val=0
    for i in cnt:
        if i==1:
            val+=1


    print(val,val+tuyo)

resolve()

Submission status: Wrong Answer

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

cnt = [0]*8
ziyu = 0
for a in A:
    if 0 <= a <= 399 and cnt[0] == 0:
        cnt[0] = 1
    elif 400 <= a <= 799 and cnt[1] == 0:
        cnt[1] = 1
    elif 800 <= a < 1199 and cnt[2] == 0:
        cnt[2] = 1
    elif 1200 <= a <= 1599 and cnt[3] == 0:
        cnt[3] = 1
    elif 1600 <= a <= 1999 and cnt[4] == 0:
        cnt[4] = 1
    elif 2000 <= a <= 2399 and cnt[5] == 0:
        cnt[5] = 1
    elif 2400 <= a <= 2799 and cnt[6] == 0:
        cnt[6] = 1
    elif 2800 <= a <= 3199 and cnt[7] == 0:
        cnt[7] = 1
    elif 3200 <= a:
        ziyu += 1

min_cnt = 0
if ziyu > 0:
    min_cnt = 1

print(max(min_cnt, sum(cnt)), min(8, sum(cnt)+ziyu))

Submission status: Wrong Answer

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

color = []
another = 0
for i in range(N):
  if a[i] <= 399: color.append("gray")
  elif a[i] <= 799: color.append("brown")
  elif a[i] <= 1199: color.append("green")
  elif a[i] <= 1599: color.append("wblue")
  elif a[i] <= 1999: color.append("blue")
  elif a[i] <= 2399: color.append("yellow")
  elif a[i] <= 2799: color.append("orange")
  elif a[i] <= 3199: color.append("red")
  else: another +=1
color = list(set(color))
print(len(color), len(color) + another)

Submission status: Wrong Answer

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

ans = set()
var = 0
for ai in a:
    if ai < 400:
        ans.add('gray')
    elif ai < 800:
        ans.add('brown')
    elif ai < 1200:
        ans.add('green')
    elif ai < 1600:
        ans.add('cian')
    elif ai < 2000:
        ans.add('blue')
    elif ai < 2400:
        ans.add('yellow')
    elif ai < 2800:
        ans.add('orange')
    elif ai < 3200:
        ans.add('red')
    else:
        var += 1

print(max(len(ans), 1), (min(len(ans) + var, 8)))

Submission status: Wrong Answer

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

print(sum(c[:8])+(1 if c[8] else 0),sum(c[:8])+c[8])

Submission status: Wrong Answer

Solution code:
n = int(input())
col = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
a = list(map(int,input().split()))
col_set = set()
cnt = 0
for i in range(n):
    if a[i] >= 3200:
        cnt += 1
    for j in range(len(col)):
        if a[i] <= col[j]:
            col_set.add(j)
            break
print(max(len(col_set), cnt), len(col_set)+cnt)

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

n = INT()
a = LIST()
arr = []
plus = 0
for i in range(n):
    flag = True
    for j in range(1, 9):
        if a[i] < j * 400:
            if not j in arr:
                arr.append(j)
            flag = False
            break
    if flag:
        plus += 1
debug(len(set(arr)), plus, arr)
ansmx = min(len(set(arr)) + plus, 8)
ansmn = max(1, len(set(arr)))
print(ansmn, ansmx)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
*A,=map(int, input().split())
col = [0]*8
free=0
for a in A:
    for i in range(8):
        if 400*i <= a < 400*(i+1): col[i] = 1
    if a >= 3200: free+=1

print(sum(col), sum(col)+free)

Submission status: Wrong Answer

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

print(sum(c[:8]),sum(c[:8])+c[8])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]

ans = 0
for i in range(1,3200,400):
    flag = False
    for j in range(i - 1, i + 398 + 1):
        if j in A:
            flag = True

    if flag:
        ans += 1

ans1 = ans
ans2 = ans + len([a for a in A if a >= 3200])
print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    cnt = [0]*9
    for a in A:
        idx = min(a//400, 8)
        cnt[idx] += 1
    ans = sum(int(a > 0) for a in cnt[:-1])
    print(ans, ans+cnt[-1])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
*A,=map(int, input().split())
col = [0]*8
free=0
for a in A:
    for i in range(8):
        if 400*i <= a < 400*(i+1): col[i] = 1
    if a >= 3200: free+=1

print(sum(col), min(8, sum(col)+free))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
B=[0,0,0,0,0,0,0,0]
free=int(0)
for i in range(n):
    if A[i]>=3200:
        free+=1
    else:
        now=int(A[i]/400)
        B[now]+=1
s=B.count(0)
s=8-s
print("{} {}".format(s,s+free))

Submission status: Wrong Answer

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

ans = set()
cnt = 0
for a in A:
    if a >= 3200:
        cnt += 1
    else:
        ans.add(a // 400)

mx = min(8, len(ans) + cnt)
mi = max(1, len(ans))

print(mi, mx)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
count = 0
color = set()
for i in range(n):
    if a[i]<400:
        color.add("a")
    elif a[i]<800:
        color.add("b")
    elif a[i]<1200:
        color.add("c")
    elif a[i]<1600:
        color.add("d")
    elif a[i]<2000:
        color.add("e")
    elif a[i]<2400:
        color.add("f")
    elif a[i]<2800:
        color.add("g")
    elif a[i]<3200:
        color.add("h")
    else:
        count += 1
print(len(color), len(color)+count)

Submission status: Wrong Answer

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

rt=[0]*8
rt8=0
for i in range(n):
    for j in range(0,8):
        if 400*j<=a[i] and a[i]<=399+400*j:
            rt[j]=1
    if a[i]>=3200:
        rt8=rt8+1
        
rtmin=max(1,sum(rt))
#rtmax=min(rtmin+rt8,8)
rtmax=rtmin+rt8

print(rtmin,rtmax)

Submission status: Wrong Answer

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

rt=[0]*8
rt8=0
for i in range(n):
    for j in range(0,8):
        if 400*j<=a[i] and a[i]<=399+400*j:
            rt[j]=1
    if a[i]>=3200:
        rt8=rt8+1
        
rtmin=sum(rt)
#rtmax=min(rtmin+rt8,8)
rtmax=rtmin+rt8

print(rtmin,rtmax)

Submission status: Wrong Answer

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

rt=[0]*8
rt8=0
for i in range(n):
    for j in range(0,8):
        if 400*j<=a[i] and a[i]<=399+400*j:
            rt[j]=1
    if a[i]>=3200:
        rt8=rt8+1
        
rtmin=sum(rt)
rtmax=min(rtmin+rt8,8)

print(rtmin,rtmax)

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = list(map(int, input().split()))
count = {"gray":0,"brown":0,"green":0,"lightblue":0,"blue":0,"yellow":0,"orange":0,"red":0}
free = 0

for i in lst:
    if i<400:
        count["gray"]+=1
    elif i<800:
        count["brown"]+=1
    elif i<1200:
        count["green"]+=1
    elif i<1600:
        count["lightblue"]+=1
    elif i<2000:
        count["blue"]+=1
    elif i<2400:
        count["yellow"]+=1
    elif i<2800:
        count["orange"]+=1
    elif i<3200:
        count["red"]+=1
    else:
        free+=1

ans = 0
for i in count.values():
    if i!=0:
        ans+=1

print(min(ans,1), ans+free)

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = list(map(int, input().split()))
count = {"gray":0,"brown":0,"green":0,"lightblue":0,"blue":0,"yellow":0,"orange":0,"red":0}
free = 0

for i in lst:
    if i<400:
        count["gray"]+=1
    elif i<800:
        count["brown"]+=1
    elif i<1200:
        count["green"]+=1
    elif i<1600:
        count["lightblue"]+=1
    elif i<2000:
        count["blue"]+=1
    elif i<2400:
        count["yellow"]+=1
    elif i<2800:
        count["orange"]+=1
    elif i<3200:
        count["red"]+=1
    else:
        free+=1

ans = 0
for i in count.values():
    if i!=0:
        ans+=1

print(ans, max(ans+free,8))

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = list(map(int, input().split()))
count = {"gray":0,"brown":0,"green":0,"lightblue":0,"blue":0,"yellow":0,"orange":0,"red":0}
free = 0

for i in lst:
    if i<400:
        count["gray"]+=1
    elif i<800:
        count["brown"]+=1
    elif i<1200:
        count["green"]+=1
    elif i<1600:
        count["lightblue"]+=1
    elif i<2000:
        count["blue"]+=1
    elif i<2400:
        count["yellow"]+=1
    elif i<2800:
        count["orange"]+=1
    elif i<3200:
        count["red"]+=1
    else:
        free+=1

ans = 0
for i in count.values():
    if i!=0:
        ans+=1

print(ans, ans+free)

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
r_list = [0]*9
for a in a_list:
	if a < 399:
		r_list[0] += 1
	elif a < 800:
		r_list[1] += 1
	elif a < 1200:
		r_list[2] += 1
	elif a < 1600:
		r_list[3] += 1
	elif a < 2000:
		r_list[4] += 1
	elif a < 2400:
		r_list[5] += 1
	elif a < 2800:
		r_list[6] += 1
	elif a < 3200:
		r_list[7] += 1
	else:
		r_list[8] += 1
min_count = 0
super_r = r_list.pop(-1)
for r in r_list:
	if r > 0:
		min_count += 1
max_count = super_r + min_count
if min_count == 0 and super_r > 0:
	min_count = 1
print(min_count, max_count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
r_list = [0]*9
for a in a_list:
	if a < 399:
		r_list[0] += 1
	elif a < 800:
		r_list[1] += 1
	elif a < 1200:
		r_list[2] += 1
	elif a < 1600:
		r_list[3] += 1
	elif a < 2000:
		r_list[4] += 1
	elif a < 2400:
		r_list[5] += 1
	elif a < 2800:
		r_list[6] += 1
	elif a < 3200:
		r_list[7] += 1
	else:
		r_list[8] += 1
min_count = 0
super_r = r_list.pop(-1)
for r in r_list:
	if r > 0:
		min_count += 1
max_count = min_count
if super_r > 0 and min_count < 8:
	max_count = super_r + min_count
if min_count == 0 and super_r > 0:
	min_count = 1
print(min_count, max_count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
r_list = [0]*9
for a in a_list:
	if a < 399:
		r_list[0] += 1
	elif a < 800:
		r_list[1] += 1
	elif a < 1200:
		r_list[2] += 1
	elif a < 1600:
		r_list[3] += 1
	elif a < 2000:
		r_list[4] += 1
	elif a < 2400:
		r_list[5] += 1
	elif a < 2800:
		r_list[6] += 1
	elif a < 3200:
		r_list[7] += 1
	else:
		r_list[8] += 1
min_count = 0
super_r = r_list.pop(-1)
for r in r_list:
	if r > 0:
		min_count += 1
max_count = min_count
if super_r > 0 and min_count < 8:
	max_count = super_r + min_count
	if max_count > 8:
		max_count = 8
if min_count == 0 and super_r > 0:
	min_count = 1
print(min_count, max_count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
r_list = [0]*9
for a in a_list:
	if a < 399:
		r_list[0] += 1
	elif a < 800:
		r_list[1] += 1
	elif a < 1200:
		r_list[2] += 1
	elif a < 1600:
		r_list[3] += 1
	elif a < 2000:
		r_list[4] += 1
	elif a < 2400:
		r_list[5] += 1
	elif a < 2800:
		r_list[6] += 1
	elif a < 3200:
		r_list[7] += 1
	else:
		r_list[8] += 1
min_count = 0
super_r = r_list.pop(-1)
for r in r_list:
	if r > 0:
		min_count += 1
if min_count == 0 and super_r > 0:
	min_count = 1
max_count = min_count
if super_r > 0 and min_count < 8:
	max_count = super_r + min_count
	if max_count > 8:
		max_count = 8
print(min_count, max_count)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
List = list(map(int,input().split()))
dic = defaultdict(int)
for item in List:
  value = item//400
  if value < 8:
    dic[value] += 1
  else:
    dic[8] += 1
additional = 0
if 8 in dic.keys():
  additional += dic[8]
  del dic[8]
base = len(dic.keys())
Answer = [base,base+additional]
print(*Answer)

Submission status: Wrong Answer

Solution code:
import numpy as np
rate = [400 * i for i in range(0, 9)]
rate[0] = 1

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

maximum = np.array([0 for i in range(len(rate))])
free = 0

for an in a:
  for i in range(1, len(rate)):
    if rate[i-1] <= an and an < rate[i]:
      maximum[i] = 1
  if 3199 < an:
    free += 1

mins = (maximum == 1).sum()
if mins == 0 and free > 0:
  print(1, free)
else:
  print(mins, mins + min(free, (maximum==0).sum()))

Submission status: Wrong Answer

Solution code:
import numpy as np
rate = [400 * i for i in range(0, 9)]
rate[0] = 1

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

maximum = np.array([0 for i in range(len(rate))])
free = 0

for an in a:
  for i in range(1, len(rate)):
    if rate[i-1] <= an and an < rate[i]:
      maximum[i] = 1
  if 3199 < an:
    free += 1

mins = (maximum == 1).sum()
print(mins, mins + min(free, (maximum==0).sum()))

Submission status: Wrong Answer

Solution code:
rate = [400 * i for i in range(1, 9)]
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]

maximum = np.array([0 for i in range(len(rate))])
free = 0

for an in a:
  for i,r in enumerate(rate):
    if rate[i-1] <= an and an < r:
      maximum[i] = 1
  if 3199 < an:
    free += 1

mins = (maximum == 1).sum()
print(mins, mins + min(free, (maximum==0).sum()))

Submission status: Wrong Answer

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
N = int(input())
a = readints()


def minimum(l):
    while 'choose' in l:
        l.remove('choose')
        # print(l)
    x = list(set(l))
    return len(x)


color = []
for i in range(N):
    if 1 <= a[i] and a[i] <= 399:
        color.append('gray')
    elif 400 <= a[i] and a[i] <= 799:
        color.append('brown')
    elif 800 <= a[i] and a[i] <= 1199:
        color.append('green')
    elif 1200 <= a[i] and a[i] <= 1599:
        color.append('light blue')
    elif 1600 <= a[i] and a[i] <= 1999:
        color.append('blue')
    elif 2000 <= a[i] and a[i] <= 2399:
        color.append('yellow')
    elif 2400 <= a[i] and a[i] <= 2799:
        color.append('orange')
    elif 2800 <= a[i] and a[i] <= 3199:
        color.append('red')
    elif 3200 <= a[i]:
        color.append('choose')
cnt = color.count('choose')
while 'choose' in color:
    color.remove('choose')
print(minimum(color), len(set(color))+cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

color = ["gray","braun","green","watter","bruee","yellow","orange","red"]

lis = []

count = 0

for i in a:
    if 1 <= i <=399:
        lis.append("gray")
    
    if 400 <= i <= 799:
        lis.append("braun")
    
    if 800 <= i <= 1199:
        lis.append("green")
    
    if 1600 <= i <= 1999:
        lis.append("bruee")

    if 1200 <= i <= 1599:
        lis.append("watter")
    
    if 2000 <= i <= 2399:
        lis.append("yellow")
    
    if 2400 <= i <= 2799:
        lis.append("orange")

    if 2800 <= i <= 3199:
        lis.append("red")
    if 3200 <= i:
        count = count + 1

mincase = len(set(lis))
maxcase = len(set(lis)) + count

print(mincase , '', maxcase)

Submission status: Wrong Answer

Solution code:
import sys
#input = sys.stdin.readline
#sys.setrecursionlimit(10**6)
#from collections import Counter
#from copy import deepcopy
#from itertools import combinations
#from operator import itemgetter
#from copy import deepcopy
#from operator import mul
#from functools import reduce

def main():
    n = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 8
    over3200 = 0
    for ia in a:
        if ia < 3200:
            colors[ia // 400] = 1
        else:
            over3200 += 1

    if sum(colors) == 0:
        r_min = 0
        r_max = over3200
    else:
        r_min = sum(colors)
        r_max = min(8, sum(colors) + over3200)
    print(r_min, r_max)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

color = ["gray","braun","green","watter","bruee","yellow","orange","red"]

lis = []

count = 0

for i in a:
    if 1 <= i <=399:
        lis.append("gray")
    
    if 400 <= i <= 799:
        lis.append("braun")
    
    if 800 <= i <= 1199:
        lis.append("green")
    
    if 1600 <= i <= 1999:
        lis.append("bruee")

    if 1200 <= i <= 1599:
        lis.append("watter")
    
    if 2000 <= i <= 2399:
        lis.append("yellow")
    
    if 2400 <= i <= 2799:
        lis.append("orange")

    if 2800 <= i <= 3199:
        lis.append("red")
    if 3200 <= i:
        count = count + 1

mincase = len(set(lis))
maxcase = max(8,len(set(lis)) + count)

print(mincase , '', maxcase)