Skip to content

Commit

Permalink
백준/단계별: 파이썬 정렬 문제풀이 (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
sieunnnn committed Sep 27, 2023
1 parent 3003f0b commit 255d4b5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/baekjoon/step/sort/PROB25305.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 코딩생활에 N 명의 학생들이 응시했다. 이들 중 점수가 가장 높은 k 명은 상을 받을 것이다.
# 이때 상을 받는 커트라인이 몇 점인지 구해라.
# 커트라인 : 상을 받는 사람들 중 점수가 가장 낮은 사람의 점수


# N 과 k 입력받기
N, k = map(int, input().split())

# 학생들의 점수를 리스트로 입력받기
scores = list(map(int, input().split()))

print(sorted(scores, reverse=True)[k - 1])
14 changes: 14 additions & 0 deletions src/baekjoon/step/sort/PROB2750.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# N 개의 수가 주어졌을때, 이를 오름차순으로 정렬하는 프로그램을 작성하시오


# N 입력받기
N = int(input())

# 수를 담을 리스트 생성
numbers = []

# N 만큼의 수를 리스트에 더하기
for i in range(N) :
numbers.append(int(input()))

print(*sorted(numbers), sep='\n')

0 comments on commit 255d4b5

Please sign in to comment.