Skip to content

Commit

Permalink
[여름방학 1주차] - 허원일 (#49)
Browse files Browse the repository at this point in the history
* [1주차] : 허원일 - 16503 괄호 없는 사칙연산 Bronze3 (#44)

* Revert "[1주차] : 허원일 - 16503 괄호 없는 사칙연산 Bronze3 (#44)"

This reverts commit 94e885b.

* [1주차] : 허원일 - 16503 괄호 없는 사칙연산 Bronze3 (#44)

* [1주차 : 허원일 - 1699 제곱수의 합 Silver2 (#44)

* [1주차] : 허원일 - 1699 제곱수의 합 Silver2 (#44)

* [1주차] : 허원일 - 크레인 인형뽑기 게임 lv.1 (#44)
  • Loading branch information
wonza-hub authored Jul 11, 2022
1 parent e07ea5c commit a0e263d
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
23 changes: 23 additions & 0 deletions 허원일/16503 괄호 없는 사칙연산.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
a, o_1, b, o_2, c = input().split()
k_1 = int(a)
k_2 = int(b)
k_3 = int(c)

def two_op_cal(op1, oper, op2):
if oper == "+":
return op1 + op2
elif oper == "-":
return op1 - op2
elif oper == "*":
return op1 * op2
elif oper == "/":
return int(op1 / op2)
result1 = two_op_cal(two_op_cal(k_1, o_1, k_2), o_2, k_3)
result2 = two_op_cal(k_1, o_1, two_op_cal(k_2, o_2, k_3))

if (result1 < result2):
print(result1)
print(result2)
else:
print(result2)
print(result1)
13 changes: 13 additions & 0 deletions 허원일/1699 제곱수의 합.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
N = int(input())
d = [0 for i in range(N+1)]
square = [i*i for i in range(1, 317)]

for i in range(1, N+1):
s = []
for j in square:
if j > i:
break
s.append(d[i-j])
d[i] = min(s) + 1

print(d[N])
24 changes: 24 additions & 0 deletions 허원일/크레인 인형뽑기 게임.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
basket = []
result = 0

def solution(board, moves):
for i in moves:
for j in range(len(board)):
if board[len(board)-1][i-1] == 0:
break
item = board[j][i-1]
if item != 0:
board[j][i-1] = 0
stack_cmp(basket, item)
break
return result

def stack_cmp(list, data):
if len(list) == 0 or list[-1] != data:
basket.append(data)
return
if list[-1] == data:
del list[-1]
global result
result += 2
return

0 comments on commit a0e263d

Please sign in to comment.