-
[๋ฐฑ์ค] 5363 ์๋ค with PythonPS 2023. 4. 13. 11:30728x90๋ฐ์ํ
๐ BOJ 5363 ์๋ค
๐ก ์กฐ๊ฑด
์ด๋ฆฐ ์ ๋ค์ด๋ค์ ์๋ค์ ๋ํํ๋ ๋ฒ์ ๋ฐฐ์์ผ ํ๋ค. ์๋ค๋ ๋ชจ๋ ๋ฌธ์ฅ์์ ๊ฐ์ฅ ์ ๋จ์ด ๋ ๊ฐ๋ฅผ ์ ์ผ ๋ง์ง๋ง์ ๋งํ๋ค.
์ด๋ค ๋ฌธ์ฅ์ด ์ฃผ์ด์ก์ ๋, ์๋ค์ ๋ง๋ก ๋ฐ๊ฟ ์ถ๋ ฅํ๋ ๋ฌธ์ .
์ฒซ์งธ ์ค์ ๋ฌธ์ฅ์ ์ N์ด ์ฃผ์ด์ง๋ค. ๋์งธ ์ค๋ถํฐ N๊ฐ์ ์ค์๋ ๊ฐ ๋ฌธ์ฅ์ด ์ฃผ์ด์ง๋ค.
๋ฌธ์ฅ์ ๊ธธ์ด๋ 100๊ธ์ ์ด๋ด์ด๋ค. ๋จ์ด์ ๊ฐ์๋ 3๊ฐ ์ด์์ด๋ค.
๋ฌธ์์ด, ๊ตฌํ ๋ฌธ์
๐ ์์ ๋ฐ ์คํ๊ฒฐ๊ณผ
์์ 1
4 I will go now to find the Wookiee Solo found the death star near planet Kessel I'll fight Darth Maul here and now Vader will find Luke before he can escape์คํ๊ฒฐ๊ณผ 1
go now to find the Wookiee I will the death star near planet Kessel Solo found Darth Maul here and now I'll fight find Luke before he can escape Vader willโจ๏ธ ๋ฌธ์ ํ์ด
- [:2]์ ํด๋นํ๋ ๋ฌธ์๋ฅผ [2:] ์ ํด๋นํ๋ ๋ฌธ์์ด ๋ค์ ๋ถ์ฌ์ฃผ๋ฉด ๋๋ค.
๐ฅ ์์ค ์ฝ๋
from sys import stdin for _ in range(int(stdin.readline())): a = list(stdin.readline().rstrip().split()) print(*(a[2:] + a[:2]))๋ฐ์ํ'PS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค] 4740 ๊ฑฐ์ธ, ์ค! ๊ฑฐ์ธ ๋ฌธ์์ด with Python (0) 2023.04.13 [๋ฐฑ์ค] 12871 ๋ฌดํ ๋ฌธ์์ด with Python (0) 2023.04.13 [๋ฐฑ์ค] 1124 ์ธ๋ํ๋ผ์ with Python (0) 2023.04.11 [๋ฐฑ์ค] 7600 ๋ฌธ์๊ฐ ๋ช๊ฐค๊น with Python (0) 2023.04.11 [๋ฐฑ์ค] 24480 ์๊ณ ๋ฆฌ์ฆ ์์ - ๊น์ด ์ฐ์ ํ์ 2 with Python (0) 2023.04.10