Post

๐ŸฆŠ ZOAC

1. ๋ฌธ์ œ ๋งํฌ

16719๋ฒˆ: ZOAC



2. ์ฝ”๋“œ

pypy3 ๋ฉ”๋ชจ๋ฆฌ 31268kb ์‹œ๊ฐ„ 48ms

1
2
3
4
5
6
7
8
9
10
11
12
13
14
str = input()

# ํ•˜๋‚˜๋ฅผ ์ œ์™ธ์‹œ์ผฐ์„ ๋•Œ ๊ฐ€์žฅ ์•ž์— ์žˆ๋Š” ๋ฌธ์ž์—ด pick
def pick(current_str):
    if len(current_str) <= 0:
        return
    length = len(current_str)
    inspect = current_str[1:length]
    for i in range(length):
        inspect = min(inspect, current_str[0:i] + current_str[(i + 1):length])
    pick(inspect)
    print(current_str)
        
pick(str)
  • ํ•ด์„ค

    ํ˜„์žฌ ๋ฌธ์ž์—ด์—์„œ ํ•˜๋‚˜์˜ ๋ฌธ์ž๋ฅผ ์ œ๊ฑฐํ–ˆ์„ ๋•Œ, ์‚ฌ์ „์ˆœ์œผ๋กœ ๊ฐ€์žฅ ์•ž์„œ๋Š” ๋ฌธ์ž์—ด์„ pick ํ•œ๋‹ค

    ์ œ์™ธํ•œ ๋ฌธ์ž์—ด์„ ์žฌ๊ท€๋กœ ๋‹ค์‹œ ๊ฒ€์‚ฌํ•œ๋‹ค

This post is licensed under CC BY 4.0 by the author.