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: Runtime Error

Solution code:
N = int(input())

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

lst = [0] * 9

for i in range(N):
    lst[min(a[i]//400, 8)] += 1

count = lst[:8].count(0)

kind_max = min(8-count+lst[8])
kind_min = max(8-count,1)

print (kind_min, kind_max)

Submission status: Runtime Error

Solution code:
N = int(input())


c = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]

i = 0
cnt = 0
ansOne = 0
ansAny = 0
for ai in sorted(map(int, input())):
  while i < len(c):
    if ai <= c[i]:
      cnt += 1
      break
    elif cnt > 0:
      ansOne += 1
      cnt = 0
    
  else:
    ansAny += 1
    continue

print("{} {}".format(max(ansOne, 1), min(len(c), ansOne + ansAny))

Submission status: Runtime Error

Solution code:
n = int(input())

colors = list(map(int,input().split()))

col_n = [0]*9

for c in colors:
    if c >= 1 and c <= 399:
        col_n[0] += 1
    elif c >= 400 and c <= 799:
        col_n[1] += 1
    elif c >= 800 and c <= 1199:
        col_n[2] += 1
    elif c >= 1200 and c <= 1599:
        col_n[3] += 1
    elif c >= 1600 and c <= 1999:
        col_n[4] += 1
    elif c >= 2000 and c <= 2399:
        col_n[5] += 1
    elif c >= 2400 and c <= 2799:
        col_n[6] += 1
    elif c >= 2800 and c <= 3199:
        col_n[7] += 1
    else:
        col_n[8] += 1

if col_n[8] == 0:
    print(8-col_n[:8].count(0),8-col_n[:8].count(0))

else:
    if 8-col_n[:8].count(0) >= col_n[8]:
        print(8-col_n[:8].count(0),(8-col_n[:8].count(0)+col_n[8]))
    
    else:
        print(col[8],(8-col_n[:8].count(0))+col_n[8])

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
flag = [False for _ in range(8)]
flex = 0
for x in a:
    if x >= 3200:
        flex += 1
    else:
        flag[int(x/400)] = True
les = flag.count(True)
if les == 0 and flex > 0:
    print("1 " + flex)
else:
    print("{} {}".format(les, les+flex))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
flag = [False for _ in range(8)]
flex = 0
for x in a:
    if x >= 3200:
        flex += 1
    else:
        flag[int(x/400)] = True
les = flag.count(True)
print(f"{les} {min([8,les+flex])}")

Submission status: Runtime Error

Solution code:
n = int(input())

scores = list(map(int, input().split()))

colors = [0] * 8
over = 0

for score in scores:
    if score < 3200:
        colors[score // 400] += 1
    else:
        over += 1

ans = sum(colors > 0 for color in colors)

print(ans, ans + over)

Submission status: Runtime Error

Solution code:
n = int(input())
scores = list(map(int, input().split()))
colors = [0] * 9

for score in scores:
    colors[score // 400] += 1

ans = sum(colors[x] > 0 for x in range(8))
print(ans, ans + colors[8])

Submission status: Runtime Error

Solution code:
n = int(input())

scores = list(map(int, input().split()))

colors = [0] * 9

for score in scores:
    colors[score // 400] += 1

ans = sum(colors[x] > 0 for x in range(8))\

print(ans, min(8, ans + colors[8]))

Submission status: Runtime Error

Solution code:
import bisect

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

A.sort()

rank = [0, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 3200, 3200, 3200, 3200, 3200]
n_rank = []
for i in range(1,len(rank)):
  var = bisect.bisect_left(A, rank[i]) - bisect.bisect_left(A, rank[i-1])
  n_rank.append(var)
else:
  n_rank.append(len(A) - bisect.bisect_left(A, rank[-1]))
  
n_color = sum(n_rank[i] != 0 for i in range(len(n_rank)-1))

min_color = max(n_color, 1)
max_color = min(n_color + n_rank[-1])

print(str(min_color) +' '+ str(max_color))

Submission status: Runtime Error

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

a.sort()

min_color = [0] * 8
max_color = [0] * 8
extra = 0

for i in a:
    if i >= 3200:
        if sum(min_color) == 0:
            min_color[0] = 1
        if sum(max_color + extra) < 8:
            extra += 1
    else:
        min_color[i // 400] = 1
        max_color[i // 400] = 1


print( sum(min_color), sum(max_color) + extra)

Submission status: Runtime Error

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

 colors = [0,0,0,0,0,0,0,0,0]

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

 ans = 0
 for i in range(len(colors)-1):
   if colors[i] !=0:
     ans +=1

 print(str(ans) + " " + str(colors[8] + ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

def determine_color(rate):
    if rate >= 1 and rate <= 399:
        return 0
    elif rate >= 400 and rate <= 799:
        return 1
    elif rate >= 800 and rate <= 1199:
        return 2
    elif rate >= 1200 and rate <= 1599:
        return 3
    elif rate >= 1600 and rate <= 1999:
        return 4
    elif rate >= 2000 and rate <= 2399:
        return 5
    elif rate >= 2400 and rate <= 2799:
        return 6
    elif rate >= 2800 and rate <= 3199:
        return 7
    else:
        return 8


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

    """方針
    色が8のとき、何色にもなれる。

    先に0~7の色を埋める(Trueにして)。これが最小の数。
    
    その後、色が8の数だけ他の色を埋めていく。それが最大の数。

    """
    min_colors = [False] * 8
    max_colors = [False] * 8
    color8_cnt = 0
    for i, a in enumerate(A):
        color = determine_color(a)
        if color == 8:
            color8_cnt += 1
            continue
        min_colors[color] = True
        max_colors[color] = True

    k = 0
    for i in range(color8_cnt):
        if k == len(max_colors)-1:
            break

        for j in range(k, len(max_colors)):
            k = j
            if not max_colors[j]:
                max_colors[j] = True
                break
    
    min_ans = 0
    for i, c in enumerate(min_colors):
        if c:
            min_ans += 1

    max_ans = 0
    for i, c in enumerate(max_colors):
        if c:
            max_ans += 1

    print(f"{min_ans} {max_ans}")



if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
N = int(input())
lst_a = list(map(int, input().split()))
lst_color = [0] * 8
cnt_super = 0


for a in lst_a:
    i = a // 400
    if i == 8:
        cnt_super += 1
    else:
        lst_color[i] = 1
cnt_existed = sum(1 for x in lst_color if x!=0)


ans_min = max(cnt_existed, 1)
ans_max = cnt_existed + cnt_super


print(ans_min, ans_max)

Submission status: Runtime Error

Solution code:
N = int(input())
lst_a = list(map(int, input().split()))
lst_color = [0] * 8
cnt_super = 0


for a in lst_a:
    i = int(a / 400)
    if i == 8:
        cnt_super += 1
    else:
        lst_color[i] += 1
cnt_existed = sum(1 for x in lst_color if x!=0)


ans_min = max(cnt_existed, 1)
ans_max = cnt_existed + cnt_super


print(ans_min, ans_max)

Submission status: Runtime Error

Solution code:
N = int(input())
lst_a = list(map(int, input().split()))
lst_color = [0] * 8
cnt_super = 0


for a in lst_a:
    i = a // 400
    if i == 8:
        cnt_super += 1
    else:
        lst_color[i] += 1
cnt_existed = sum(1 for x in lst_color if x!=0)


ans_min = max(cnt_existed, 1)
ans_max = cnt_existed + cnt_super


print(ans_min, ans_max)

Submission status: Runtime Error

Solution code:
def color(r):
  if r<3200:return r//400
  else:return 8
colors = [0]*9
N=int(input())
for a in map(int,input().split()):
  colors[color(a)]+=1
base=0
for i n range(8):
  if colors[i]>0:base+=1
print(base, base+colors[8])

Submission status: Runtime Error

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

rate = [0 for i in range(9)]

c = 0
for i in range(N):
    m = a[i] // 400
    if m < 8:
        rate[m] = 1
    else:
        rate[8] += 1

for i in range(8):
    if rate[i] > 0:
        c += 1
c = 8 - c

if c < rate[8]:
    print(sum(rate[:8]), sum(rate[:8] + c))
else:
    print(sum(rate[:8]), sum(rate))

Submission status: Runtime Error

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

rate = [0 for i in range(9)]

c = 0
for i in range(N):
    m = a[i] // 400
    if m != 8:
        rate[m] = 1
    else:
        rate[m] += 1

for i in range(8):
    if rate[i] > 0:
        c += 1
c = 8 - c

if c < rate[8]:
    print(sum(rate[:8]), sum(rate[:8] + c))
else:
    print(sum(rate[:8]), sum(rate))

Submission status: Runtime Error

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

rate = [0 for i in range(9)]

for i in range(N):
    m = a[i] // 400
    rate[m] += 1

flag = False

for i in range(8):
    if rate[i] == 0:
        flag = True
    else:
        rate[i] = 1

if flag:
    print(sum(rate[:8]), sum(rate))
else:
    print(sum(rate[:8]), sum(rate[:8]))

Submission status: Runtime Error

Solution code:
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		boolean[] color = new boolean[8];
		int topcoder = 0;
		int ans = 0;
		for(int i = 0; i < N; i++) {
			int rate = sc.nextInt();
			for(int j = 1; j <= 8; j++) {
				if(rate < j*400) {
					color[j-1] = true;
					break;
				}
			}
			if(rate >= 3200)
				topcoder += 1;
		}
		for(int i = 0; i < 8; i++) {
			if(color[i])
				ans ++;
		}
		System.out.println(ans + " " + (ans+topcoder));
	}

}

Submission status: Runtime Error

Solution code:
n=input()
l=list(map(int,input().split()))
c=[0]*9
for i in l:c[i//400]+=1
mi=0
for i in range(8):
    if c[i]>0:mi+=1
print(max(mi,1),mi+c[8])

Submission status: Runtime Error

Solution code:
N=int(input())
a=[int(i) for i in input().split()]
rates=[0]*9
for rate in a:
    rates[rate//400]+=1
ans=0
for color in rates[:8]:
    ans+=(color!=0)
ansmax=ans+rates[8]
print(ans,ansmax)

Submission status: Runtime Error

Solution code:
N=int(input())
a=[int(i) for i in input().split()]
rates=[0]*9
for rate in a:
    rates[rate//400]+=1
ans=0
for color in rates[:8]:
    ans+=bool(color)
ansmax=ans+rates[8]
print(ans,ansmax)

Submission status: Runtime Error

Solution code:
#13:27
N = int(input())
A = list(map(int,input().split()))
ex_red = [0]*8
red_cnt = 0

for i in range(8):#0-7
    for j in range(N):
        if 400*i<=A[j] and A[j]<400*(i+1):
            ex_red[i]+=1
n = 0
for i in range(N):
    if 3200 <= A[i]:
        n += 1
not_red_color = 0
c = 0
for i in range(8):
    if ex_red[i] > 0:
        c += 1
#print(c)#soreigai_count
#print(n)#red_count

max_ans = min(n + c)

#min_ans
if c >= 1:
    min_ans = c
elif c == 0:
    min_ans = 1
print(min_ans, max_ans)

Submission status: Runtime Error

Solution code:
#13:27
N = int(input())
A = list(map(int,input().split()))
ex_red = [0]*8
red_cnt = 0

for i in range(8):#0-7
    for j in range(N):
        if 400*i<=A[j] and A[j]<400*(i+1):
            ex_red[i]+=1

for i in range(N):
    if 3200 <= A[i]:
        red_cnt += 1
not_red_color = 0
for i in range(8):
    if ex_red[i] > 0:
        not_red_color += 1
    
zero_num = 8 - not_red_color

if red_cnt<=1:
    ans = red_cnt + not_red_color
else:#red_cnt more than 2
    assign = red_cnt - 1
    if zero_num >= assign:
        ans = assign + not_red_color + 1
    else:
        ans = zero_num + not_red_colot + 1

#if red_cnt != 0:
min_ans = not_red_color

# if zero_num >= red_cnt:
#     ans = red_cnt + not_red_color
# else:
#     ans = zero_num + not_red_color

print(min_ans, ans)

Submission status: Runtime Error

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

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

color = [0,0,0,0,0,0,0,0,0]

for i in range(n):
    if 1 <= a[i] <= 399:
        color[0] += 1
    elif 400 <= a[i] <= 799:
        color[1] += 1
    elif 800 <= a[i] <= 1199:
        color[2] += 1
    elif 1200 <= a[i] <= 1599:
        color[3] += 1
    elif 1600 <= a[i] <= 1999:
        color[4] += 1
    elif 2000 <= a[i] <= 2399:
        color[5] += 1
    elif 2400 <= a[i] <= 2799:
        color[6] += 1
    elif 2800 <= a[i] <= 3199:
        color[7] += 1
    elif 3200 <= a[i]:
        color[8] += 1


min_col = color[:]
min_cnt = 0
del min_col[-1]
for i in range(len(min_col)):
    if min_col[i] != 0:
        min_cnt += 1

max_cnt = min(min_cnt + color[8])
min_cnt = max(1,min_cnt)

print(min_cnt, max_cnt)

Submission status: Runtime Error

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

late = [0 for i in range(9)]

for n in a:
    late[n//400] += 1

max_a = min_a = 8-late[:-1].count(0)
if late[8] and not min_a:
    min_a = 1

if late[8]:
    max_a = min(max_a+late[8], 8)

print(min_a, max_a)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
color = [0]*8
for i in a:
  color[min(8,i//400)] += 1
kind = 0
for i in color[:7]:
  if i:
    kind += 1
if kind == 0 and color[7]:
  color[7] -= 1
  kind += 1
print(kind,kind+color[7])

Submission status: Runtime Error

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

colors = [0]*9

for rate in rates:
    colors[rate // 400] += 1

zeros = colors[0:8].count(0)
nonzeros = 8 - zeros

M = nonzeros + colors[8]

if nonzeros == 0:
    m = 1
else:
    m = nonzeros

print(m, M)

Submission status: Runtime Error

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

colors = [0]*9

for rate in rates:
    colors[rate // 400] += 1

if colors[0:8] == [0] * 8:
    print(1, min(colors[8], 8))
else:
    zeros = colors[0:8].count(0)
    print(8-zeros, 8-zeros+min(zeros, colors[8]))

Submission status: Runtime Error

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

#配列と範囲の条件をもとに、
#条件を満たすものの個数と、満たさないもののリストを返す。
def Count(A,max):
  if len(A)==0:
    A_next = A
    
  elif len(A)==1:
    if A<=max:
      A_next = []
    else:
      A_next = A
      
  else:
  	A_next = [y for y in A if not(y<=max)]
  
  num = 0
  if (len(A) -len(A_next))>0:
    num = 1
  return num, len(A_next)

max = 399
num_list = []
for max_add in range(8):
  max += (max_add)*400
  num, A= Count(A,max)
  num_list.append(num)
  
min_num = sum(num_list)
max_num = min(8, min_num+len(A))

print(min_num, max_num)

Submission status: Runtime Error

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

counts = [0]*9

for i in A:
    counts[int(i/400)] += 1

#print(counts)

v = 8 - counts[:-1].count(0)

if counts[-1] == 0:
    print(v,v)
else:
    if v == 0:
        print(1,counts[-1])
    else :
        print(v,v+counts[-1])

Submission status: Runtime Error

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

counts = [0]*9

for i in A:
    counts[int(i/400)] += 1

#print(counts)

v = 8 - counts[:-1].count(0)

if counts[-1] == 0:
    print(v,v)
else:
    if v == 0:
        print(1,counts[-1])
    else :
        print(v,v+counts[-1])

Submission status: Runtime Error

Solution code:
n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400 if x<3200 else 8,A))
n_red=A.count(8)
red_exist=1 if len(n_red) else 0
red_only=1 if red_exist and list(set(A))[0]==8 else 0
n_min=len(set(A)) if not red_exist else len(set(A))-1
print(1 if red_only else n_min,n_min+n_red)

Submission status: Runtime Error

Solution code:
#include <stdio.h>

int max(int a,int b){
  if(a > b){
    return a;
  }
  return b;
}

int main(void){
  int N,a;
  int counter = 0;
  int ans = 0;
  int flag[9] = {0,0,0,0,0,0,0,0,0};
  scanf("%d",&N);

  for(int i = 0;i < N;i++){
    scanf("%d",&a);
    if(a < 400) flag[0] = 1;
    else if(a < 800) flag[1] = 1;
    else if(a < 1200) flag[2] = 1;
    else if(a < 1600) flag[3] = 1;
    else if(a < 2000) flag[4] = 1;
    else if(a < 2400) flag[5] = 1;
    else if(a < 2800) flag[6] = 1;
    else if(a < 3200) flag[7] = 1;
    else flag[8]++;
  }


  for(int i = 0;i < 8;i++){
    if(flag[i]) counter++;
  }
  printf("%d ",max(1,counter));
  counter += flag[8];
  if(counter > 8) counter = 8;
  printf("%d\n",counter);
  return 0;
}

Submission status: Runtime Error

Solution code:
n = int(input())
A = list(map(int,input().split()))
color = []
cnt = 0

for i in range(n):
    c = A[i]//400
    if c<=7:
        color.append(c)
    else:
        cnt += 1

diff = set(color)
minimum = max(len(diff),1)
maximum = min(len(diff)+cnt)

print(minimum, maximum)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<string> vstr;
typedef pair<ll, ll> pll;
typedef vector<pll> vp;
typedef map<ll, ll> mll;
typedef map<string, ll> mstrll;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fir first
#define sec second
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep,)(__VA_ARGS__)
#define each(i, n) for(auto&& i: n)
#define out(x) cout << (x)
#define print(x) cout << (x) << '\n'
#define debug(x) cerr << #x << ": " << (x) << '\n'
ll gcd(ll a, ll b){return b != 0 ? gcd(b, a % b) : a;}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}
const ll INF = 1e16;
const ll MOD = 1e9 + 7;
ll a, b, c, n, m, x, y, z, w, h, ans, cnt, mx, mn;
string s, t;
vll dx = {-1, 0, 1, 0}, dy = {0, -1, 0, 1};
//vll dx = {-1, 0, 1, -1, 1, -1, 0, 1}, dy = {-1, -1, -1, 0, 0, 1, 1, 1};

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> n){
        ll v[9] = {};
        rep(i, n){
            cin >> a;
            v[a / 400]++;
        }
        ans = 0;
        rep(i, 8){
            if(v[i]){
                ans++;
            }
        }
        out(ans), out(' '), print(ans + v[8]);
    }
}

Submission status: Runtime Error

Solution code:
n = int(input())
a = sorted(map(int,  v input().split()))
cnt = 0

for k in range(1, 9):
    b = list(filter(lambda x: x < 400*k, a))
    if b:
        cnt += 1
    a = a[len(b):]
if cnt:
    print(cnt, cnt+len(a))
else:
    print(1, len(a))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
color = [False] * 8
over3200 = 0
for a in A:
    for i in range(8):
        if 400*i =< a < 400*(i+1):
            color[i] = True
            break
    else:
        over3200 += 1
if sum(color):
    print(sum(color), end=' ')
    print(sum(color) + over3200)
else:
    print(1, end=' ')
    print(over3200)

Submission status: Runtime Error

Solution code:
colors = { 0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0 }

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

for a in A:
    colors[a // 400] += 1

min_clr = 0
for i in range(0, 8):
    if colors[i] > 0:
        min_clr += 1

print("{} {}".format(min_clr, min_clr + colors[8]))

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))
c=[0]*8
d=0
for a in A:
    if 1<=a<=399:c[0]=1
    elif 400<=a<=799:c[1]=1
    elif 800<=a<1199:c[2]=1
    elif 1200<=a<=1599:c[3]=1
    elif 1600<=a<=1999:c[4]=1
    elif 2000<=a<=2399:c[5]=1
    elif 2400<=a<=2799:c[6]=1
    elif 2800<=a<=3199:c[7]=1
    else:d+=1
if d>0:e=1
else e=0
print(sum(c)+e,sum(c)+d)

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0] * 9
for a in list(map(int, input().split())):
    A[min(a//400, 9)] += 1

ans = 0
for a in A[:-1]:
    ans += int(a>0)
max_ans = min(ans+A[-1], 8)

if A[-1] > 0:
    min_ans = max(1, ans)
else:
    min_ans = ans
print(min_ans, end=" ")
print(max_ans)

Submission status: Runtime Error

Solution code:
N = int(input())
A = [int(_) for _ in input().split()]
colors = [0] * 9
for a in A:
    c = a // 400
    if c < 8:
        colors[c] = 1
    else:
        colors[c] += 1
print(max(sum(colors[:8]), 1), min(sum(colors[:8]) + colors[8], 8))

Submission status: Runtime Error

Solution code:
#C Colorful
import numpy as np
a = int(input())
x = list(map(int,input().split()))
x.sort()
x = x[::-1]
n =0
k = [0,0,0,0,0,0,0]
for i in x:
    if i > 3199:
        n +=1
    elif i < 400:
        k[0] = 1
    elif i < 800:
        k[1] = 1
    elif i < 1200:
        k[2] = 1
    elif i < 1600:
        k[3] = 1
    elif i < 2000:
        k[4] = 1
    elif i < 2400:
        k[5] = 1
    elif i < 2800:
        k[6] = 1
    elif i < 3200:
        k[7] = 1

c = np.array(k)
s = ss= c.sum()

if s < 8:
    ss += n
    if ss > 8:
        ss = 8
print (s)
print (ss)

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[0 for i in range(9)]
for j in range(n):
  l[a[j]//400]+=1
c=0
for k in range(len(l)-1):
  if l[k]>0:c+=1
print(c,c+l[8])

Submission status: Runtime Error

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

s = set()
c = 0

for i in range(n):
    if 1 <= a[i] <= 399:
        s.add(1)

    elif 400 <= a[i] <= 799:
        s.add(2)

    elif 800 <= a[i] <= 1199:
        s.add(3)

    elif 1200 <= a[i] <= 1599:
        s.add(4)

    elif 1600 <= a[i] <= 1999:
        s.add(5)

    elif 2000 <= a[i] <= 2399:
        s.add(6)

    elif 2400 <= a[i] <= 2799:
        s.add(7)

    elif 2800 <= a[i] <= 3199:
        s.add(8)

    else:
        c += 1

if len(s):
    print(len(s), len(s)+c)
elif:
    print(1, c)

Submission status: Runtime Error

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
iro=[0 for i in range(8)]
tyi=0
for i in range(n):
  if a<3200:
    iro[int(a/400)]=1
  else:
    tyi+=1
print(min(iro.count(1)+tyi,8))

Submission status: Runtime Error

Solution code:
n = int(input())
num_list = list(map(int,input().split()))
pros = 0
for i in range(len(num_list)):
    color = num_list[i]//400
    if color < 8:
        num_list[i] = color
    else:
        del(num_list[i])
        pros += 1

min_ans = len(set(num_list))
max_ans = len(set(num_list))+pros
print('{} {}' .format(min_ans,max_ans))

Submission status: Runtime Error

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

baclet = [False] * 9
baclet[8] = 0

for val in a:
    if val < 400:
        baclet[0] = True
    elif val >= 400 and val < 800: 
        baclet[1] = True
    elif val >= 800 and val < 1200: 
        baclet[2] = True
    elif val >= 1200 and val < 1600: 
        baclet[3] = True
    elif val >= 1600 and val < 2000: 
        baclet[4] = True
    elif val >= 2000 and val < 2400: 
        baclet[5] = True
    elif val >= 2400 and val < 2800: 
        baclet[6] = True
    elif val >= 2800 and val < 3200: 
        baclet[7] = True
    elif val >= 3200: 
        baclet[8] += 1

if baclet[:-1].count(True) > 0:
    print(baclet[:-1].count(True),end=" ")
elif backet[8] > 0:
    print(1,end=" ")

if baclet[8] >= 8:
    print(8)
elif 8 - baclet[:-1].count(True) <= baclet[8]:
    print(8)
else:
    print(baclet[:-1].count(True) + baclet[8])

Submission status: Runtime Error

Solution code:
N=int(input())
S=input().split()
for i in range(0,N):
    s=int(S[i])
    if 1<=s<=399:
        S[i]="a"
    if 400<=s<=799:
        S[i]="b"
    if 800<=s<=1199:
        S[i]="c"
    if 1200<=s<=1599:
        S[i]="d"
    if 1600<=s<=1999:
        S[i]="e"
    if 2000<=s<=2399:
        S[i]="f"
    if 2400<=s<=2799:
        S[i]="g"
    if 2800<=s<=3199:
        S[i]="h"
    if 3200<=s:
        S[i]="i"

if "i" in S:
    i=S.count("i")
    B=len(set(S))
    if B=1:
        C=N
        D=N
    else:
        C=B-1
        D=C+i
    
else:
    C=len(set(S))
    D=C

print(C,D)

Submission status: Runtime Error

Solution code:
N=int(input())
S=input().split()
for i in range(0,N):
    s=int(S[i])
    if 1<=s<=399:
        S[i]="a"
    if 400<=s<=799:
        S[i]="b"
    if 800<=s<=1199:
        S[i]="c"
    if 1200<=s<=1599:
        S[i]="d"
    if 1600<=s<=1999:
        S[i]="e"
    if 2000<=s<=2399:
        S[i]="f"
    if 2400<=s<=2799:
        S[i]="g"
    if 2800<=s<=3199:
        S[i]="h"
    if 3200<=s:
        S[i]="i"
if "i" in S:
    B=S.remove("i")
    C=len(set(B)) 
    D=C+S.count("i")
    print(C,D)
else:
    E=len(set(S))
    print(E,E)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().split()))
D = {}
p = 0
for i in range(N) :
    if L[i] < 400 :
        color = 0
    elif L[i] < 800 :
        color = 1
    elif L[i] < 1200 :
        color = 2
    elif L[i] < 1600 :
        color = 3
    elif L[i] < 2000 :
        color = 4
    elif L[i] < 2400 :
        color = 5
    elif L[i] < 2800 :
        color = 6
    elif L[i] < 3200 :
        color = 7
    else :
        p += 1
    if color not in D :
        D[color] = 1
    else :
        D[color] += 1
ans1 = len(list(D.keys()))
ans2 = ans1 + p
print(ans1,ans2)

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))


col = []  # boolean
for rate in range(0, 3200, 400):
    if len(A[(rate <= A) & (A < (rate + 400))]) is not 0:
        col.append(True)
    else:
        col.append(False)

jiyu = len(A[(3200 <= A)])  # 自由枠

# min
mi = sum(col)

# max
if jiyu <= (8 - mi):
    ma = mi+jiyu
else:
    ma = 8

print(mi, ma4)

Submission status: Runtime Error

Solution code:
for i in range(n):
    if a[i] < 400:
        mapa[1] += 1
    elif a[i] < 800:
        mapa[2] += 1
    elif a[i] < 1200:
        mapa[3] += 1
    elif a[i] < 1600:
        mapa[4] += 1
    elif a[i] < 2000:
        mapa[5] += 1
    elif a[i] < 2400:
        mapa[6] += 1
    elif a[i] < 2800:
        mapa[7] += 1
    elif a[i] < 3200:
        mapa[8] += 1
    else:
        el += 1
count = 0
for i in mapa:
    if mapa[i] > 0:
        count += 1
if count > 0:
    print(str(count) + ' ' + str(count + el))
else:
    print('1 ' + str(el))

Submission status: Runtime Error

Solution code:
N = input()
a = list(map(int,input().split()))
over3200 = 0
syurui_min = 0
syurui_max = 0
b = [0] * 8
for i in a:
    if 3200 <= i and i <= 4800:
        over3200 += 1
    else:
        b[min(i // 400)] = 1
for i in b:
    if(i == 1):
        syurui_min += 1
syurui_max = syurui_min + over3200
if syurui_min == 0:
    syurui_min = 1
print("{0} {1}".format(syurui_min, syurui_max))

Submission status: Runtime Error

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

rates = [0]*9
for i in range(n):
  rates[a[i]//400] += 1

n_min, n_max = 0, 0
if max(rates[:-1]) > 0:
  for i in range(8):
    n_min += 1 if rates[i] > 0 else 0
  n_max = n_min+rates[-1]
else:
  n_min = 1
  n_max = rates[-1]

print(n_min, n_max)

Submission status: Runtime Error

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

rates = [0]*9
for i in range(n):
  rates[a[i]//400] += 1

n_min, n_max = 0, 0
if min(rates[:-1]) > 0:
  for i in range(8):
    n_min += 1 if rates[i] > 0 else 0
  n_max = n_min+rates[-1]
else:
  n_min = 1
  n_max = rates[-1]

print(n_min, n_max)

Submission status: Runtime Error

Solution code:

import sys
iN = int(input())
aA = [int(_) for _ in input().split()]

aCol = [0]*(4800//400)
for a in aA:
    aCol[a//400] += 1
iMin = 0
for i in range(8):
    if aCol[i]:
        iMin += 1
iMax = iMin + sum(aCol[8:])
print(iMin,iMax)

Submission status: Runtime Error

Solution code:
import sys
def color(x):
  if x<400:return('灰')
  elif 399<x<800:return('茶')
  elif 799<x<1200:return('緑')
  elif 1199<x<1600:return('水')
  elif 1599<x<2000:return('青')
  elif 1999<x<2400:return('黄')
  elif 2399<x<2800:return('橙')
  elif 2799<x<3200:return('赤')
  else:return('*')
input()
l=list(map(int,input().split()))
l=[color(i) for i in l]
v=l.count('*')
l=len(set(l))
if v==0:
  print(' '.join([l]*2))
  sys.exit()
elif v>len(l):print(v,end=' ')
else: print(l,end=' ')
print(max(l+v,8))

Submission status: Runtime Error

Solution code:
def solve(N, As):
    colors = set()
    allcount = 0
    for a in As:
        if a // 400 < 8:
            colors.add(n)
        else:
            allcount += 1
    return max(len(colors), 1), len(colors) + allcount


if __name__ == "__main__":
    N = int(input())
    As = map(int, input().split(" "))
    m1, m2 = solve(N, As)
    print(m1, m2)

Submission status: Runtime Error

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

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

if a.count(8) > 0:
    print(len(set(a)),len(set(a))+2)
else:
    print(len(set(a))+ '' + len(set(a)))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
hai, tya midori = 0, 0, 0
miz, ao, ki = 0, 0, 0
yanagi, aka, got = 0, 0, 0

for i in a:
  if i<=399:
    hai = 1
  elif i<=799:
    tya = 1
  elif i<=1199:
    midori = 1
  elif i <= 1599:
    miz = 1
  elif i <= 1999:
    ao = 1
  elif i <= 2399:
      ki = 1
  elif i <= 2799:
      yanagi = 1
  elif i <= 3199:
      aka = 1
  elif i <= 4800:
    got += 1
minn = hai+tya+midori+miz+ao+ki+yanagi+aka
if minn + got >= 8:
  maxx = 8
else:
  maxx = minn+got
print(minn, maxx)