ํ’€์ด

pypy3์œผ๋กœ ์ถœ๋ ฅํ•ด์•ผ ์‹œ๊ฐ„์ดˆ๊ณผ๊ฐ€ ๋‚˜์ง€ ์•Š๋Š”๋‹ค~!
  1. N์œผ๋กœ ๊ฐœ์ˆ˜ ์ž…๋ ฅ์„ ๋ฐ›๋Š”๋‹ค.
  2. numbers ๋ผ๋Š” ๋นˆ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋งŒ๋“ค์–ด์ค€๋‹ค.
  3. ๋ฐ›์•„์ค€ N ํšŸ์ˆ˜๋งŒํผ for๋ฌธ์„ ๋Œ๋ฆฌ๋ฉฐ ์ˆซ์ž๋ฅผ ์ž…๋ ฅ๋ฐ›๋Š”๋‹ค.
  4. sortํ•จ์ˆ˜๋ฅผ ์จ์„œ ์˜ค๋ฆ„์ฐจ์ˆœ ์ •๋ ฌ์„ ํ•ด์ค€๋‹ค.
  5. ์ถœ๋ ฅ์€ '\n'.join(๋ฆฌ์ŠคํŠธ) : \n๊ณผ ๊ฐ’์„ ๋„ฃ์–ด์„œ ํ•˜๋‚˜์˜ ๋ฌธ์ž์—ด๋กœ ํ•ฉ์ณ์ค€๋‹ค.

 

import sys
input = sys.stdin.readline

N = int(input())
numbers = []

for _ in range(N):
    numbers.append(int(input()))

numbers.sort()
print('\n'.join(map(str, numbers)))

 

+ Recent posts