모험가 N명
공포도 X
반드시 X명 이상으로 구성한 모험가 그룹에 참여해야 여행을 떠날 수 있음
여행을 떠날 수 있는 그룹의 최댓값 구하기
입력 예시
5
2 3 1 2 2
출력 예시
2
N = int,input().split()
X = list(map(int,input().split()))
total = 0
X.sort() # X 정렬
outX = list(set(X)) # X에서 중복 제거
for i in outX:
total += X.count(i) // i
print(total)
3 2 2 2 1
0 1 2 3 4
len 5
n = int(input())
data = list(map(int,input().split()))
data.sort(reverse=True)
i = 0
count = 0
while True:
if i < len(data):
i += data[i]
count += 1
else:
break
print(count)