Notice
Recent Posts
Recent Comments
Link
목록타이타닉 (1)
꾸준하게 거북이처럼
침몰하는 타이타닉
from collections import deque n, limit = map(int,input().split()) people = list(map(int,input().split())) people.sort() people = deque(people) count = 0 while people: if len(people) == 1: count += 1 break if people[0] + people[-1] > limit: people.pop() count += 1 else: people.popleft() people.pop() count += 1 print(count) # 모든 사람이 구조되기 위해 필요한 최소!!의 배개수를 구하는 것이기 때문에 2명이 제한이니 2명이서 타고 가는것 # 을 지향 해야..
Algorithm 문제 & 공부/그리디
2022. 6. 4. 11:28