Skip to content

Commit

Permalink
[#6] 그리디, 수학문제
Browse files Browse the repository at this point in the history
  • Loading branch information
hyesuuou committed Dec 31, 2021
1 parent 94467b0 commit 74dd91e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Boj/그리디/11047.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
n, k = map(int, input().split())
list = []
for i in range(n):
list.append(int(input()))

list.sort(reverse=True)

ans = 0
for i in list:
ans += k//i
k = k % i

print(ans)
13 changes: 13 additions & 0 deletions Boj/기본 수학2/4153.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
while True:
data = list(map(int, input().split()))
if data[0] == 0 and data[1] == 0 and data[2] == 0:
break
maxNum = max(data)
data = set(data) - set([maxNum])
sum = 0
for i in data:
sum += i*i
if sum == maxNum * maxNum:
print("right")
else:
print("wrong")

0 comments on commit 74dd91e

Please sign in to comment.