Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

35-Munbin-Lee #140

Merged
merged 2 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Munbin-Lee/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@
| 32์ฐจ์‹œ | 2024.01.30 | ๋ฐฑํŠธ๋ž˜ํ‚น | <a href="https://www.acmicpc.net/problem/17114">ํ•˜์ดํผ ํ† ๋งˆํ† </a> | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/124 |
| 33์ฐจ์‹œ | 2024.02.04 | ์ •์ˆ˜๋ก  | <a href="https://www.acmicpc.net/problem/14905">์†Œ์ˆ˜ 4๊ฐœ์˜ ํ•ฉ</a> | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/128 |
| 34์ฐจ์‹œ | 2024.02.06 | ๊ตฌํ˜„ | <a href="https://www.acmicpc.net/problem/1756">ํ”ผ์ž ๊ตฝ๊ธฐ</a> | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/133 |
| 35์ฐจ์‹œ | 2024.02.18 | ๋ฐฑํŠธ๋ž˜ํ‚น | <a href="https://www.acmicpc.net/problem/24891">๋‹จ์–ด ๋งˆ๋ฐฉ์ง„</a> | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/140 |
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from itertools import permutations

stdin = open(0)

L, N = map(int, stdin.readline().split())
words = sorted(stdin.read().splitlines())

# ๋‹จ์–ด ์ˆœ์—ด x๊ฐ€ ๋‹จ์–ด ๋งˆ๋ฐฉ์ง„์ธ์ง€ ํ™•์ธํ•˜๋Š” ํ•จ์ˆ˜
def isValid(x):
for i in range(L):
for j in range(L):
if x[i][j] != x[j][i]: return False

return True

for perm in permutations(words, L):
if not isValid(perm): continue

print(*perm, sep='\n')
exit()
Comment on lines +6 to +20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์™€ ๋‹จ์–ด๋ฅผ ์ •๋ ฌํ•œ ๋’ค์—

permutations์œผ๋กœ ์ฒ˜์Œ ๋‚˜์˜ค๋Š” ๊ฑฐ๋ฅผ ์ œ์ถœํ•˜๋ฉด ์™„ํƒํ•  ํ•„์š”๋„ ์—†์ด

์ฒ˜์Œ ๊ฑธ๋ฆฌ๋Š” ๊ฑฐ์—์„œ ๋ฐ”๋กœ ์ œ์ถœํ•˜๋ฉด ๋˜๋‹ˆ๊นŒ

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

์ง€๋ฆฌ๋Š”๋ฐ์š”..

Copy link
Member Author

@Munbin-Lee Munbin-Lee Feb 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ทผ๋ฐ ์™œ ์ฒ˜์Œ ๊ฒƒ์ด ๋‹ต์ธ์ง€๋Š” ๋ชจ๋ฆ„์š”.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ทผ๋ฐ ์™œ ์ฒ˜์Œ ๊ฒƒ์ด ๋‹ต์ธ์ง€๋Š” ๋ชจ๋ฆ„์š”.

์›๋ž˜๋Š” ๋ชจ๋“  ๊ฒฝ์šฐ์˜ ์ˆ˜๋ฅผ ๊ตฌํ•ด์„œ ๊ตฌํ•ด์ง„ ์ •๋‹ต ํ›„๋ณด์ž๋“ค์—์„œ ์ •๋ ฌํ•ด์„œ ์ฒซ ๋ฒˆ์งธ ๊บผ๋ฅผ ์ œ์ถœํ•ด์•ผํ•˜๋Š”๋ฐ (์‚ฌ์ „ ์ˆœ์œผ๋กœ)

๊ทผ๋ฐ ์–ด์ฐจํ”ผ ์ •๋ ฌ ํ•œ ๋’ค์— ๊ฐ€์žฅ ์ฒซ ๋ฒˆ์งธ ๋‚˜์˜ค๋Š” ์นœ๊ตฌ๋Š” ์ •๋ ฌ๋œ ์ƒํƒœ์—์„œ ๋ฝ‘์•˜๊ธฐ ๋•Œ๋ฌธ์— ์–ด์ฐจํ”ผ ์‚ฌ์ „์— ์ฒซ ๋ฒˆ์งธ ์ˆœ์„œ์ธ ๊ฑฐ์ฃ ...

๊ฐœ๋˜‘๋˜‘ํ•œ๋ฐ์š”?


print('NONE')