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

colors = set()
above = 0

for score in a:
    if score < 400:
        colors.add("a")
    elif score < 800:
        colors.add("b")
    elif score < 1200:
        colors.add("c")
    elif score < 1600:
        colors.add("d")
    elif score < 2000:
        colors.add("e")
    elif score < 2400:
        colors.add("f")
    elif score < 2800:
        colors.add("g")
    elif score < 3200:
        colors.add("h")
    else:
        above += 1

x = len(colors)

if x == 8:
    print(x, x)
    exit()

if 8 - x >= above:
    print(x, x+above)
else:
    print(x, 8)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
a_list=list(map(int,input().split()))
rate=[False]*8
free=0
for i in a_list:
    if i<3200:
        rate[i//400]=True
    else:
        free+=1
count=0
for i in rate:
    if i:
        count+=1
if count==0:
    Min=1
else:
    Min=count
Max=min(count+free,8)
print(Min,Max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a_list=list(map(int,input().split()))
rate=[False]*8
free=0
for i in a_list:
    if i<3200:
        rate[i//400]=True
    else:
        free+=1
count=0
for i in rate:
    if i:
        count+=1
Max=min(count+free,8)
print(count,Max)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
a_list=list(map(int,input().split()))
rate=[False]*8
free=0
for i in a_list:
    if i<3200:
        rate[i//400]=True
    else:
        free+=1
count=0
for i in rate:
    if i:
        count+=1
Max=min(count+free,8)
print(count,Max)

Submission status: Wrong Answer

Solution code:
from collections import Counter
 
n = int(input())
a = [int(i) for i in input().split()]
c = Counter()
b = 0
for i in a:
    if i < 3200:
        c.update([i//400])
    else: b += 1
print(len(c) if len(c) else b, len(c) + b)

Submission status: Wrong Answer

Solution code:
import sys

n = int(sys.stdin.readline())
a_list = [int(x) for x in sys.stdin.readline().split()]

color_list = [0] * 8
rainbow = 0
for i in a_list:
    if int(i / 400) < 8:
        color_list[int(i / 400)] += 1
    else:
        rainbow += 1
color_list = [i for i in color_list if i != 0]
confirm = len(color_list)
if confirm == 0:
    print(1, min(8, rainbow))
else:
    print(confirm, min(confirm + rainbow, 8))

Submission status: Wrong Answer

Solution code:
import sys

n = int(sys.stdin.readline())
a_list = [int(x) for x in sys.stdin.readline().split()]

color_list = [0] * 8
rainbow = 0
for i in a_list:
    if 1 <= i <= 399:
        color_list[0] += 1
    elif 400 <= i <= 799:
        color_list[1] += 1
    elif 800 <= i <= 1199:
        color_list[2] += 1
    elif 1200 <= i <= 1599:
        color_list[3] += 1
    elif 1600 <= i <= 1999:
        color_list[4] += 1
    elif 2000 <= i <= 2399:
        color_list[5] += 1
    elif 2400 <= i <= 2799:
        color_list[6] += 1
    elif 2800 <= i <= 3199:
        color_list[7] += 1
    else:
        rainbow += 1
confirm = 8 - color_list.count(0)
if confirm == 0:
    print(1, min(8, rainbow))
else:
    print(confirm, min(confirm + rainbow, 8))

Submission status: Wrong Answer

Solution code:
import sys

n = int(sys.stdin.readline())
a_list = [int(x) for x in sys.stdin.readline().split()]

color_list = [0] * 8
rainbow = 0
for i in a_list:
    if 1 <= i <= 399:
        color_list[0] += 1
    elif 400 <= i <= 799:
        color_list[1] += 1
    elif 800 <= i <= 1199:
        color_list[2] += 1
    elif 1200 <= i <= 1599:
        color_list[3] += 1
    elif 1600 <= i <= 1999:
        color_list[4] += 1
    elif 2000 <= i <= 2399:
        color_list[5] += 1
    elif 2400 <= i <= 2799:
        color_list[6] += 1
    elif 2800 <= i <= 3199:
        color_list[7] += 1
    else:
        rainbow += 1
confirm = 8 - color_list.count(0)
if confirm == 0:
    if rainbow < 8:
        print(1, rainbow)
    else:
        print(1, 8)
else:
    if confirm + rainbow < 8:
        print(confirm, confirm + rainbow)
    else:
        print(confirm, 8)

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
ch_cnt = 0
b = []
for i in range(n):
    if a[i] >= 3200:
        ch_cnt += 1
        b.append('special')
    elif a[i] < 3200 and a[i] >= 2800:
        b.append('red')
    elif a[i] < 2800 and a[i] >= 2400:
        b.append('orange')
    elif a[i] < 2400 and a[i] >= 2000:
        b.append('yellow')
    elif a[i] < 2000 and a[i] >= 1600:
        b.append('blue')
    elif a[i] < 1600 and a[i] >= 1200:
        b.append('cyan')
    elif a[i] < 1200 and a[i] >= 800:
        b.append('green')
    elif a[i] < 800 and a[i] > 400:
        b.append('brown')
    else:
        b.append('gray')
b_cnt = Counter(b)
spe_cnt = 0
if b_cnt['special']:
    spe_cnt += b_cnt['special']
    print(len(b_cnt)-1, len(b_cnt)-1+spe_cnt)
else:
    print(len(b_cnt), len(b_cnt))

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
a = [int(i) for i in input().split()]
c = Counter()
b = 0
for i in a:
    if i < 3200:
        c.update([i//400])
    else: b += 1
print(len(c), len(c) + b)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
C=[]
r=0
cnt=0
for a in A:
    aa=a//400
    if aa in C:pass
    else:
        C.append(aa)
        cnt+=1
    if aa>=8:r+=1
if r==0:print(cnt,cnt)
else:print(max(1,cnt-1),cnt+r-1)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
C=[]
r=0
cnt=0
for a in A:
    aa=a//400
    if aa in C:pass
    else:
        C.append(aa)
        cnt+=1
    if aa>=8:r+=1
if r==0:print(cnt,cnt)
else:print(max(1,cnt-1),min(8,cnt+r-1))

Submission status: Wrong Answer

Solution code:
n=int(input())
L=list(map(int,input().split()))
L.sort()
tmp=0
cnt=0
min_c=0
max_c=0

for i in range(n):
	if L[i] <= 399:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] >= 400 and L[i] <= 799:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] >= 800 and L[i] <= 1199:
		cnt+=1
		tmp=i
		break
		
for i in range(tmp,n):
	if L[i] >= 1200 and L[i] <= 1599:
		cnt+=1
		tmp=i
		break
		
for i in range(tmp,n):
	if L[i] >= 1600 and L[i] <= 1999:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] >= 2000 and L[i] <= 2399:
		cnt+=1
		tmp=i
		break
		
for i in range(tmp,n):
	if L[i] >= 2400 and L[i] <= 2799:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] >= 2800 and L[i] <= 3199:
		cnt+=1
		tmp=i
		break
		
min_c=cnt
max_c=cnt

for i in range(tmp,n):
	if L[i] >= 3200:
		max_c=cnt+len(L[i:])
		if min_c==0:
			min_c+=1
		break
		
print(min_c,min(8,max_c))

Submission status: Wrong Answer

Solution code:
from copy import *
from sys import *
import math
import queue
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)


def main():
	n = int(input())
	a = list(map(int,input().split()))
	color = [0 for i in range(8)]
	free = 0
	for i in a:
		if(i//400>7):
			free+=1
		else:
			color[i//400] = 1
	print(str(max(1,sum(color)))+' '+str(min(8,sum(color)+free)))


def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(m,n):
	x = max(m,n)
	y = min(m,n)
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	return y

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()

Submission status: Wrong Answer

Solution code:
from copy import *
from sys import *
import math
import queue
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)


def main():
	n = int(input())
	a = list(map(int,input().split()))
	color = [0 for i in range(8)]
	free = 0
	for i in a:
		if(i//400>7):
			free+=1
		else:
			color[i//400] = 1
	print(str(sum(color))+' '+str(min(8,sum(color)+free)))


def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(m,n):
	x = max(m,n)
	y = min(m,n)
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	return y

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()

Submission status: Wrong Answer

Solution code:
from copy import *
from sys import *
import math
import queue
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)


def main():
	n = int(input())
	a = list(map(int,input().split()))
	color = [0 for i in range(8)]
	free = 0
	for i in a:
		if(i//400 > 7):
			free+=1
		else:
			color[i//400]=1
	min_s = sum(color)
	max_s = min([8,sum(color)+free])
	print(str(min_s) + ' ' + str(max_s))


def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(m,n):
	x = max(m,n)
	y = min(m,n)
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	return y

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()

Submission status: Wrong Answer

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

colors = set()
free_num = 0
for rate in a:
    if rate < 400:
        colors.add("grey")
    elif rate < 800:
        colors.add("brown")
    elif rate < 1200:
        colors.add("green")
    elif rate < 1600:
        colors.add("sky")
    elif rate < 2000:
        colors.add("blue")
    elif rate < 2400:
        colors.add("yellow")
    elif rate < 2800:
        colors.add("orange")
    elif rate < 3200:
        colors.add("red")
    else:
        free_num += 1
        
print(len(colors), free_num + len(colors))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = sorted([int(i)//400 for i in input().split()])
k = 0
for i in range(1,6):
    k += a.count(i+7)
minn = len(set(a))-(1 if k else 0)
ans = []
ans.append(minn)
if k >= 1:
    maxn = minn+k
else:
    maxn = minn
ans.append(maxn)
print(*ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = sorted([int(i)//400 for i in input().split()])
k = a.count(8)
minn = len(set(a))
ans = []
ans.append(minn)
if k >= 1:
    maxn = minn - 1 + k
else:
    maxn = minn
ans.append(maxn)
print(*ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    _, b, c = LS()
    x = int(b[0] + c[0]) % 4
    if not x:
        print("YES")
    else:
        print("NO")
    return

#B
def B():
    II()
    a = LI()
    a.sort()
    print(a[-1]-a[0])
    return

#C
def C():
    II()
    a = LI()
    a = list(map(lambda x: x // 400, a))
    d = defaultdict(int)
    for ai in a:
        d[ai] += 1
    ans1 = 0
    ans2 = 0
    for key, value in d.items():
        if key <= 7:
            ans1 += 1
            ans2 += 1
        else:
            ans2 += value
    if ans1 == 0:
        ans1 = 1
    print(ans1, min(ans2, 8))
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    C()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    _, b, c = LS()
    x = int(b[0] + c[0]) % 4
    if not x:
        print("YES")
    else:
        print("NO")
    return

#B
def B():
    II()
    a = LI()
    a.sort()
    print(a[-1]-a[0])
    return

#C
def C():
    II()
    a = LI()
    a = list(map(lambda x: x // 400, a))
    d = defaultdict(int)
    for ai in a:
        d[ai] += 1
    ans1 = 0
    ans2 = 0
    for key, value in d.items():
        if key <= 7:
            ans1 += 1
            ans2 += 1
        else:
            ans2 += value
    print(ans1, min(ans2, 8))
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    C()

Submission status: Wrong Answer

Solution code:
n=int(input())
L=list(map(int,input().split()))
L.sort()
tmp=0
cnt=0
min_c=0
max_c=0

for i in range(n):
	if L[i] <= 399:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] > 399 and L[i] <= 799:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] > 799 and L[i] <= 1199:
		cnt+=1
		tmp=i
		break
		
for i in range(tmp,n):
	if L[i] > 1199 and L[i] <= 1599:
		cnt+=1
		tmp=i
		break
		
for i in range(tmp,n):
	if L[i] > 1599 and L[i] <= 1999:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] > 1999 and L[i] <= 2399:
		cnt+=1
		tmp=i
		break
		
for i in range(tmp,n):
	if L[i] > 2399 and L[i] <= 2799:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] > 2799 and L[i] <= 3199:
		cnt+=1
		tmp=i
		break
		
min_c=cnt
max_c=cnt

for i in range(tmp,n):
	if L[i] >= 3200:
		max_c=cnt+len(L[i:])
		if min_c==0:
			min_c+=1
		break
		
print(min_c)
print(min(8,max_c))

Submission status: Wrong Answer

Solution code:
n=int(input())
L=list(map(int,input().split()))
L.sort()
tmp=0
cnt=0
min_c=0
max_c=0

for i in range(n):
	if L[i] <= 399:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] > 399 and L[i] <= 799:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] > 799 and L[i] <= 1199:
		cnt+=1
		tmp=i
		break
		
for i in range(tmp,n):
	if L[i] > 1199 and L[i] <= 1599:
		cnt+=1
		tmp=i
		break
		
for i in range(tmp,n):
	if L[i] > 1599 and L[i] <= 1999:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] > 1999 and L[i] <= 2399:
		cnt+=1
		tmp=i
		break
		
for i in range(tmp,n):
	if L[i] > 2399 and L[i] <= 2799:
		cnt+=1
		tmp=i
		break

for i in range(tmp,n):
	if L[i] > 2799 and L[i] <= 3199:
		cnt+=1
		tmp=i
		break
		
min_c=cnt
max_c=cnt

for i in range(tmp,n):
	if L[i] >= 3200:
		max_c=cnt+len(L[i:])
		min_c+=1
		break
		
print(min_c)
print(min(8,max_c))

Submission status: Wrong Answer

Solution code:
a = int(input())
b = list(map(int, input().split()))
c = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0}
d = 0
for i in b:
    if 1 <= i <= 399:
        c[0] += 1
    elif 400 <= i <= 799:
        c[1] += 1
    elif 800 <= i <= 1199:
        c[2] += 1
    elif 1200 <= i <= 1599:
        c[3] += 1
    elif 1600 <= i <= 1999:
        c[4] += 1
    elif 2000 <= i <= 2399:
        c[5] += 1
    elif 2400 <= i <= 2799:
        c[6] += 1
    elif 2800 <= i <= 3199:
        c[7] += 1
    else:
        d += 1
e = 0
for k, v in c.items():
    if v != 0:
        e += 1
print(str(max(e, 1 if d > 0 else 0)) + " " + str(min(e + d, 8)))

Submission status: Wrong Answer

Solution code:
a = int(input())
b = list(map(int, input().split()))
c = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0}
d = 0
for i in b:
    if 1 <= i <= 399:
        c[0] += 1
    elif 400 <= i <= 799:
        c[1] += 1
    elif 800 <= i <= 1199:
        c[2] += 1
    elif 1200 <= i <= 1599:
        c[3] += 1
    elif 1600 <= i <= 1999:
        c[4] += 1
    elif 2000 <= i <= 2399:
        c[5] += 1
    elif 2400 <= i <= 2799:
        c[6] += 1
    elif 2800 <= i <= 3199:
        c[7] += 1
    else:
        d += 1
e = 0
for k, v in c.items():
    if v != 0:
        e += 1
print(str(max(e, 1)) + " " + str(min(e + d, 8)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort()
c = []
count = 0
for i in range(n):
    if a[i] < 400:
        c.append(1)
    elif a[i] >= 400 and a[i] < 800:
        c.append(2)
    elif a[i] >= 800 and a[i] < 1200:
        c.append(3)
    elif a[i] >= 1200 and a[i] < 1600:
        c.append(4)
    elif a[i] >= 1600 and a[i] < 2000:
        c.append(5)
    elif a[i] >= 2000 and a[i] < 2400:
        c.append(6)
    elif a[i] >= 2400 and a[i] < 2800:
        c.append(7)
    elif a[i] >= 2800 and a[i] < 3200:
        c.append(8)
    else:
        count = count + n - i
        break
cl = set(c)
print(len(cl),len(cl)+count)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
ans,k = [0]*7,0
for a in A:
    if a>=3200: k+=1
    elif a>=2800: ans[6] = 1
    elif a>=2400: ans[5] = 1
    elif a>=2000: ans[4] = 1
    elif a>=1600: ans[3] = 1
    elif a>=1200: ans[2] = 1
    elif a>=800 : ans[1] = 1
    elif a>=400 : ans[0] = 1
print(max(sum(ans),1),sum(ans)+k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

def main():
    N = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 9 # 8色 + 任意の1色
    for rate in a:
        colors[min(rate // 400, 8)] += 1

    used = 0
    for c in colors[0:8]:
        if c != 0:
            used += 1

    mn = max(used, 1)
    mx = used + min(8 - used, colors[8])
    print(mn, mx)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

def main():
    N = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 9 # 8色 + 任意の1色
    for rate in a:
        colors[min(rate // 400, 8)] += 1

    mn = 0
    for c in colors[0:8]:
        if c != 0:
            mn += 1

    mx = mn + min(8 - mn, colors[8])
    print(mn, mx)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
rate = [399+(400)*i for i in range(8)]
rate = rate + [4801]
len_ = len(rate)
count = [0] * len_
for i in range(N):
    for j in range(len_):
        if a[i] <= rate[j]:
            count[j] += 1
            break
colors = 0
for i in range(len_-1):
    if count[i] > 0:
        colors += 1
print(colors, colors+count[-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
rate = [399+(400)*i for i in range(8)]
rate = rate + [4801]
len_ = len(rate)
count = [0] * len_
for i in range(N):
    for j in range(len_):
        if a[i] <= rate[j]:
            count[j] += 1
            break
colors = 0
for i in range(len_-1):
    if count[i] > 0:
        colors += 1
print(colors, min(8, colors+count[-1]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = [0] * 9
for i in range(n):
    for j in range(9):
        if 400 * j <= a[i] <= 400 * (j + 1) - 1 and j != 8:
            b[j] += 1
        elif j == 8 and a[i] >= 400 * j:
            b[j] += 1
m = 0
M = 0
for i in range(8):
    if b[i] != 0:
        m += 1
        M += 1
M += b[8]
if M > 8:
    M = 8
if m == 0:
    m = 1
print(m, M)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = [0] * 9
for i in range(n):
    for j in range(9):
        if 400 * j <= a[i] <= 400 * (j + 1) - 1 and j != 8:
            b[j] += 1
        elif j == 8 and a[i] >= 400 * j:
            b[j] += 1
m = 0
M = 0
for i in range(8):
    if b[i] != 0:
        m += 1
        M += 1
M += b[8]
if M > 8:
    M = 8
if m == 0 and b[8] !=0:
    m == 1
print(m, M)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = [0] * 9
for i in range(n):
    for j in range(9):
        if 400 * j <= a[i] < 400 * (j + 1) - 1 and j != 8:
            b[j] += 1
        elif j == 8 and a[i] >= 400 * j:
            b[j] += 1
m = 0
M = 0
for i in range(8):
    if b[i] != 0:
        m += 1
        M += 1
M += b[8]
if M > 8:
    M = 8
if m == 0 and b[8] !=0:
    m == 1
print(m, M)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = [0] * 9
for i in range(n):
    for j in range(9):
        if 400 * j <= a[i] < 400 * (j + 1) - 1 and j != 8:
            b[j] += 1
        elif j == 8 and a[i] >= 400 * j:
            b[j] += 1
m = 0
M = 0
for i in range(8):
    if b[i] != 0:
        m += 1
        M += 1
M += b[8]
if M > 8:
    M = 8
if m == 0 and b[8] !=0:
    m == 1
print(b)
print(m, M)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
#ABC66 C

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

color = [False]*8
ans = 0
change = 0
for i in a:
    if 1 <= i <= 399 and not color[0]:
        color[0] = True
        ans += 1
    elif 400 <= i <= 799 and not color[1]:
        color[1] = True
        ans += 1
    elif 800 <= i <= 1199 and not color[2]:
        color[2] = True
        ans += 1
    elif 1200 <= i <= 1599 and not color[3]:
        color[3] = True
        ans += 1
    elif 1600 <= i <= 1999 and not color[4]:
        color[4] = True
        ans += 1
    elif 2000 <= i <= 2399 and not color[5]:
        color[5] = True
        ans += 1
    elif 2400 <= i <= 2799 and not color[6]:
        color[6] = True
        ans += 1
    elif 2800 <= i <= 3199 and not color[7]:
        color[7] = True
        ans += 1
    elif 3200 <= i:
        change += 1

print(ans,ans + change)

Submission status: Wrong Answer

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

def main(N, A):
    st = 0
    check = [0]*8
    for i in range(N):
        if(1<=A[i]<=399):
            check[0] = 1
        elif(400<=A[i]<=799):
            check[1] = 1
        elif(800<=A[i]<=1199):
            check[2] = 1
        elif(1200<=A[i]<=1599):
            check[3] = 1
        elif(1600<=A[i]<=1999):
            check[4] = 1
        elif(2000<=A[i]<=2399):
            check[5] = 1
        elif(2400<=A[i]<=2799):
            check[6] = 1
        elif(2800<=A[i]<=3199):
            check[7] = 1
        else:
            st += 1
            
    cnt = check.count(1)
    print(max(1, cnt), min(8, cnt+st))
    
if __name__ == '__main__':
    N = int(input())
    A = [int(a) for a in input().split()]
    
    main(N, A)

Submission status: Wrong Answer

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

def main(N, A):
    st = 0
    check = [0]*8
    for i in range(N):
        if(1<=A[i]<=399):
            check[0] = 1
        elif(400<=A[i]<=799):
            check[1] = 1
        elif(800<=A[i]<=1199):
            check[2] = 1
        elif(1200<=A[i]<=1599):
            check[3] = 1
        elif(1600<=A[i]<=1999):
            check[4] = 1
        elif(2000<=A[i]<=2399):
            check[5] = 1
        elif(2400<=A[i]<=2799):
            check[6] = 1
        elif(2800<=A[i]<=3199):
            check[7] = 1
        else:
            st += 1
    cnt = check.count(1)
    if(cnt==0):
        cnt = 1
    print(cnt, min(8, cnt+st))
    
if __name__ == '__main__':
    N = int(input())
    A = [int(a) for a in input().split()]
    
    main(N, A)

Submission status: Wrong Answer

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

def main(N, A):
    st = 0
    check = [0]*8
    for i in range(N):
        if(1<=A[i]<=399):
            check[0] = 1
        elif(400<=A[i]<=799):
            check[1] = 1
        elif(800<=A[i]<=1199):
            check[2] = 1
        elif(1200<=A[i]<=1599):
            check[3] = 1
        elif(1600<=A[i]<=1999):
            check[4] = 1
        elif(2000<=A[i]<=2399):
            check[5] = 1
        elif(2400<=A[i]<=2799):
            check[6] = 1
        elif(2800<=A[i]<=3199):
            check[7] = 1
        else:
            st += 1
    cnt = check.count(1)
    print(cnt, min(8, cnt+st))
    
if __name__ == '__main__':
    N = int(input())
    A = [int(a) for a in input().split()]
    
    main(N, A)

Submission status: Wrong Answer

Solution code:
from collections import Counter
N=int(input())
a=Counter(list(map(lambda x:int(x)//400,input().split())))
d=a.keys()
if {8,9,10,11,12}&set(a.keys()):
    b=len(set(d)-{8,9,10,11,12})
    c=sum([a[i] for i in range(8,13)])
    print(max(b,1),min(b+c,8))
else:
    print(len(d),len(d))