Skip to content

Commit

Permalink
[BOJ] 2309 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
heerucan committed May 19, 2022
1 parent d7addf3 commit 152dbac
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions BOJ/15651.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from itertools import combinations

n, m = list(map(int, input().split(' ')))
22 changes: 22 additions & 0 deletions BOJ/2309.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 2309 ๋ฐฑ์ค€ ๋ธŒ๋ก ์ฆˆ1
# ์ •๋ ฌ, ๋ธŒ๋ฃจํŠธํฌ์Šค

from itertools import combinations

data = [] # ์ „์ฒด 9๋ช… ๋‚œ์Ÿ์ด
exceptData = [] # 2๋ช… ๋‚œ์Ÿ์ด

for i in range(9):
data.append(int(input()))

# ๋”ํ•ด์„œ result๊ฐ€ ๋˜๋Š” ๋‚œ์Ÿ์ด๋“ค๋งŒ ๋นผ์ฃผ๋ฉด ๋จ
result = sum(data) - 100

for i in combinations(sorted(data), 2):
if sum(i) == result:
exceptData = list(i)

# 9๋ช… ๋‚œ์Ÿ์ด์—์„œ 2๋ช…์˜ ๊ฐ€์งœ ๋‚œ์Ÿ์ด๋ฅผ ๋บ€ ๋ฐฐ์—ด
for i in [x for x in sorted(data) if x not in exceptData]:
print(i)

0 comments on commit 152dbac

Please sign in to comment.