-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bronze II] Title: 수 정렬하기, Time: 40 ms, Memory: 31120 KB -BaekjoonHub
- Loading branch information
1 parent
a0c07bf
commit ea756a3
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# [Bronze II] 수 정렬하기 - 2750 | ||
|
||
[문제 링크](https://www.acmicpc.net/problem/2750) | ||
|
||
### 성능 요약 | ||
|
||
메모리: 31120 KB, 시간: 40 ms | ||
|
||
### 분류 | ||
|
||
정렬, 구현 | ||
|
||
### 제출 일자 | ||
|
||
2024년 5월 26일 10:12:12 | ||
|
||
### 문제 설명 | ||
|
||
<p>N개의 수가 주어졌을 때, 이를 오름차순으로 정렬하는 프로그램을 작성하시오.</p> | ||
|
||
### 입력 | ||
|
||
<p>첫째 줄에 수의 개수 N(1 ≤ N ≤ 1,000)이 주어진다. 둘째 줄부터 N개의 줄에는 수가 주어진다. 이 수는 절댓값이 1,000보다 작거나 같은 정수이다. 수는 중복되지 않는다.</p> | ||
|
||
### 출력 | ||
|
||
<p>첫째 줄부터 N개의 줄에 오름차순으로 정렬한 결과를 한 줄에 하나씩 출력한다.</p> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Q1. 단순히 library 를 쓸 수 있는가? | ||
Q2. 알고리즘을 공부하므로, 직접 구현해본다면 어떤 알고리즘을? | ||
""" | ||
import sys | ||
def cinput(): | ||
return sys.stdin.readline() | ||
|
||
N = int(cinput()) | ||
arr = [] | ||
|
||
for i in range(N): | ||
item = int(cinput()) | ||
arr.append(item) | ||
|
||
arr = sorted(arr) | ||
|
||
for item in arr: | ||
print(item) | ||
|