-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [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
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |