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()))

t1 = []
t2 = []
t3 = []
t4 = []
t5 = []
t6 = []
t7 = []
t8 = []
t9 = []
counter = 0

for i in range(n):
    if 1 <= a[i] <= 399:
        t1.append(a[i])
    elif 400 <= a[i] <= 799:
        t2.append(a[i])
    elif 800 <= a[i] <= 1199:
        t3.append(a[i])
    elif 1200 <= a[i] <= 1599:
        t4.append(a[i])
    elif 1600 <= a[i] <= 1999:
        t5.append(a[i])
    elif 2000 <= a[i] <= 2399:
        t6.append(a[i])
    elif 2400 <= a[i] <= 2799:
        t7.append(a[i])
    elif 2800 <= a[i] <= 3199:
        t8.append(a[i])
    else:
        t9.append(a[i])
        
if t1:
    counter +=1
if t2:
    counter +=1
if t3:
    counter +=1
if t4:
    counter +=1
if t5:
    counter +=1
if t6:
    counter +=1
if t7:
    counter +=1
if t8:
    counter +=1

niji = len(t9)
print(counter,min(8,counter + niji))

Submission status: Wrong Answer

Solution code:
import collections

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

for i in range(N):
    sort[i] = sort[i] // 400

normal = [i for i in sort if i < 8]
incredible = [i for i in sort if i >= 8]

min = len(collections.Counter(normal))
max = len(collections.Counter(normal)) + len(incredible)

min = 1 if min < 1 else min
max = 8 if max > 8 else max

print(min, max)

Submission status: Wrong Answer

Solution code:
import collections

N = int(input())
a = list(map(int, input().split()))
if (len(a) != N or N > 100 or N < 1 or max(a) > 4800 or min(a) < 1):
    exit()

sort = sorted(a, key=int)

for i in range(N):
    sort[i] = sort[i] // 400

normal = [i for i in sort if i < 8]
incredible = [i for i in sort if i >= 8]

min = len(collections.Counter(normal))
max = len(collections.Counter(normal)) + len(incredible)

min = 1 if min < 1 else min
max = 8 if max > 8 else max

print(min, max)

Submission status: Wrong Answer

Solution code:
import collections

N = int(input())
a = list(map(int, input().split()))
if (len(a) != N):
    exit()

sort = sorted(a, key=int)

for i in range(N):
    sort[i] = sort[i] // 400

normal = [i for i in sort if i < 8]
incredible = [i for i in sort if i >= 8]

min = len(collections.Counter(normal))
max = len(collections.Counter(normal)) + len(incredible)

min = 1 if min < 1 else min
max = 8 if max > 8 else max

print(min, max)

Submission status: Wrong Answer

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

color=set()
count=0

for aa in a:
    if aa>=3200:
        count+=1
    else:
        color.add(aa//400)

print(len(color), end=" ")
print(len(color)+count)

Submission status: Wrong Answer

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

color=set()
count=0

for aa in a:
    if aa>=3200:
        count+=1
    else:
        color.add(aa//400)

print("{} {}".format(len(color), len(color)+count))

Submission status: Wrong Answer

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

color=[False]*8
count=0

for aa in a:
    index=aa//400 
    if index>=8:
        count+=1
    else:
        color[index]=True

print("{} {}".format(color.count(True), color.count(True)+count))

Submission status: Wrong Answer

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

color=[False]*8
count=0

for aa in a:
    index=aa//400 -1
    if index>=8:
        count+=1
    else:
        color[index]=True

print("{} {}".format(color.count(True), min(8,color.count(True)+count)))

Submission status: Wrong Answer

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

color=[False]*8
count=0

for aa in a:
    index=aa//400
    if index>=8:
        count+=1
    else:
        color[index]=True

print("{} {}".format(color.count(True), min(8,color.count(True)+count)))

Submission status: Wrong Answer

Solution code:
import heapq
import sys
input = sys.stdin.readline


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

    if N==1:
        print('1 1')
        return

    C = [False]*8
    r = 0
    for a in A:
        if a<400:
            C[0] = True
        elif a<800:
            C[1] = True
        elif a<1200:
            C[2] = True
        elif a<1600:
            C[3] = True
        elif a<2000:
            C[4] = True
        elif a<2400:
            C[5] = True
        elif a<2800:
            C[6] = True
        elif a<3200:
            C[7] = True
        else:
            r += 1

    c_cnt = C.count(True)
    c_min = max(c_cnt, 1)
    c_max = min(c_cnt + r, 8)
    print(' '.join(map(str, [c_min, c_max])))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import heapq
import sys
input = sys.stdin.readline


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

    C = [False]*8
    r = 0
    for a in A:
        if a<400:
            C[0] = True
        elif a<800:
            C[1] = True
        elif a<1200:
            C[2] = True
        elif a<1600:
            C[3] = True
        elif a<2000:
            C[4] = True
        elif a<2400:
            C[5] = True
        elif a<2800:
            C[6] = True
        elif a<3200:
            C[7] = True
        else:
            r += 1

    c_cnt = C.count(True)
    c_min = max(c_cnt, 1)
    c_max = min(c_cnt + r, 8)
    print(' '.join(map(str, [c_min, c_max])))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
s = set()
all = 0
for i in a:
    if i >= 3200:
        all += 1
    else:s.add(i//400)
if not s:
    print(all,end=" ")
else:print(len(s),end=" ")
print(len(s)+all)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
s = set()
all = 0
for i in a:
    if i >= 3200:
        all += 1
    else:s.add(i//400)
print(len(s),end=" ")
print(len(s)+all)

Submission status: Wrong Answer

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

for i in range(n):
    if 1 <= li[i] <=399:
        li[i] = 1
    elif 400<= li[i] <=799: 
        li[i] = 2
    elif 800<= li[i] <=1199:
        li[i] = 3
    elif 1200<= li[i] <=1599:
        li[i] = 4
    elif 1600<= li[i] <=1999:
        li[i] = 5
    elif 2000<= li[i] <=2399:
        li[i] = 6
    elif 2400<= li[i] <=2799:
        li[i] = 7
    elif 2800<= li[i] <=3199:
        li[i] = 8
    elif 3200<= li[i] <=4800:
        li[i] = 10+i
max1 = len(set(li))
li = [x for x in li if x < 9]
min1 = len(set(li))
print(min1,max1)

Submission status: Wrong Answer

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

for i in range(n):
    if 1 <= li[i] <=399:
        li[i] = 1
    elif 400<= li[i] <=799: 
        li[i] = 2
    elif 800<= li[i] <=1199:
        li[i] = 3
    elif 1200<= li[i] <=1599:
        li[i] = 4
    elif 1600<= li[i] <=1999:
        li[i] = 5
    elif 2000<= li[i] <=2399:
        li[i] = 6
    elif 2400<= li[i] <=2799:
        li[i] = 7
    elif 2800<= li[i] <=3199:
        li[i] = 8
    else:
        li[i] = 10+i
max1 = len(set(li))
li = [x for x in li if x < 9]
min1 = len(set(li))
print(min1,max1)

Submission status: Wrong Answer

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

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

st = set()
super_coder = 0
for ele in a:
    clr = ele // 400
    if clr <= 7:  # has color
        st.add(clr)
    else:  # greater than red coder!!!
        super_coder += 1

if super_coder:
    ans = [max(len(st), 1), min(len(st) + super_coder, 8)]
else:
    ans = [len(st), len(st)]

print(*ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()
d = defaultdict(int)
for i in a:
    d[i//400] += 1
c = 0
f = 0
print(d)
for key in d.keys():
    if key < 8:
        c += 1
    else:
        f += d[key]
if c == 0:
    print(1,f)
else:
    print(c,c+f)

Submission status: Wrong Answer

Solution code:
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()
d = defaultdict(int)
for i in a:
    d[i//400] += 1
c = 0
f = 0
# print(d)
for key in d.keys():
    if key < 8 and d[key] > 0:
        c += 1
    elif key >= 8 and d[key] > 0:
        f += d[key]
if c == 0:
    c = 1
print(c,c+f)

Submission status: Wrong Answer

Solution code:
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()
d = defaultdict(int)
for i in a:
    d[i//400] += 1
c = 0
f = 0
# print(d)
for key in d.keys():
    if key < 8 and d[key] > 0:
        c += 1
    elif key >= 8 and d[key] > 0:
        f += d[key]
print(min(max(c,f),8),c+f)

Submission status: Wrong Answer

Solution code:
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()
d = defaultdict(int)
for i in a:
    d[i//400] += 1
c = 0
f = 0
# print(d)
for key in d.keys():
    if key < 8 and d[key] > 0:
        c += 1
    elif key >= 8 and d[key] > 0:
        f += d[key]
print(max(c,f),c+f)

Submission status: Wrong Answer

Solution code:
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()
d = defaultdict(int)
for i in a:
    d[i//400] += 1
c = 0
f = 0
# print(d)
for key in d.keys():
    if key < 8 and d[key] > 0:
        c += 1
    elif key >= 8 and d[key] > 0:
        f += d[key]
print(max(c,f),min(c+f, 8))

Submission status: Wrong Answer

Solution code:
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()
d = defaultdict(int)
for i in a:
    d[i//400] += 1
c = 0
f = 0
# print(d)
for key in d.keys():
    if key < 8 and d[key] > 0:
        c += 1
    elif key >= 8 and d[key] > 0:
        f += d[key]
print(c,min(c+f, 8))

Submission status: Wrong Answer

Solution code:
import collections

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

counter = collections.Counter()
for a in ls:
    counter[min(8, a // 400)] += 1
n_keys = len(counter.keys())
n8 = counter[8]
if n8 > 0:
    if n_keys == 0:
        n_min = 1
        n_max = n
    else:
        n_min = n_keys - 1
        n_max = n_min + n8
else:
    n_min = n_max = n_keys
print(n_min, n_max)

Submission status: Wrong Answer

Solution code:
import collections

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

counter = collections.Counter()
for a in ls:
    counter[min(8, a // 400)] += 1
n_keys = len(counter.keys())
n8 = counter[8]
if n8 > 0:
    n_min = n_keys - 1
    n_max = n_min + n8
else:
    n_min = n_max = n_keys
print(n_min, n_max)

Submission status: Wrong Answer

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

def rate_color(rate):
    if 1 <= rate and rate < 400:
        return 'ash'
    elif 400 <= rate and rate < 800:
        return 'brown'
    elif 800 <= rate and rate < 1200:
        return 'green'
    elif 1200 <= rate and rate < 1600:
        return 'lightblue'
    elif 1600 <= rate and rate < 2000:
        return 'blue'
    elif 2000 <= rate and rate < 2400:
        return 'yellow'
    elif 2400 <= rate and rate < 2800:
        return 'orange'
    elif 2800 <= rate and rate < 3200:
        return 'red'
    else:
        return 'anycolor'


color_list = []
for i in range(N):
    color_list.append(rate_color(a_list[i]))


basic_color_list = ['ash', 'brown', 'green', 'lightblue', 'blue', 'yellow', 'orange', 'red', 'anycolor']

count_list = []
for _ in basic_color_list:
    count_list.append(color_list.count(_))

count_list_but_anycolor = count_list[:-1]

count_anycolor = count_list[-1]
count_0 = count_list_but_anycolor.count(0)

max_result = 8 - count_0 + count_anycolor
min_result = 8 - count_0

print(min_result, max_result)

Submission status: Wrong Answer

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

def rate_color(rate):
    if 1 <= rate and rate < 400:
        return 'ash'
    elif 400 <= rate and rate < 800:
        return 'brown'
    elif 800 <= rate and rate < 1200:
        return 'green'
    elif 1200 <= rate and rate < 1600:
        return 'lightblue'
    elif 1600 <= rate and rate < 2000:
        return 'blue'
    elif 2000 <= rate and rate < 2400:
        return 'yellow'
    elif 2400 <= rate and rate < 2800:
        return 'orange'
    elif 2800 <= rate and rate < 3200:
        return 'red'
    else:
        return 'anycolor'


color_list = []
for i in range(N):
    color_list.append(rate_color(a_list[i]))


basic_color_list = ['ash', 'brown', 'green', 'lightblue', 'blue', 'yellow', 'orange', 'red', 'anycolor']

count_list = []
for _ in basic_color_list:
    count_list.append(color_list.count(_))

count_list_but_anycolor = count_list[:-1]

count_anycolor = count_list[-1]
count_0 = count_list_but_anycolor.count(0)

if count_0 >= count_anycolor:
    max_result = count_anycolor + (8 - count_0)
else:
    max_result = 8

min_result = 8 - count_0

print(min_result, max_result)

Submission status: Wrong Answer

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    ls = [0] * 9
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    for v in a:
        if 1 <= v <= 399:
            ls[0] = 1
        elif 400 <= v <= 700:
            ls[1] = 1
        elif 800 <= v <= 1199:
            ls[2] = 1
        elif 1200 <= v <= 1599:
            ls[3] = 1
        elif 1600 <= v <= 1999:
            ls[4] = 1
        elif 2000 <= v <= 2399:
            ls[5] = 1
        elif 2400 <= v <= 2799:
            ls[6] = 1
        elif 2800 <= v <= 3199:
            ls[7] = 1
        else:
            ls[8] += 1
    print(max(sum(ls[:8]), 1), sum(ls[:8]) + ls[8])


if __name__ == '__main__':
    slove()

Submission status: Wrong Answer

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]
hai = 0
cha = 0
mdr = 0
miz = 0
aao = 0
kii = 0
dai = 0
aka = 0
kan = 0

for i in a:
    if i <= 399:
        hai = 1
    elif i <= 799:
        cha = 1
    elif i <= 1199:
        mdr = 1
    elif i <= 1599:
        miz = 1
    elif i <= 1999:
        aao = 1
    elif i <= 2399:
        kii = 1
    elif i <= 2799:
        dai = 1
    elif i <= 3199:
        aka = 1
    else:
        kan += 1

ans1 = kan+aka+dai+kii+aao+miz+mdr+cha+hai
ans2 = aka+dai+kii+aao+miz+mdr+cha+hai
print(ans2,ans1)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]
hai = 0
cha = 0
mdr = 0
miz = 0
aao = 0
kii = 0
dai = 0
aka = 0
kan = 0

for i in a:
    if i <= 399:
        hai = 1
    elif i <= 799:
        cha = 1
    elif i <= 1199:
        mdr = 1
    elif i <= 1599:
        miz = 1
    elif i <= 1999:
        aao = 1
    elif i <= 2399:
        kii = 1
    elif i <= 2799:
        dai = 1
    elif i <= 3199:
        aka = 1
    else:
        kan += 1

ans1 = min(8,kan+aka+dai+kii+aao+miz+mdr+cha+hai)
ans2 = aka+dai+kii+aao+miz+mdr+cha+hai
print(ans2,ans1)

Submission status: Wrong Answer

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

s=[0]*8
count=0
ans=0

for i in range(n):
  if a[i]<400:
    s[0]+=1
  elif a[i]<800:
    s[1]+=1
  elif a[i]<1200:
    s[2]+=1
  elif a[i]<1600:
    s[3]+=1
  elif a[i]<2000:
    s[4]+=1
  elif a[i]<2400:
    s[5]+=1
  elif a[i]<2800:
    s[6]+=1
  elif a[i]<3200:
    s[7]+=1
  else:
    count+=1

for j in range(8):
  if s[j]!=0:
    ans+=1

print(ans,ans+count)

Submission status: Wrong Answer

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

def color(point):
  if point < 3200:
    return point // 400
  else:
    return 8

vals = {}
for i in a:
  cl = color(i)
  vals.setdefault(cl, 0)
  vals[cl] += 1

# print(vals)
  
if 8 not in vals.keys():
  print(len(vals), len(vals))
else:
  print(max(1, len(vals) - 1), min(8, len(vals) + vals[8] - 1))

Submission status: Wrong Answer

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

def color(point):
  if point < 3200:
    return point // 400
  else:
    return 8

vals = {}
for i in a:
  cl = color(i)
  vals.setdefault(cl, 0)
  vals[cl] += 1

# print(vals)
  
if 8 not in vals.keys():
  print(len(vals), len(vals))
else:
  if len(vals) == 1:
    print(1, max(2, vals[8]))
  else:
    print(len(vals) - 1, min(8, len(vals) + 1))

Submission status: Wrong Answer

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

def color(point):
  if point < 3200:
    return point // 400
  else:
    return 8

vals = {}
for i in a:
  cl = color(i)
  vals.setdefault(cl, 0)
  vals[cl] += 1

print(vals)
  
if 8 not in vals.keys():
  print(len(vals), len(vals))
else:
  if len(vals) == 1:
    print(1, max(2, vals[8]))
  else:
    print(len(vals) - 1, min(8, len(vals) + 1))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = [False] * 8
count = 0
count2 = 0

for i in A:
    if i <= 399:
        ans[0] = 1

    elif i <= 799:
        ans[1] = 1

    elif i <= 1199:
        ans[2] = 1

    elif i <= 1599:
        ans[3] = 1

    elif i <= 1999:
        ans[4] = 1

    elif i <= 2399:
        ans[5] = 1

    elif i <= 2799:
        ans[6] = 1

    elif i <= 3199:
        ans[7] = 1

    elif i >= 3200:
        count2 += 1

for i in ans:
    if i == True:
        count += 1

print(count, count+count2)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = [False] * 8
count = 0
count2 = 0

for i in A:
    if i <= 399:
        ans[0] = 1

    elif i <= 799:
        ans[1] = 1

    elif i <= 1199:
        ans[2] = 1

    elif i <= 1599:
        ans[3] = 1

    elif i <= 1999:
        ans[4] = 1

    elif i <= 2399:
        ans[5] = 1

    elif i <= 2799:
        ans[6] = 1

    elif i <= 3199:
        ans[7] = 1

    elif i <= 3200:
        count2 += 1

for i in ans:
    if i == True:
        count += 1

print(count, count+count2)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
from collections import defaultdict
B = defaultdict(int)
for i in A:
    B[min(8,i//400)]+=1
ans = 0
jiyuu = 0
for i in B:
    if i != 8:
        ans += 1
    else:
        jiyuu = B[i]
        
print(*[ans,ans+jiyuu])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
from collections import defaultdict
B = defaultdict(int)
for i in A:
    B[min(8,i//400)]+=1
ans = 0
jiyuu = 0
for i in B:
    if i != 8:
        ans += 1
    else:
        jiyuu = B[i]
        
print(*[ans,min(8,ans+jiyuu)])

Submission status: Wrong Answer

Solution code:


import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
##############################

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

ans_min = 0
ans_max = 0
colors = [0] * 8

def get_colors(num):
    if num <= 399:
        return 0
    elif num <= 799:
        return 1
    elif num <= 1199:
        return 2
    elif num <= 1599:
        return 3
    elif num <= 1999:
        return 4
    elif num <= 2399:
        return 5
    elif num <= 2799:
        return 6
    elif num <= 3199:
        return 7
    else:
        return -1

all = 0
for i in range(N):
    color = get_colors(A[i])
    if color == -1:
        all += 1
    else:
        colors[color] += 1

# all は「好きな色」に変えることができる！（レートの色以外でもいい）

x = colors.count(0)
# 自由選択できない
if all == 0:
    ans_min = 8-x
    ans_max = 8-x
else:
    if x == 8:
        # all しかない
        ans_min = 1
        anx_max = all
    else:
        # 混合
        ans_min = 8-x
        ans_max = ans_min+all

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:


import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
##############################

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

ans_min = 0
ans_max = 0
colors = [0] * 8

def get_colors(num):
    if num <= 399:
        return 0
    elif num <= 799:
        return 1
    elif num <= 1199:
        return 2
    elif num <= 1599:
        return 3
    elif num <= 1999:
        return 4
    elif num <= 2399:
        return 5
    elif num <= 2799:
        return 6
    elif num <= 3199:
        return 7
    else:
        return -1

all = 0
for i in range(N):
    color = get_colors(A[i])
    if color == -1:
        all += 1
    else:
        colors[color] += 1

# all は「好きな色」に変えることができる！（レートの色以外でもいい）

x = colors.count(0)
# 自由選択できない
if all == 0:
    ans_min = 8-x
    ans_max = 8-x
else:
    if x == 8:
        # all しかない
        ans_min = 1
        anx_max = min(8, all)
    else:
        # 混合
        ans_min = 8-x
        ans_max = ans_min+all

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
##############################

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

ans_min = 0
ans_max = 0
colors = [0] * 8

def get_colors(num):
    if num <= 399:
        return 0
    elif num <= 799:
        return 1
    elif num <= 1199:
        return 2
    elif num <= 1599:
        return 3
    elif num <= 1999:
        return 4
    elif num <= 2399:
        return 5
    elif num <= 2799:
        return 6
    elif num <= 3199:
        return 7
    else:
        return -1

all = 0
for i in range(N):
    color = get_colors(A[i])
    if color == -1:
        all += 1
    else:
        colors[color] += 1

x = colors.count(0)
# 自由選択できない
if all == 0:
    ans_min = 8-x
    ans_max = 8-x
else:
    if x == 8:
        # all しかない
        ans_min = 1
        anx_max = min(8, all)
    else:
        # 混合
        ans_min = 8-x
        ans_max = min(8, ans_min+all)

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
##############################

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

ans_min = 0
ans_max = 0
colors = [0] * 8

def get_colors(num):
    if num <= 399:
        return 0
    elif num <= 799:
        return 1
    elif num <= 1199:
        return 2
    elif num <= 1599:
        return 3
    elif num <= 1999:
        return 4
    elif num <= 2399:
        return 5
    elif num <= 2799:
        return 6
    elif num <= 3199:
        return 7
    else:
        return -1

all = 0
for i in range(N):
    color = get_colors(A[i])
    if color == -1:
        all += 1
    else:
        colors[color] += 1

x = colors.count(0)
if x == 8:
    ans_min = 1
    ans_max = min(8, all)
else:
    ans_min = 8 - x
    ans_max = min(8, ans_min + all)



print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:


import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
##############################

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

ans_min = 0
ans_max = 0
colors = [0] * 8

def get_colors(num):
    if num <= 399:
        return 0
    elif num <= 799:
        return 1
    elif num <= 1199:
        return 2
    elif num <= 1599:
        return 3
    elif num <= 1999:
        return 4
    elif num <= 2399:
        return 5
    elif num <= 2799:
        return 6
    elif num <= 3199:
        return 7
    else:
        return -1

all = 0
for i in range(N):
    color = get_colors(A[i])
    if color == -1:
        all += 1
    else:
        colors[color] += 1

x = colors.count(0)
if x == 8:
    ans_min = 1
    all -= 1
else:
    ans_min = 8 - x

ans_max = min(8, ans_min + all)

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
##############################

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

ans_min = 0
ans_max = 0
colors = [0] * 8

def get_colors(num):
    if num <= 399:
        return 0
    elif num <= 799:
        return 1
    elif num <= 1199:
        return 2
    elif num <= 1599:
        return 3
    elif num <= 1999:
        return 4
    elif num <= 2399:
        return 5
    elif num <= 2799:
        return 6
    elif num <= 3199:
        return 7
    else:
        return -1

all = 0
for i in range(N):
    color = get_colors(A[i])
    if color == -1:
        all += 1
    else:
        colors[color] += 1

x = colors.count(0)
if x == 8:
    print(1, 1)
    exit()

ans_min = 8 - x

ans_max = min(8, ans_min + all)
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
##############################

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

ans_min = 0
ans_max = 0
colors = [0] * 8

def get_colors(num):
    if num <= 399:
        return 0
    elif num <= 799:
        return 1
    elif num <= 1199:
        return 2
    elif num <= 1599:
        return 3
    elif num <= 1999:
        return 4
    elif num <= 2399:
        return 5
    elif num <= 2799:
        return 6
    elif num <= 3199:
        return 7
    else:
        return -1

all = 0
for i in range(N):
    color = get_colors(A[i])
    if color == -1:
        all += 1
    else:
        colors[color] += 1

x = colors.count(0)
ans_min = 8 - x if x < 8 else 1

ans_max = min(8, ans_min + all)
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
##############################

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

ans_min = 0
ans_max = 0
colors = [0] * 8

def get_colors(num):
    if num <= 399:
        return 0
    elif num <= 799:
        return 1
    elif num <= 1199:
        return 2
    elif num <= 1599:
        return 3
    elif num <= 1999:
        return 4
    elif num <= 2399:
        return 5
    elif num <= 2799:
        return 6
    elif num <= 3199:
        return 7
    else:
        return -1

all = 0
for i in range(N):
    color = get_colors(A[i])
    if color == -1:
        all += 1
    else:
        colors[color] += 1

x = colors.count(0)
ans_min = 8 - x if x > 0 else 1

ans_max = min(8, ans_min + all)
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:


import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
##############################

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

ans_min = 0
ans_max = 0
colors = [0] * 8

def get_colors(num):
    if num <= 399:
        return 0
    elif num <= 799:
        return 1
    elif num <= 1199:
        return 2
    elif num <= 1599:
        return 3
    elif num <= 1999:
        return 4
    elif num <= 2399:
        return 5
    elif num <= 2799:
        return 6
    elif num <= 3199:
        return 7
    else:
        return -1

all = 0
for i in range(N):
    color = get_colors(A[i])
    if color == -1:
        all += 1
    else:
        colors[color] += 1

x = colors.count(0)
ans_min = 8 - x

ans_max = min(8, ans_min + all)
print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
c = []
w = []
for i in range(n):
  t = a[i]//400
  if t < 8 and t not in c:
    c.append(t)
  if t>=8:
    w.append(t)

print(len(c), len(c)+len(w))

Submission status: Wrong Answer

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

f=0
for i in a:
  if i//400<=7:
    b[i//400]=1
  else:
    f+=1    
    
sb=sum(b)
print(max(sb,1),min(sb+f,8))

Submission status: Wrong Answer

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

f=0
for i in a:
  if i//400<=7:
    b[i//400]=1
  else:
    f+=1    
    
sb=sum(b)
print(sb,min(sb+f,8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
C0 = [a//400 for a in A]
C1 = [c for c in C0 if c<=8]
C2 = [c for c in C0 if c>=9]
print(len(set(C1)),min(7,len(set(C1))+len(C2)))