diff --git a/hadongun/README.md b/hadongun/README.md index 5007188..9ecb9dc 100644 --- a/hadongun/README.md +++ b/hadongun/README.md @@ -1,10 +1,13 @@ -## ✏️ 기록 +### ✏️ 기록 | 차시 | 날짜 | 문제유형 | 링크 | 풀이 | |:----:|:---------:|:----:|:-----:|:----:| - | 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) - | 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) \ No newline at end of file + | 1차시 | 2025.03.18 | 그리디 알고리즘 | [설탕 배달](https://www.acmicpc.net/problem/2839)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/2| + | 2차시 | 2025.03.21 | 그리디 알고리즘 | [로프](https://www.acmicpc.net/problem/2217)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/7| + | 3차시 | 2025.03.25 | 수학 | [보물](https://www.acmicpc.net/problem/1026)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/11| + | 4차시 | 2025.03.27 | 큐 | [ 카드2 ](https://www.acmicpc.net/problem/2164)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/13| + | 5차시 | 2025.04.02 | 스택 | [스택2](https://www.acmicpc.net/problem/28278)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/20| + | 6차시 | 2025.04.04 | 정렬 | [단어 정렬](https://www.acmicpc.net/problem/1181)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/21| + | 7차시 | 2025.04.07 | 스택 | [균형 잡힌 세상](https://www.acmicpc.net/problem/4949)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/25| + + --- \ No newline at end of file diff --git "a/hadongun/\352\267\270\353\246\254\353\223\234 \354\225\214\352\263\240\353\246\254\354\246\230/\354\225\214\353\260\224\354\203\235 \352\260\225\355\230\270.py" "b/hadongun/\352\267\270\353\246\254\353\223\234 \354\225\214\352\263\240\353\246\254\354\246\230/\354\225\214\353\260\224\354\203\235 \352\260\225\355\230\270.py" new file mode 100644 index 0000000..c9372ef --- /dev/null +++ "b/hadongun/\352\267\270\353\246\254\353\223\234 \354\225\214\352\263\240\353\246\254\354\246\230/\354\225\214\353\260\224\354\203\235 \352\260\225\355\230\270.py" @@ -0,0 +1,14 @@ +import sys +N = int(input()) +tip_temp = map(int ,[sys.stdin.readline().strip() for _ in range(N)]) +tip = list(tip_temp) +tip.sort(reverse = True) +receive = 0 +for i in range(1, N + 1): + if tip[i-1] + 1 - i < 0: + continue + receive += (tip[i-1] + 1 - i) + +print(receive) + + diff --git "a/hadongun/\354\212\244\355\203\235/\352\267\240\355\230\225\354\236\241\355\236\214 \354\204\270\354\203\201.py" "b/hadongun/\354\212\244\355\203\235/\352\267\240\355\230\225\354\236\241\355\236\214 \354\204\270\354\203\201.py" new file mode 100644 index 0000000..399a313 --- /dev/null +++ "b/hadongun/\354\212\244\355\203\235/\352\267\240\355\230\225\354\236\241\355\236\214 \354\204\270\354\203\201.py" @@ -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")''' + + + + + +