Skip to content
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
6 changes: 5 additions & 1 deletion hadongun/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
|:----:|:---------:|:----:|:-----:|:----:|
| 1์ฐจ์‹œ | 2024.10.01 | ๊ตฌํ˜„ | [์ถ”์–ต ์ ์ˆ˜](https://school.programmers.co.kr/learn/courses/30/lessons/176963)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/35|
| 2์ฐจ์‹œ | 2025-03-21 | ๊ทธ๋ฆฌ๋”” ์•Œ๊ณ ๋ฆฌ์ฆ˜ | [๋กœํ”„] (https://www.acmicpc.net/problem/2217)
| 3์ฐจ์‹œ | 2025-03-21 | ์ˆ˜ํ•™ | [๋ณด๋ฌผ] (https://www.acmicpc.net/problem/1026)
| 3์ฐจ์‹œ | 2025-03-21 | ์ˆ˜ํ•™ | [๋ณด๋ฌผ] (https://www.acmicpc.net/problem/1026)
| 4์ฐจ์‹œ | 2025-03-27 | ํ | [์นด๋“œ2] (https://www.acmicpc.net/problem/2164)
| 5์ฐจ์‹œ | 2025-04-02 | ์Šคํƒ | [์Šคํƒ2] (https://www.acmicpc.net/problem/28278)
| 6์ฐจ์‹œ | 2025-04-04 | ์ •๋ ฌ | [๋‹จ์–ด์ •๋ ฌ](https://www.acmicpc.net/problem/1181)
| 7์ฐจ์‹œ | 2025-04-07 | ์Šคํƒ | [๊ท ํ˜•์žกํžŒ ์„ธ์ƒ](https://www.acmicpc.net/problem/4949)
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import sys
while True:
charrr = sys.stdin.readline().rstrip()
if charrr == ".":
break
are_you_balanced = True
stack = []
for ch in charrr:
if ch == "(" or ch == "[":
stack.append(ch)
elif ch == ")":
if stack and stack[-1] == "(":
stack.pop()
else:
are_you_balanced = False
break
elif ch == "]":
if stack and stack[-1] == "[":
stack.pop()
else:
are_you_balanced = False
break
if are_you_balanced and not stack:
print("yes")
else:
print("no")

'''import sys
stack = []
roundbalance = 0
anglebalance = 0
while True:
charrr = sys.stdin.readline().strip()
for ch in charrr:
stack.append(ch)
if charrr == "":
break
while stack:
if stack[-1] == "(":
roundbalance += 1
stack.pop()
elif stack[-1] == ")":
roundbalance -= 1
stack.pop()
elif stack[-1] == "[":
anglebalance += 1
stack.pop()
elif stack[-1] == "]":
anglebalance -= 1
stack.pop()
else:
stack.pop()
if len(stack) == 0:
break
if roundbalance == 0 and anglebalance == 0:
print("yes")
else:
print("no")'''






41 changes: 41 additions & 0 deletions hadongun/์ •๋ ฌ/๋‹จ์–ด์ •๋ ฌ.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import sys

def sort_word():
n = int(input())
unsorted_word = [sys.stdin.readline().strip() for _ in range(n)]
sorted_wording = set(unsorted_word)
sorted_word = sorted(sorted_wording, key = lambda x : (len(x), x))
for word in sorted_word:
print(word)
sort_word()


"""
์‹œ๊ฐ„ ์ดˆ๊ณผ๊ฐ€ ๋ฐœ์ƒํ•œ ์ฝ”๋“œ. ๋งž๋Š” ์ง€๋Š” ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค.
def sort_word():
n = int(input())
unsorted_word = sys.stdin.read().splitlines()
for i in range(1, n):
key = len(unsorted_word[i])
j = i -1

while j >=0 and key < len(unsorted_word[j]):
if key == len(unsorted_word[j]):
if unsorted_word[i] == unsorted_word[j]:
del unsorted_word[i]
if unsorted_word[j] > unsorted_word[i]:
temp = unsorted_word[j]
unsorted_word[j] = unsorted_word[i]
unsorted_word[j + 1] = unsorted_word[j]
unsorted_word[j] = unsorted_word[j]
j -= 1




print(unsorted_word)
sort_word()"""